OneCompiler

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

8 years ago by
Files.copy(Paths.get("/from/location/foo.txt"), Paths.get("/to/location/foo.txt"));
8 years ago by Karthik Divi