@Test public void testListFiles () throws IOException { List<String> relPaths = FileUtils.listFiles(new File("../data/junit/list-files")); assertEquals(4, relPaths.size()); assertEquals(true, relPaths.contains("test2.txt")); assertEquals(true, relPaths.contains("dir1/test1.txt")); assertEquals(true, relPaths.contains("dir1/test3.txt")); assertEquals(true, relPaths.contains("dir1/dir2/dir2test.txt")); }
public static List<String> listFiles (File dir) throws IOException { List<String> relPaths = new ArrayList<>(); FileUtils.listFiles(dir, (file, relFilePath) -> { relPaths.add(relFilePath); }); return relPaths; }
FileUtils { public static List<String> listFiles (File dir) throws IOException { List<String> relPaths = new ArrayList<>(); FileUtils.listFiles(dir, (file, relFilePath) -> { relPaths.add(relFilePath); }); return relPaths; } }
FileUtils { public static List<String> listFiles (File dir) throws IOException { List<String> relPaths = new ArrayList<>(); FileUtils.listFiles(dir, (file, relFilePath) -> { relPaths.add(relFilePath); }); return relPaths; } protected  FileUtils(); }
FileUtils { public static List<String> listFiles (File dir) throws IOException { List<String> relPaths = new ArrayList<>(); FileUtils.listFiles(dir, (file, relFilePath) -> { relPaths.add(relFilePath); }); return relPaths; } protected  FileUtils(); static String readFile(String path, Charset encoding); static List<String> readLines(String path, Charset charset); static void writeFile(String path, String content, Charset encoding); static void recursiveDeleteDirectory(File f); static void recursiveDeleteDirectory(File f, boolean deleteDir); static List<String> listFiles(File dir); static void listFiles(File dir, FileListIterator iterator); static String getUserHomeDir(); static String getAppHomeDir(String appName); static String removeDoubleDotInDir(String path); static File getRelativeFile(File target, File base); static String getDirectoryOfFilePath(String filePath); static void createWritableDirIfAbsent(String dirPath); }
FileUtils { public static List<String> listFiles (File dir) throws IOException { List<String> relPaths = new ArrayList<>(); FileUtils.listFiles(dir, (file, relFilePath) -> { relPaths.add(relFilePath); }); return relPaths; } protected  FileUtils(); static String readFile(String path, Charset encoding); static List<String> readLines(String path, Charset charset); static void writeFile(String path, String content, Charset encoding); static void recursiveDeleteDirectory(File f); static void recursiveDeleteDirectory(File f, boolean deleteDir); static List<String> listFiles(File dir); static void listFiles(File dir, FileListIterator iterator); static String getUserHomeDir(); static String getAppHomeDir(String appName); static String removeDoubleDotInDir(String path); static File getRelativeFile(File target, File base); static String getDirectoryOfFilePath(String filePath); static void createWritableDirIfAbsent(String dirPath);  }