Here you can find the source of renameTo(Path from, Path to, CopyOption... options)
public static boolean renameTo(Path from, Path to, CopyOption... options)
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.nio.file.CopyOption; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static boolean renameTo(Path from, Path to, CopyOption... options) { try {/* w ww . j av a 2s.c o m*/ return Files.move(from, to, options) != null; } catch (IOException e) { return false; } } }