.txt” would be c
create a class named FileUtils. Add a method static void copyFile(String source, String destination) method that copies the source file to the destination location. For example, if called as copyFile(“a.txt”, “b.txt”) the contents of the file “a.txt” would be copied into the file “b.txt.”
a. You must write the code to copy the file using java.io.* classes (e.g. File, FileInputStream, FileOutputStream, etc.).
b. Do not assume that the files will contain only text.
c. You should try to copy efficiently (i.e. not a single byte at a time).
d. It is suggested that you test your method by copying the provided files from the input directory to the output directory in your project.
e. The method should rethrow any exceptions that may occur.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps