Alex Rivera | Logout

java IO to copy one File to another

Asked 2010-03-26T00:00:03.940
20

I have two Java.io.File objects file1 and file2. I want to copy the contents from file1 to file2. Is there an standard way to do this without me having to create a method that reads file1 and write to file2

Edit
Report

1 Answer

1

Or use Files.copy(file1,file2) from Google's Guava library.

answered 2012-03-23T20:29:57.377

Your Answer