Android File Rename renameAs(String pathDir, String name, String wishName)

Here you can find the source of renameAs(String pathDir, String name, String wishName)

Description

rename As

Declaration


public static boolean renameAs(String pathDir, String name,
        String wishName) 

Method Source Code

//package com.java2s;

import java.io.File;

public class Main {

    public static boolean renameAs(String pathDir, String name,
            String wishName) {/*from   w  w  w .j av a  2 s.  co m*/

        if (pathDir != null & name != null & wishName != null) {

            File arch = new File(pathDir + "/" + name);
            File newArch = new File(pathDir + "/" + wishName);

            arch.renameTo(newArch);

            return true;
        }

        return false;
    }
}

Related

  1. mark(String pathName, String tag)
  2. rename(File file1, File file2)
  3. rename(File fromFile, File toFile)
  4. rename(String from, String to)
  5. rename(String oldName, String newName)
  6. renameFile(File source, File dest)
  7. renameFile(String origPath, String destPath)
  8. renameFile(String source, String dest)
  9. renameFile(String strSrc, String strDest)