Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import java.nio.file.Files;
import java.nio.file.*;
public class MoveFilesDemo {
public static void main(String[] args) throws IOException
Path temp = Files.move
Paths.get("C:\\Program Files\\testfile.txt"));
if(temp != null)
System.out.println("File renamed and moved successfully");
System.out.println("Failed to move the file");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.