-
Notifications
You must be signed in to change notification settings - Fork 4
Java copying file with Guava
Ramesh Fadatare edited this page Jul 11, 2019
·
1 revision
Google Guava is an open-source set of common libraries for Java. It includes Files.copy() for copying a file.
The example copies a file with Guava's Files.copy().
import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;
public class CopyFileGuava {
public static void main(String[] args) throws IOException {
File source = new File("src/main/resources/bugs.txt");
File dest = new File("src/main/resources/bugs2.txt");
Files.copy(source, dest);
}
}