List of utility methods to do Directory to File List
List | getAllFileNamesInDir(String folderName) Gets the all file names in dir. List<String> fileList = new ArrayList<String>(); File folder = new File(folderName); if (folder.exists() && folder.isDirectory()) { File[] libs = folder.listFiles(); for (File lib : libs) { fileList.add(lib.getPath()); return fileList; |
String[] | getAllFileNamesWithExtension(String directory, final String extension) get All File Names With Extension return getAllFileNamesWithExtension(new File(directory), extension); |
List | getAllFilePath(String filedir) get All File Path File f = new File(filedir); List<File> l = new ArrayList<File>(); getFilePaths(f, l); return l; |
List | getAllFiles(File dir) get All Files List<File> result = new ArrayList<>(); getAllFilesAux(dir, result); return result; |
File[] | getAllFiles(File dir) get All Files if (!dir.isDirectory()) { throw new IllegalArgumentException(); Vector allFiles = new Vector(); extractFiles(dir, allFiles); int size = allFiles.size(); File[] ret = new File[size]; for (int i = 0; i < size; i++) { ... |
void | getAllFiles(File dir, List get All Files File[] files = dir.listFiles(); for (File file : files) { fileList.add(file); if (file.isDirectory()) { getAllFiles(file, fileList); |
boolean | getAllFiles(File dir, List get All Files try { File[] files = dir.listFiles(); for (File file : files) { fileList.add(file); if (file.isDirectory()) { System.out.println("directory:" + file.getCanonicalPath()); getAllFiles(file, fileList); } else { ... |
List | getAllFiles(File dir, Pattern filter) Gets all files below the given directory. logger.entering("de.axelwernicke.mypod.util.FileUtils", "getAllFiles"); List<File> allFiles = new ArrayList<File>(); try { File[] files = dir.listFiles(); int fileLength = files.length; for (int i = 0; i < fileLength; i++) { if (files[i].isDirectory()) { allFiles.addAll(getAllFiles(files[i], filter)); ... |
List | getAllFiles(File directory) get All Files List<File> fileList = new ArrayList<File>(); File[] files = directory.listFiles(); if (files != null) { for (File file : files) { fileList.add(file); if (file.isDirectory()) { fileList.addAll(getAllFiles(file)); return fileList; |
Collection | getAllFiles(File directory) Collects all non-directory files in the given input directory (recursively). Collection<File> files = new LinkedList<File>(); getAllFilesRecursively(directory, files); return files; |