private List<File> filterFilesForSelectionMode(FileList list) {
		List<File> listCopy =
			list.getFiles().stream().filter(f -> f != null).collect(Collectors.toList());

		if (isFilesAndDirectories()) {
			return listCopy;
		}

		if (fileSelectionMode == GhidraFileChooserMode.DIRECTORIES_ONLY) {
			for (Iterator<File> iterator = listCopy.iterator(); iterator.hasNext();) {
				File file = iterator.next();
				if (!isDirectory(file)) {
					iterator.remove();
				}
			}
		}
		// must be files only
		else {
			for (Iterator<File> iterator = listCopy.iterator(); iterator.hasNext();) {
				File file = iterator.next();
				if (isDirectory(file)) {
					iterator.remove();
				}
			}
		}
		return listCopy;
	}
Returns the selected files.  This will show the file chooser

@return the selected files; an empty array if cancelled or no file was selected
Ghidra/Framework/Docking/src/main/java/docking/widgets/filechooser/GhidraFileChooser.java