String utf8DirPath = "D:\\work\\SVN\\Service2";
Collection<File> javaGbkFileCol = FileUtils.listFiles(new File(srcDirPath), new String[]{"java"}, true);
for (File javaGbkFile : javaGbkFileCol) {
String utf8FilePath = utf8DirPath+javaGbkFile.getAbsolutePath().substring(srcDirPath.length());
FileUtils.writeLines(new File(utf8FilePath), "UTF-8", FileUtils.readLines(javaGbkFile, "GBK"));
}
引用库:commons-io-2.6.jar