Skip to content

Instantly share code, notes, and snippets.

@hacksoldier
Created September 28, 2015 12:47
Show Gist options
  • Select an option

  • Save hacksoldier/594f260f6ab4710ad8e3 to your computer and use it in GitHub Desktop.

Select an option

Save hacksoldier/594f260f6ab4710ad8e3 to your computer and use it in GitHub Desktop.
Move file from previous to new directory
public void moveFile () throws IOException {
File afile =new File(PDF_NAME_DIRECTORY);
if(afile.renameTo(new File("C:\\dati\\newDirectory\\" + afile.getName()))){
System.out.println("File is moved successful!");
}else{
System.out.println("File is failed to move!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment