FileUtil { static public List<String> getFiles(File dir, String regex) { return getFiles(dir, regex, false); }  static boolean deleteDirectory(File dir); static List<String> getFiles(File dir, String regex); static List<String> getFileList(File dir, File file); static List<String> getFileList(File dir, File file, boolean fullPath); static List<String> getFiles(File dir, String regex, boolean fullName);  }
@Test public void testFileUtil() { List<String> files = FileUtil.getFiles(new File("/home/verbs/student/shumin/corpora/ontonotes-release-4.0/data/english/annotations/nw"), ".+\\.parse\\z", true); System.out.println(files.get(50)); files = FileUtil.getFiles(new File("/home/verbs/student/shumin/corpora/ontonotes-release-4.0/data/english/annotations/nw"), ".+\\.parse\\z"); System.out.println(files.get(50)); files = FileUtil.getFiles(new File("/home/verbs/student/shumin/corpora/ontonotes-release-4.0/data/english/annotations/nw/p2.5_c2e/00/p2.5_c2e_0002.parse"), ".+\\.parse\\z"); System.out.println(files.get(0)); files = FileUtil.getFiles(new File("/home/verbs/student/shumin/corpora/ontonotes-release-4.0/data/english/annotations/nw/p2.5_c2e/00/p2.5_c2e_0002.parse"), ".+\\.parse\\z", true); System.out.println(files.get(0)); }