Android Utililty Methods File Rename

List of utility methods to do File Rename

Description

The list of methods to do File Rename are organized into topic(s).

Method

booleanrenameFiles(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;
...
booleanrenameFiles(File file, String regex, String replacement)
rename Files
return renameFiles(file, ".*", regex, replacement);
booleanrenameFile(File file, File newFile, boolean isDeleteExistDestFile)
rename File
if (newFile.exists()) {
    if (isDeleteExistDestFile) {
        newFile.delete();
return file.renameTo(newFile);