Here you can find the source of getFiles(String paths)
private static List<File> getFiles(String paths)
//package com.java2s; //License from project: Apache License import java.io.File; import java.util.ArrayList; import java.util.List; public class Main { private static List<File> getFiles(String paths) { List<File> filesList = new ArrayList<>(); for (final String path : paths.split(File.pathSeparator)) { final File file = new File(path); if (file.isDirectory()) { recurse(filesList, file); } else { filesList.add(file);// w ww .j av a2 s . com } } return filesList; } private static void recurse(List<File> filesList, File f) { File list[] = f.listFiles(); for (File file : list) { if (file.isDirectory()) { recurse(filesList, file); } else { filesList.add(file); } } } }