How to copy file from one location to another location in Java?

Views: 57 Ask New Question


I want to copy and paste a file from one location to another location in Java, Is there any one liner solution available?

On By

1 Answer


Files.copy(Paths.get("/from/location/foo.txt"), Paths.get("/to/location/foo.txt"));
On By


Answer This Question