Created
April 1, 2017 12:53
-
-
Save nerzid/e022f9f1434bfd7b8b3551a6dbcd0757 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 class NewClass { | |
public static boolean chooseDB() throws FileNotSelected { | |
File f = null; | |
if (!checkIfDatabaseIsInProject()) { | |
f = FilePicker.chooseDBFile(); | |
if (f == null) { | |
return false; | |
} | |
} else { | |
f = new File("../db/autocomment.db"); | |
if (f == null) { | |
return false; | |
} | |
if (!f.exists()) { | |
return false; | |
} | |
} | |
DB_FILE_PATH = f.getPath(); | |
System.out.println(DB_FILE_PATH); | |
System.out.println("Database choosen."); | |
isSet = true; | |
return true; | |
} | |
private static boolean checkIfDatabaseIsInProject() { | |
return new File("../db/autocomment.db").exists(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment