-
-
Save angiejones/9170f63f8398226aaa4299376e6bd26c to your computer and use it in GitHub Desktop.
Move downloaded file to test directory
This file contains 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
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