Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package inClassWork;
- import java.io.IOException;
- import java.nio.file.*;
- import java.util.*;
- public class VariousTester {
- public static void main(String[] args) {
- String input = "";
- Path destination;
- Path SOURCE =Paths.get("C:/Users");
- System.out.println("Please write a file's diretory location.");
- Scanner s = new Scanner(System.in);
- input = s.nextLine(); // I've been using C:/Users/gdog2_000/Desktop/temp.txt although that file has now disappeared
- destination = Paths.get(input);
- try {
- Files.move(SOURCE, destination, StandardCopyOption.REPLACE_EXISTING);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement