title: Moveing files with java
body: <p>I'm trying to move files using this java code and it can locate the file but not move it, just deletes the directory I'm moving it to.</p>
  
  <pre><code>public void ch() throws Exception{
     if (FC.showOpenDialog(null) == JFileChooser.APPROVE_OPTION){
         java.io.File file = FC.getSelectedFile();
         Scanner input = new Scanner(file);
         System.out.println(file);
  
         Path source = Paths.get(file + "");
         Path target = Paths.get("C:\\Users\\Marcus\\Desktop\\2");       
         try {
             Files.move(source, target, REPLACE_EXISTING);
         } catch (IOException e){ 
             System.out.println("Failed to move the file");
         }
     }else{
         System.out.println("?");
     }
  }
  </code></pre>