@Test public void walk() { final File dir1 = createDirectories("dir1"); final File dir12 = createDirectories("dir1", "dir2"); final File dir2 = createDirectories("dir2"); final File dir3 = createDirectories("dir3"); createFiles(dir1, "f1.txt", "f2.txt", "f3.txt"); createFiles(dir12, "f1.txt", "f4.txt"); createFiles(dir2); createFiles(dir3, "f1.txt"); Assert.assertEquals(CollectionUtils.asSet( new File(dir1, "f1.txt"), new File(dir1, "f2.txt"), new File(dir1, "f3.txt"), new File(dir12, "f1.txt"), new File(dir12, "f4.txt"), new File(dir3, "f1.txt")), new HashSet<>(FileUtil.walk(file)) ); }
public static List<File> walk(File source) { if (!source.isDirectory()) { return Collections.singletonList(source); } final File[] files = source.listFiles(); return walk(Arrays.asList(files)); }
FileUtil { public static List<File> walk(File source) { if (!source.isDirectory()) { return Collections.singletonList(source); } final File[] files = source.listFiles(); return walk(Arrays.asList(files)); } }
FileUtil { public static List<File> walk(File source) { if (!source.isDirectory()) { return Collections.singletonList(source); } final File[] files = source.listFiles(); return walk(Arrays.asList(files)); } private  FileUtil(); }
FileUtil { public static List<File> walk(File source) { if (!source.isDirectory()) { return Collections.singletonList(source); } final File[] files = source.listFiles(); return walk(Arrays.asList(files)); } private  FileUtil(); static void write(String text, File target); static Uri getUri(Context context, String authority, File file); static void saveBitmap(Bitmap bitmap, File targetFile, int quality); static void saveBitmap(Bitmap bitmap, File targetFile, Bitmap.CompressFormat format, int quality); static void zip(List<File> sources, File target); static List<File> walk(File source); static List<File> walk(List<File> sources); static String uniqueName(File source, Set<String> taken); static String getFileExtension(File file); static String getFileNameWithoutExtention(File file); }
FileUtil { public static List<File> walk(File source) { if (!source.isDirectory()) { return Collections.singletonList(source); } final File[] files = source.listFiles(); return walk(Arrays.asList(files)); } private  FileUtil(); static void write(String text, File target); static Uri getUri(Context context, String authority, File file); static void saveBitmap(Bitmap bitmap, File targetFile, int quality); static void saveBitmap(Bitmap bitmap, File targetFile, Bitmap.CompressFormat format, int quality); static void zip(List<File> sources, File target); static List<File> walk(File source); static List<File> walk(List<File> sources); static String uniqueName(File source, Set<String> taken); static String getFileExtension(File file); static String getFileNameWithoutExtention(File file);  }