Java Rename File renameDirectory(File fromDir, File toDir)

Here you can find the source of renameDirectory(File fromDir, File toDir)

Description

rename Directory

License

Open Source License

Declaration

public static boolean renameDirectory(File fromDir, File toDir) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static boolean renameDirectory(File fromDir, File toDir) {
        if (fromDir.exists() && fromDir.isDirectory()) {
            if (fromDir.renameTo(toDir))
                return true;
            else//from ww w  .  jav  a2 s  .  com
                return false;
        } else
            return false;
    }
}

Related

  1. rename_file_to_file(String n1, String n2)
  2. renameBackup(File backupFile)
  3. renameCanDelete()
  4. renameContigs(File aliasFile, File cytobandFile, File seqDir)
  5. renameDirectory(File directory, File newDirectory)
  6. renameDirectory(String in_currentDirectoryPath, String in_newDirectoryPath)
  7. renameDirectory(String newDir, String oldDir)
  8. renameExcludedFiles(File existingBinaryFolder, Collection excludedBids)
  9. renameExistingWithRetries(final File fromFile, final File toFile)