Skip to content

Instantly share code, notes, and snippets.

@angiejones
Created January 28, 2019 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angiejones/9170f63f8398226aaa4299376e6bd26c to your computer and use it in GitHub Desktop.
Save angiejones/9170f63f8398226aaa4299376e6bd26c to your computer and use it in GitHub Desktop.
Move downloaded file to test directory
public static boolean moveFile(File file, String destination){
File existingFile = new File(destination);
if(existingFile.exists()){
existingFile.delete();
}
return file.renameTo(new File(destination));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment