Android File Move move(String input, String output)

Here you can find the source of move(String input, String output)

Description

This class moves an input file to output file

Parameter

Parameter Description
String output file

Declaration

public static void move(String input, String output) throws Exception 

Method Source Code

//package com.java2s;
import java.io.*;

public class Main {
    /**/*from w w  w .  j av  a2s. c om*/
     *   This class moves an input file to output file
     *
     *   @param String input file to move from
     *   @param String output file
     *
     */
    public static void move(String input, String output) throws Exception {
        File inputFile = new File(input);
        File outputFile = new File(output);
        try {
            inputFile.renameTo(outputFile);
        } catch (Exception ex) {
            throw new Exception("Can not mv" + input + " to " + output
                    + ex.getMessage());
        }
    }
}

Related

  1. move(File file, File directory)
  2. move(File source, File destination)
  3. move(String sourceFileName, String destinationFileName)
  4. moveFile(String sourceFileName, String destPath)
  5. moveSubFiles(String sourceFileName, String destPath)
  6. moveFile(File source, File target)
  7. moveFile(File src, File dest)
  8. moveFile(String in, String out)