Java File Move nui move(File from, File to)

Here you can find the source of move(File from, File to)

Description

move

License

Apache License

Declaration

public static void move(File from, File to) throws IOException 

Method Source Code

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

import java.io.File;

import java.io.IOException;

import java.nio.file.Files;

import java.nio.file.StandardCopyOption;

public class Main {
    public static void move(File from, File to) throws IOException {
        copyFile(from, to);/* www .  jav a  2 s  .  c o  m*/
        from.delete();
    }

    public static void copyFile(File src, File dst) throws IOException {

        Files.copy(src.toPath(), dst.toPath(), StandardCopyOption.REPLACE_EXISTING);
    }
}

Related

  1. move(File from, File to)
  2. move(File in, File out)
  3. move(File source, File destination)
  4. move(final File from, final File to, final boolean replace)
  5. move(String sourceFile, String targetFile)