Here you can find the source of moveFile(Path from, Path to)
public static void moveFile(Path from, Path to) throws IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; public class Main { public static void moveFile(Path from, Path to) throws IOException { Files.move(from, to, StandardCopyOption.REPLACE_EXISTING); }/*from w w w . j a v a 2s.c o m*/ }