Created
September 27, 2017 12:35
-
-
Save aleem006/4b95209cf9ec0b16dbcfbb9d16aafde5 to your computer and use it in GitHub Desktop.
Copying a file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.File; | |
| import java.io.IOException; | |
| import java.nio.file.CopyOption; | |
| import java.nio.file.Files; | |
| import java.nio.file.StandardCopyOption; | |
| public class Main { | |
| public static void main(String[] args) throws IOException { | |
| File src = new File("C:\\Users\\DELL\\Desktop\\testfile4.txt"); | |
| File dst = new File("C:\\Users\\DELL\\Desktop\\testfile4.txt"); | |
| Files.copy(src.toPath(), dst.toPath(), | |
| StandardCopyOption.REPLACE_EXISTING); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment