logo image

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


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

1 Answer

2 years ago by

Files.copy(Paths.get("/from/location/foo.txt"), Paths.get("/to/location/foo.txt"));
2 years ago by Megamind