mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
Cleanup
This commit is contained in:
parent
2c744bad48
commit
2f4a40d95f
@ -110,16 +110,18 @@ public final class SqliteEamDbSettings {
|
|||||||
ModuleSettings.setConfigSetting("CentralRepository", "db.badTags", String.join(",", badTags)); // NON-NLS
|
ModuleSettings.setConfigSetting("CentralRepository", "db.badTags", String.join(",", badTags)); // NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verify that the db file exists.
|
||||||
|
*
|
||||||
|
* @return true if exists, else false
|
||||||
|
*/
|
||||||
public boolean dbFileExists() {
|
public boolean dbFileExists() {
|
||||||
//if(dbDirectoryExists()){
|
File dbFile = new File(getFileNameWithPath());
|
||||||
File dbFile = new File(getFileNameWithPath());
|
if(! dbFile.exists()){
|
||||||
if(! dbFile.exists()){
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
// It's unlikely, but make sure the file isn't actually a directory
|
||||||
// It's unlikely, but make sure the file isn't actually a directory
|
return ( ! dbFile.isDirectory());
|
||||||
return ( ! dbFile.isDirectory());
|
|
||||||
//}
|
|
||||||
//return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -354,7 +354,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
@Messages({"EamDbSettingsDialog.okButton.createDbError.title=Unable to Create Database",
|
@Messages({"EamDbSettingsDialog.okButton.createDbError.title=Unable to Create Database",
|
||||||
"EamDbSettingsDialog.okButton.createSQLiteDbError.message=Unable to create SQLite Database, please ensure location exists and you have write permissions and try again.",
|
"EamDbSettingsDialog.okButton.createSQLiteDbError.message=Unable to create SQLite Database, please ensure location exists and you have write permissions and try again.",
|
||||||
"EamDbSettingsDialog.okButton.createPostgresDbError.message=Unable to create Postgres Database, please ensure address, port, and login credentials are correct for Postgres server and try again."})
|
"EamDbSettingsDialog.okButton.createPostgresDbError.message=Unable to create Postgres Database, please ensure address, port, and login credentials are correct for Postgres server and try again."})
|
||||||
private void createDb(boolean removeIncompleteDatabase) {
|
private void createDb() {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
boolean dbCreated = true;
|
boolean dbCreated = true;
|
||||||
switch (selectedPlatform) {
|
switch (selectedPlatform) {
|
||||||
@ -368,7 +368,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
// Remove the incomplete database
|
// Remove the incomplete database
|
||||||
if(dbCreated && removeIncompleteDatabase){
|
if(dbCreated){
|
||||||
dbSettingsPostgres.deleteDatabase();
|
dbSettingsPostgres.deleteDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
&& dbSettingsSqlite.insertDefaultDatabaseContent();
|
&& dbSettingsSqlite.insertDefaultDatabaseContent();
|
||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
if(dbCreated && removeIncompleteDatabase){
|
if(dbCreated){
|
||||||
dbSettingsSqlite.deleteDatabase();
|
dbSettingsSqlite.deleteDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ public class EamDbSettingsDialog extends JDialog {
|
|||||||
Bundle.EamDbSettingsDialog_okButton_createDbDialog_message(),
|
Bundle.EamDbSettingsDialog_okButton_createDbDialog_message(),
|
||||||
Bundle.EamDbSettingsDialog_okButton_createDbDialog_title(),
|
Bundle.EamDbSettingsDialog_okButton_createDbDialog_title(),
|
||||||
JOptionPane.YES_NO_OPTION)) {
|
JOptionPane.YES_NO_OPTION)) {
|
||||||
createDb(testingStatus == DatabaseTestResult.DB_DOES_NOT_EXIST);
|
createDb();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user