List of utility methods to do File Rename
boolean | renameFiles(File file, String filterRegex, String replaceRegex, String replacement) recursively rename all sub files while matches filterRegex, replace each substring of filename that matches replaceRegex with the given replacement. if (!file.exists()) return true; if (file.isDirectory()) { File[] subFiles = file.listFiles(); for (File subFile : subFiles) { if (!renameFiles(subFile, filterRegex, replaceRegex, replacement)) return false; ... |
boolean | renameFiles(File file, String regex, String replacement) rename Files return renameFiles(file, ".*", regex, replacement); |
boolean | renameFile(File file, File newFile, boolean isDeleteExistDestFile) rename File if (newFile.exists()) { if (isDeleteExistDestFile) { newFile.delete(); return file.renameTo(newFile); |