Java Rename File rename_file_to_file(String n1, String n2)

Here you can find the source of rename_file_to_file(String n1, String n2)

Description

renamfiltfile

License

LGPL

Declaration

public static boolean rename_file_to_file(String n1, String n2) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.io.File;

public class Main {
    public static boolean rename_file_to_file(String n1, String n2) {
        try {//from   w  w w . ja  va 2  s . c  o m
            File f1 = new File(n1);
            File f2 = new File(n2);
            return (f1 != null && f2 != null ? f1.renameTo(f2) : false);
        } catch (SecurityException e) {
            return false;
        }
    }
}

Related

  1. reName(String s, String s1)
  2. rename(String srcFilename, String destFilename)
  3. rename(String srcPath, String destPath)
  4. rename(String strFileName, String strRenameToName)
  5. rename(String was_name, String new_name)
  6. renameBackup(File backupFile)
  7. renameCanDelete()
  8. renameContigs(File aliasFile, File cytobandFile, File seqDir)
  9. renameDirectory(File directory, File newDirectory)