Merge remote-tracking branch 'upstream/develop' into 2953_hash_import_speed

Conflicts:
	Core/src/org/sleuthkit/autopsy/centralrepository/optionspanel/ImportHashDatabaseDialog.java
This commit is contained in:
Ann Priestman 2017-08-29 10:04:32 -04:00
commit bda2bb5331
12 changed files with 1393 additions and 952 deletions

View File

@ -36,8 +36,11 @@ public interface EamDb {
* @throws EamDbException * @throws EamDbException
*/ */
static EamDb getInstance() throws EamDbException { static EamDb getInstance() throws EamDbException {
EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.DISABLED;
if (EamDbUtil.useCentralRepo()) {
selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
}
switch (selectedPlatform) { switch (selectedPlatform) {
case POSTGRESQL: case POSTGRESQL:
return PostgresEamDb.getInstance(); return PostgresEamDb.getInstance();
@ -86,7 +89,8 @@ public interface EamDb {
* @return Is the database enabled * @return Is the database enabled
*/ */
static boolean isEnabled() { static boolean isEnabled() {
return EamDbPlatformEnum.getSelectedPlatform() != EamDbPlatformEnum.DISABLED; return EamDbUtil.useCentralRepo()
&& EamDbPlatformEnum.getSelectedPlatform() != EamDbPlatformEnum.DISABLED;
} }
/** /**

View File

@ -3,7 +3,6 @@
* To change this template file, choose Tools | Templates * To change this template file, choose Tools | Templates
* and open the template in the editor. * and open the template in the editor.
*/ */
package org.sleuthkit.autopsy.centralrepository.datamodel; package org.sleuthkit.autopsy.centralrepository.datamodel;
import java.sql.Connection; import java.sql.Connection;
@ -15,13 +14,17 @@ import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
import static org.sleuthkit.autopsy.centralrepository.datamodel.EamDb.SCHEMA_VERSION; import static org.sleuthkit.autopsy.centralrepository.datamodel.EamDb.SCHEMA_VERSION;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
/** /**
* *
*/ */
public class EamDbUtil { public class EamDbUtil {
private final static Logger LOGGER = Logger.getLogger(EamDbUtil.class.getName()); private final static Logger LOGGER = Logger.getLogger(EamDbUtil.class.getName());
private static final String CENTRAL_REPO_NAME = "CentralRepository";
private static final String CENTRAL_REPO_USE_KEY = "db.useCentralRepo";
/** /**
* Close the prepared statement. * Close the prepared statement.
* *
@ -72,11 +75,12 @@ public class EamDbUtil {
} }
} }
} }
/** /**
* Insert the default correlation types into the database. * Insert the default correlation types into the database.
* *
* @param conn Open connection to use. * @param conn Open connection to use.
*
* @return true on success, else false * @return true on success, else false
*/ */
public static boolean insertDefaultCorrelationTypes(Connection conn) { public static boolean insertDefaultCorrelationTypes(Connection conn) {
@ -104,7 +108,7 @@ public class EamDbUtil {
} }
return true; return true;
} }
/** /**
* Store the schema version into the db_info table. * Store the schema version into the db_info table.
* *
@ -112,6 +116,7 @@ public class EamDbUtil {
* loaded. * loaded.
* *
* @param conn Open connection to use. * @param conn Open connection to use.
*
* @return true on success, else false * @return true on success, else false
*/ */
public static boolean insertSchemaVersion(Connection conn) { public static boolean insertSchemaVersion(Connection conn) {
@ -133,14 +138,14 @@ public class EamDbUtil {
/** /**
* Query to see if the SCHEMA_VERSION is set in the db. * Query to see if the SCHEMA_VERSION is set in the db.
* *
* @return true if set, else false. * @return true if set, else false.
*/ */
public static boolean schemaVersionIsSet(Connection conn) { public static boolean schemaVersionIsSet(Connection conn) {
if (null == conn) { if (null == conn) {
return false; return false;
} }
ResultSet resultSet = null; ResultSet resultSet = null;
try { try {
Statement tester = conn.createStatement(); Statement tester = conn.createStatement();
@ -157,17 +162,38 @@ public class EamDbUtil {
return true; return true;
} }
/** /**
* Use the current settings and the validation query * If the Central Repos use has been enabled.
* to test the connection to the database. *
* * @return true if the Central Repo may be configured, false if it should
* not be able to be
*/
public static boolean useCentralRepo() {
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(CENTRAL_REPO_NAME, CENTRAL_REPO_USE_KEY));
}
/**
* Saves the setting for whether the Central Repo should be able to be
* configured.
*
* @param centralRepoCheckBoxIsSelected - true if the central repo can be
* used
*/
public static void setUseCentralRepo(boolean centralRepoCheckBoxIsSelected) {
ModuleSettings.setConfigSetting(CENTRAL_REPO_NAME, CENTRAL_REPO_USE_KEY, Boolean.toString(centralRepoCheckBoxIsSelected));
}
/**
* Use the current settings and the validation query to test the connection
* to the database.
*
* @return true if successfull query execution, else false. * @return true if successfull query execution, else false.
*/ */
public static boolean executeValidationQuery(Connection conn, String validationQuery) { public static boolean executeValidationQuery(Connection conn, String validationQuery) {
if (null == conn) { if (null == conn) {
return false; return false;
} }
ResultSet resultSet = null; ResultSet resultSet = null;
try { try {
Statement tester = conn.createStatement(); Statement tester = conn.createStatement();
@ -183,22 +209,23 @@ public class EamDbUtil {
return false; return false;
} }
/** /**
* Conver thte Type's DbTableName string to the *_instances table name. * Conver thte Type's DbTableName string to the *_instances table name.
* *
* @param type Correlation Type * @param type Correlation Type
* @return Instance table name for this Type. *
* @return Instance table name for this Type.
*/ */
public static String correlationTypeToInstanceTableName(EamArtifact.Type type) { public static String correlationTypeToInstanceTableName(EamArtifact.Type type) {
return type.getDbTableName() + "_instances"; return type.getDbTableName() + "_instances";
} }
/** /**
* Convert the Type's DbTableName string to the reference_* table name. * Convert the Type's DbTableName string to the reference_* table name.
* *
* @param type Correlation Type * @param type Correlation Type
*
* @return Reference table name for this Type. * @return Reference table name for this Type.
*/ */
public static String correlationTypeToReferenceTableName(EamArtifact.Type type) { public static String correlationTypeToReferenceTableName(EamArtifact.Type type) {

View File

@ -23,12 +23,16 @@ import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Level; import java.util.logging.Level;
import org.apache.commons.dbcp2.BasicDataSource; import org.apache.commons.dbcp2.BasicDataSource;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
/** /**
* Sqlite implementation of the Central Repository database * Sqlite implementation of the Central Repository database.
* All methods in AbstractSqlEamDb that read or write to the database should
* be overriden here and use appropriate locking.
*/ */
public class SqliteEamDb extends AbstractSqlEamDb { public class SqliteEamDb extends AbstractSqlEamDb {
@ -39,6 +43,10 @@ public class SqliteEamDb extends AbstractSqlEamDb {
private BasicDataSource connectionPool = null; private BasicDataSource connectionPool = null;
private final SqliteEamDbSettings dbSettings; private final SqliteEamDbSettings dbSettings;
// While the Sqlite database should only be used for single users, it is still
// possible for multiple threads to attempt to write to the database simultaneously.
private final ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock(true);
/** /**
* Get the singleton instance of SqliteEamDb * Get the singleton instance of SqliteEamDb
@ -96,35 +104,42 @@ public class SqliteEamDb extends AbstractSqlEamDb {
@Override @Override
public void reset() throws EamDbException { public void reset() throws EamDbException {
Connection conn = connect(); try{
acquireExclusiveLock();
Connection conn = connect();
try { try {
Statement dropContent = conn.createStatement();
dropContent.executeUpdate("DELETE FROM organizations");
dropContent.executeUpdate("DELETE FROM cases");
dropContent.executeUpdate("DELETE FROM data_sources");
dropContent.executeUpdate("DELETE FROM reference_sets");
dropContent.executeUpdate("DELETE FROM artifact_types");
dropContent.executeUpdate("DELETE FROM db_info");
String instancesTemplate = "DELETE FROM %s_instances"; Statement dropContent = conn.createStatement();
String referencesTemplate = "DELETE FROM global_files"; dropContent.executeUpdate("DELETE FROM organizations");
for (EamArtifact.Type type : DEFAULT_CORRELATION_TYPES) { dropContent.executeUpdate("DELETE FROM cases");
dropContent.executeUpdate(String.format(instancesTemplate, type.getDbTableName())); dropContent.executeUpdate("DELETE FROM data_sources");
// FUTURE: support other reference types dropContent.executeUpdate("DELETE FROM reference_sets");
if (type.getId() == EamArtifact.FILES_TYPE_ID) { dropContent.executeUpdate("DELETE FROM artifact_types");
dropContent.executeUpdate(String.format(referencesTemplate, type.getDbTableName())); dropContent.executeUpdate("DELETE FROM db_info");
String instancesTemplate = "DELETE FROM %s_instances";
String referencesTemplate = "DELETE FROM global_files";
for (EamArtifact.Type type : DEFAULT_CORRELATION_TYPES) {
dropContent.executeUpdate(String.format(instancesTemplate, type.getDbTableName()));
// FUTURE: support other reference types
if (type.getId() == EamArtifact.FILES_TYPE_ID) {
dropContent.executeUpdate(String.format(referencesTemplate, type.getDbTableName()));
}
} }
dropContent.executeUpdate("VACUUM");
} catch (SQLException ex) {
LOGGER.log(Level.WARNING, "Failed to reset database.", ex);
} finally {
EamDbUtil.closeConnection(conn);
} }
dropContent.executeUpdate("VACUUM"); dbSettings.insertDefaultDatabaseContent();
} catch (SQLException ex) {
LOGGER.log(Level.WARNING, "Failed to reset database.", ex);
} finally { } finally {
EamDbUtil.closeConnection(conn); releaseExclusiveLock();
} }
dbSettings.insertDefaultDatabaseContent();
} }
/** /**
@ -192,5 +207,752 @@ public class SqliteEamDb extends AbstractSqlEamDb {
public void setBadTags(List<String> badTags) { public void setBadTags(List<String> badTags) {
dbSettings.setBadTags(badTags); dbSettings.setBadTags(badTags);
} }
/**
* Add a new name/value pair in the db_info table.
*
* @param name Key to set
* @param value Value to set
*
* @throws EamDbException
*/
@Override
public void newDbInfo(String name, String value) throws EamDbException {
try{
acquireExclusiveLock();
super.newDbInfo(name, value);
} finally {
releaseExclusiveLock();
}
}
/**
* Get the value for the given name from the name/value db_info table.
*
* @param name Name to search for
*
* @return value associated with name.
*
* @throws EamDbException
*/
@Override
public String getDbInfo(String name) throws EamDbException {
try{
acquireSharedLock();
return super.getDbInfo(name);
} finally {
releaseSharedLock();
}
}
/**
* Update the value for a name in the name/value db_info table.
*
* @param name Name to find
* @param value Value to assign to name.
*
* @throws EamDbException
*/
@Override
public void updateDbInfo(String name, String value) throws EamDbException {
try{
acquireExclusiveLock();
super.updateDbInfo(name, value);
} finally {
releaseExclusiveLock();
}
}
/**
* Creates new Case in the database
*
* Expects the Organization for this case to already exist in the database.
*
* @param eamCase The case to add
*/
@Override
public void newCase(EamCase eamCase) throws EamDbException {
try{
acquireExclusiveLock();
super.newCase(eamCase);
} finally {
releaseExclusiveLock();
}
}
/**
* Updates an existing Case in the database
*
* @param eamCase The case to update
*/
@Override
public void updateCase(EamCase eamCase) throws EamDbException {
try{
acquireExclusiveLock();
super.updateCase(eamCase);
} finally {
releaseExclusiveLock();
}
}
/**
* Retrieves Case details based on Case UUID
*
* @param caseUUID unique identifier for a case
*
* @return The retrieved case
*/
@Override
public EamCase getCaseDetails(String caseUUID) throws EamDbException {
try{
acquireSharedLock();
return super.getCaseDetails(caseUUID);
} finally {
releaseSharedLock();
}
}
/**
* Retrieves cases that are in DB.
*
* @return List of cases
*/
@Override
public List<EamCase> getCases() throws EamDbException {
try{
acquireSharedLock();
return super.getCases();
} finally {
releaseSharedLock();
}
}
/**
* Creates new Data Source in the database
*
* @param eamDataSource the data source to add
*/
@Override
public void newDataSource(EamDataSource eamDataSource) throws EamDbException {
try{
acquireExclusiveLock();
super.newDataSource(eamDataSource);
} finally {
releaseExclusiveLock();
}
}
/**
* Updates a Data Source in the database
*
* @param eamDataSource the data source to update
*/
@Override
public void updateDataSource(EamDataSource eamDataSource) throws EamDbException {
try{
acquireExclusiveLock();
super.updateDataSource(eamDataSource);
} finally {
releaseExclusiveLock();
}
}
/**
* Retrieves Data Source details based on data source device ID
*
* @param dataSourceDeviceId the data source device ID number
*
* @return The data source
*/
@Override
public EamDataSource getDataSourceDetails(String dataSourceDeviceId) throws EamDbException {
try{
acquireSharedLock();
return super.getDataSourceDetails(dataSourceDeviceId);
} finally {
releaseSharedLock();
}
}
/**
* Return a list of data sources in the DB
*
* @return list of data sources in the DB
*/
@Override
public List<EamDataSource> getDataSources() throws EamDbException {
try{
acquireSharedLock();
return super.getDataSources();
} finally {
releaseSharedLock();
}
}
/**
* Inserts new Artifact(s) into the database. Should add associated Case and
* Data Source first.
*
* @param eamArtifact The artifact to add
*/
@Override
public void addArtifact(EamArtifact eamArtifact) throws EamDbException {
try{
acquireExclusiveLock();
super.addArtifact(eamArtifact);
} finally {
releaseExclusiveLock();
}
}
/**
* Retrieves eamArtifact instances from the database that are associated
* with the eamArtifactType and eamArtifactValue of the given eamArtifact.
*
* @param eamArtifact The type/value to look up (artifact with 0 instances)
*
* @return List of artifact instances for a given type/value
*/
@Override
public List<EamArtifactInstance> getArtifactInstancesByTypeValue(EamArtifact.Type aType, String value) throws EamDbException {
try{
acquireSharedLock();
return super.getArtifactInstancesByTypeValue(aType, value);
} finally {
releaseSharedLock();
}
}
/**
* Retrieves eamArtifact instances from the database that are associated
* with the aType and filePath
*
* @param aType EamArtifact.Type to search for
* @param filePath File path to search for
*
* @return List of 0 or more EamArtifactInstances
*
* @throws EamDbException
*/
@Override
public List<EamArtifactInstance> getArtifactInstancesByPath(EamArtifact.Type aType, String filePath) throws EamDbException {
try{
acquireSharedLock();
return super.getArtifactInstancesByPath(aType, filePath);
} finally {
releaseSharedLock();
}
}
/**
* Retrieves number of artifact instances in the database that are
* associated with the ArtifactType and artifactValue of the given artifact.
*
* @param eamArtifact Artifact with artifactType and artifactValue to search
* for
*
* @return Number of artifact instances having ArtifactType and
* ArtifactValue.
*/
@Override
public Long getCountArtifactInstancesByTypeValue(EamArtifact.Type aType, String value) throws EamDbException {
try{
acquireSharedLock();
return super.getCountArtifactInstancesByTypeValue(aType, value);
} finally {
releaseSharedLock();
}
}
/**
* Using the ArtifactType and ArtifactValue from the given eamArtfact,
* compute the ratio of: (The number of unique case_id/datasource_id tuples
* where Type/Value is found) divided by (The total number of unique
* case_id/datasource_id tuples in the database) expressed as a percentage.
*
* @param eamArtifact Artifact with artifactType and artifactValue to search
* for
*
* @return Int between 0 and 100
*/
@Override
public int getCommonalityPercentageForTypeValue(EamArtifact.Type aType, String value) throws EamDbException {
try{
acquireSharedLock();
return super.getCommonalityPercentageForTypeValue(aType, value);
} finally {
releaseSharedLock();
}
}
/**
* Retrieves number of unique caseDisplayName / dataSource tuples in the
* database that are associated with the artifactType and artifactValue of
* the given artifact.
*
* @param eamArtifact Artifact with artifactType and artifactValue to search
* for
*
* @return Number of unique tuples
*/
@Override
public Long getCountUniqueCaseDataSourceTuplesHavingTypeValue(EamArtifact.Type aType, String value) throws EamDbException {
try{
acquireSharedLock();
return super.getCountUniqueCaseDataSourceTuplesHavingTypeValue(aType, value);
} finally {
releaseSharedLock();
}
}
/**
* Retrieves number of unique caseDisplayName/dataSource tuples in the
* database.
*
* @return Number of unique tuples
*/
@Override
public Long getCountUniqueCaseDataSourceTuples() throws EamDbException {
try{
acquireSharedLock();
return super.getCountUniqueCaseDataSourceTuples();
} finally {
releaseSharedLock();
}
}
/**
* Retrieves number of eamArtifact instances in the database that are
* associated with the caseDisplayName and dataSource of the given
* eamArtifact instance.
*
* @param caseUUID Case ID to search for
* @param dataSourceID Data source ID to search for
*
* @return Number of artifact instances having caseDisplayName and
* dataSource
*/
@Override
public Long getCountArtifactInstancesByCaseDataSource(String caseUUID, String dataSourceID) throws EamDbException {
try{
acquireSharedLock();
return super.getCountArtifactInstancesByCaseDataSource(caseUUID, dataSourceID);
} finally {
releaseSharedLock();
}
}
/**
* Executes a bulk insert of the eamArtifacts added from the
* prepareBulkArtifact() method
*/
@Override
public void bulkInsertArtifacts() throws EamDbException {
try{
acquireExclusiveLock();
super.bulkInsertArtifacts();
} finally {
releaseExclusiveLock();
}
}
/**
* Executes a bulk insert of the cases
*/
@Override
public void bulkInsertCases(List<EamCase> cases) throws EamDbException {
try{
acquireExclusiveLock();
super.bulkInsertCases(cases);
} finally {
releaseExclusiveLock();
}
}
/**
* Sets an eamArtifact instance as knownStatus = "Bad". If eamArtifact
* exists, it is updated. If eamArtifact does not exist nothing happens
*
* @param eamArtifact Artifact containing exactly one (1) ArtifactInstance.
*/
@Override
public void setArtifactInstanceKnownBad(EamArtifact eamArtifact) throws EamDbException {
try{
acquireExclusiveLock();
super.setArtifactInstanceKnownBad(eamArtifact);
} finally {
releaseExclusiveLock();
}
}
/**
* Gets list of matching eamArtifact instances that have knownStatus =
* "Bad".
*
* @param aType EamArtifact.Type to search for
* @param value Value to search for
*
* @return List with 0 or more matching eamArtifact instances.
*/
@Override
public List<EamArtifactInstance> getArtifactInstancesKnownBad(EamArtifact.Type aType, String value) throws EamDbException {
try{
acquireSharedLock();
return super.getArtifactInstancesKnownBad(aType, value);
} finally {
releaseSharedLock();
}
}
/**
* Count matching eamArtifacts instances that have knownStatus = "Bad".
*
* @param aType EamArtifact.Type to search for
* @param value Value to search for
*
* @return Number of matching eamArtifacts
*/
@Override
public Long getCountArtifactInstancesKnownBad(EamArtifact.Type aType, String value) throws EamDbException {
try{
acquireSharedLock();
return super.getCountArtifactInstancesKnownBad(aType, value);
} finally {
releaseSharedLock();
}
}
/**
* Gets list of distinct case display names, where each case has 1+ Artifact
* Instance matching eamArtifact with knownStatus = "Bad".
*
* @param aType EamArtifact.Type to search for
* @param value Value to search for
*
* @return List of cases containing this artifact with instances marked as
* bad
*
* @throws EamDbException
*/
@Override
public List<String> getListCasesHavingArtifactInstancesKnownBad(EamArtifact.Type aType, String value) throws EamDbException {
try{
acquireSharedLock();
return super.getListCasesHavingArtifactInstancesKnownBad(aType, value);
} finally {
releaseSharedLock();
}
}
/**
* Is the artifact known as bad according to the reference entries?
*
* @param aType EamArtifact.Type to search for
* @param value Value to search for
*
* @return Global known status of the artifact
*/
@Override
public boolean isArtifactlKnownBadByReference(EamArtifact.Type aType, String value) throws EamDbException {
try{
acquireSharedLock();
return super.isArtifactlKnownBadByReference(aType, value);
} finally {
releaseSharedLock();
}
}
/**
* Add a new organization
*
* @param eamOrg The organization to add
*
* @throws EamDbException
*/
@Override
public void newOrganization(EamOrganization eamOrg) throws EamDbException {
try{
acquireExclusiveLock();
super.newOrganization(eamOrg);
} finally {
releaseExclusiveLock();
}
}
/**
* Get all organizations
*
* @return A list of all organizations
*
* @throws EamDbException
*/
@Override
public List<EamOrganization> getOrganizations() throws EamDbException {
try{
acquireSharedLock();
return super.getOrganizations();
} finally {
releaseSharedLock();
}
}
/**
* Get an organization having the given ID
*
* @param orgID The id to look up
*
* @return The organization with the given ID
*
* @throws EamDbException
*/
@Override
public EamOrganization getOrganizationByID(int orgID) throws EamDbException {
try{
acquireSharedLock();
return super.getOrganizationByID(orgID);
} finally {
releaseSharedLock();
}
}
/**
* Add a new Global Set
*
* @param eamGlobalSet The global set to add
*
* @return The ID of the new global set
*
* @throws EamDbException
*/
@Override
public int newReferencelSet(EamGlobalSet eamGlobalSet) throws EamDbException {
try{
acquireExclusiveLock();
return super.newReferencelSet(eamGlobalSet);
} finally {
releaseExclusiveLock();
}
}
/**
* Get a reference set by ID
*
* @param referenceSetID The ID to look up
*
* @return The global set associated with the ID
*
* @throws EamDbException
*/
@Override
public EamGlobalSet getReferenceSetByID(int referenceSetID) throws EamDbException {
try{
acquireSharedLock();
return super.getReferenceSetByID(referenceSetID);
} finally {
releaseSharedLock();
}
}
/**
* Add a new reference instance
*
* @param eamGlobalFileInstance The reference instance to add
* @param correlationType Correlation Type that this Reference
* Instance is
*
* @throws EamDbException
*/
@Override
public void addReferenceInstance(EamGlobalFileInstance eamGlobalFileInstance, EamArtifact.Type correlationType) throws EamDbException {
try{
acquireExclusiveLock();
super.addReferenceInstance(eamGlobalFileInstance, correlationType);
} finally {
releaseExclusiveLock();
}
}
/**
* Insert the bulk collection of Reference Type Instances
*
* @throws EamDbException
*/
@Override
public void bulkInsertReferenceTypeEntries(Set<EamGlobalFileInstance> globalInstances, EamArtifact.Type contentType) throws EamDbException {
try{
acquireExclusiveLock();
super.bulkInsertReferenceTypeEntries(globalInstances, contentType);
} finally {
releaseExclusiveLock();
}
}
/**
* Get all reference entries having a given correlation type and value
*
* @param aType Type to use for matching
* @param aValue Value to use for matching
*
* @return List of all global file instances with a type and value
*
* @throws EamDbException
*/
@Override
public List<EamGlobalFileInstance> getReferenceInstancesByTypeValue(EamArtifact.Type aType, String aValue) throws EamDbException {
try{
acquireSharedLock();
return super.getReferenceInstancesByTypeValue(aType, aValue);
} finally {
releaseSharedLock();
}
}
/**
* Add a new EamArtifact.Type to the db.
*
* @param newType New type to add.
*
* @return ID of this new Correlation Type
*
* @throws EamDbException
*/
@Override
public int newCorrelationType(EamArtifact.Type newType) throws EamDbException {
try{
acquireExclusiveLock();
return super.newCorrelationType(newType);
} finally {
releaseExclusiveLock();
}
}
/**
* Get the list of EamArtifact.Type's that will be used to correlate
* artifacts.
*
* @return List of EamArtifact.Type's. If none are defined in the database,
* the default list will be returned.
*
* @throws EamDbException
*/
@Override
public List<EamArtifact.Type> getCorrelationTypes() throws EamDbException {
try{
acquireSharedLock();
return super.getCorrelationTypes();
} finally {
releaseSharedLock();
}
}
/**
* Get the list of enabled EamArtifact.Type's that will be used to correlate
* artifacts.
*
* @return List of enabled EamArtifact.Type's. If none are defined in the
* database, the default list will be returned.
*
* @throws EamDbException
*/
@Override
public List<EamArtifact.Type> getEnabledCorrelationTypes() throws EamDbException {
try{
acquireSharedLock();
return super.getEnabledCorrelationTypes();
} finally {
releaseSharedLock();
}
}
/**
* Get the list of supported EamArtifact.Type's that can be used to
* correlate artifacts.
*
* @return List of supported EamArtifact.Type's. If none are defined in the
* database, the default list will be returned.
*
* @throws EamDbException
*/
@Override
public List<EamArtifact.Type> getSupportedCorrelationTypes() throws EamDbException {
try{
acquireSharedLock();
return super.getSupportedCorrelationTypes();
} finally {
releaseSharedLock();
}
}
/**
* Update a EamArtifact.Type.
*
* @param aType EamArtifact.Type to update.
*
* @throws EamDbException
*/
@Override
public void updateCorrelationType(EamArtifact.Type aType) throws EamDbException {
try{
acquireExclusiveLock();
super.updateCorrelationType(aType);
} finally {
releaseExclusiveLock();
}
}
/**
* Get the EamArtifact.Type that has the given Type.Id.
*
* @param typeId Type.Id of Correlation Type to get
*
* @return EamArtifact.Type or null if it doesn't exist.
*
* @throws EamDbException
*/
@Override
public EamArtifact.Type getCorrelationTypeById(int typeId) throws EamDbException {
try{
acquireSharedLock();
return super.getCorrelationTypeById(typeId);
} finally {
releaseSharedLock();
}
}
/**
* Acquire the lock that provides exclusive access to the case database.
* Call this method in a try block with a call to
* the lock release method in an associated finally block.
*/
private void acquireExclusiveLock() {
rwLock.writeLock().lock();
}
/**
* Release the lock that provides exclusive access to the database.
* This method should always be called in the finally
* block of a try block in which the lock was acquired.
*/
private void releaseExclusiveLock() {
rwLock.writeLock().unlock();
}
/**
* Acquire the lock that provides shared access to the case database.
* Call this method in a try block with a call to the
* lock release method in an associated finally block.
*/
private void acquireSharedLock() {
rwLock.readLock().lock();
}
/**
* Release the lock that provides shared access to the database.
* This method should always be called in the finally block
* of a try block in which the lock was acquired.
*/
private void releaseSharedLock() {
rwLock.readLock().unlock();
}
} }

View File

@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.centralrepository.datamodel;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.InvalidPathException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.SQLException; import java.sql.SQLException;
@ -93,7 +94,7 @@ public final class SqliteEamDbSettings {
if (badTagsStr == null) { if (badTagsStr == null) {
badTagsStr = DEFAULT_BAD_TAGS; badTagsStr = DEFAULT_BAD_TAGS;
} }
if(badTagsStr.isEmpty()){ if (badTagsStr.isEmpty()) {
badTags = new ArrayList<>(); badTags = new ArrayList<>();
} else { } else {
badTags = new ArrayList<>(Arrays.asList(badTagsStr.split(","))); badTags = new ArrayList<>(Arrays.asList(badTagsStr.split(",")));
@ -111,13 +112,13 @@ public final class SqliteEamDbSettings {
/** /**
* Verify that the db directory path exists. * Verify that the db directory path exists.
* *
* @return true if exists, else false * @return true if exists, else false
*/ */
public boolean dbDirectoryExists() { public boolean dbDirectoryExists() {
// Ensure dbDirectory is a valid directory // Ensure dbDirectory is a valid directory
File dbDir = new File(getDbDirectory()); File dbDir = new File(getDbDirectory());
if (!dbDir.exists()) { if (!dbDir.exists()) {
return false; return false;
} else if (!dbDir.isDirectory()) { } else if (!dbDir.isDirectory()) {
@ -130,7 +131,7 @@ public final class SqliteEamDbSettings {
/** /**
* Create the db directory if it does not exist. * Create the db directory if it does not exist.
* *
* @return true is successfully created or already exists, else false * @return true is successfully created or already exists, else false
*/ */
public boolean createDbDirectory() { public boolean createDbDirectory() {
@ -139,7 +140,7 @@ public final class SqliteEamDbSettings {
File dbDir = new File(getDbDirectory()); File dbDir = new File(getDbDirectory());
Files.createDirectories(dbDir.toPath()); Files.createDirectories(dbDir.toPath());
LOGGER.log(Level.INFO, "sqlite directory did not exist, created it at {0}.", getDbDirectory()); // NON-NLS LOGGER.log(Level.INFO, "sqlite directory did not exist, created it at {0}.", getDbDirectory()); // NON-NLS
} catch (IOException ex) { } catch (IOException | InvalidPathException | SecurityException ex) {
LOGGER.log(Level.SEVERE, "Failed to create sqlite database directory.", ex); // NON-NLS LOGGER.log(Level.SEVERE, "Failed to create sqlite database directory.", ex); // NON-NLS
return false; return false;
} }
@ -162,10 +163,11 @@ public final class SqliteEamDbSettings {
} }
/** /**
* Use the current settings to get an ephemeral client connection for testing. * Use the current settings to get an ephemeral client connection for
* * testing.
*
* If the directory path does not exist, it will return null. * If the directory path does not exist, it will return null.
* *
* @return Connection or null. * @return Connection or null.
*/ */
private Connection getEphemeralConnection() { private Connection getEphemeralConnection() {
@ -186,9 +188,9 @@ public final class SqliteEamDbSettings {
} }
/** /**
* Use the current settings and the validation query * Use the current settings and the validation query to test the connection
* to test the connection to the database. * to the database.
* *
* @return true if successfull connection, else false. * @return true if successfull connection, else false.
*/ */
public boolean verifyConnection() { public boolean verifyConnection() {
@ -196,16 +198,16 @@ public final class SqliteEamDbSettings {
if (null == conn) { if (null == conn) {
return false; return false;
} }
boolean result = EamDbUtil.executeValidationQuery(conn, VALIDATION_QUERY); boolean result = EamDbUtil.executeValidationQuery(conn, VALIDATION_QUERY);
EamDbUtil.closeConnection(conn); EamDbUtil.closeConnection(conn);
return result; return result;
} }
/** /**
* Use the current settings and the schema version query * Use the current settings and the schema version query to test the
* to test the database schema. * database schema.
* *
* @return true if successfull connection, else false. * @return true if successfull connection, else false.
*/ */
public boolean verifyDatabaseSchema() { public boolean verifyDatabaseSchema() {
@ -247,7 +249,6 @@ public final class SqliteEamDbSettings {
// NOTE: The organizations will only have a small number of rows, so // NOTE: The organizations will only have a small number of rows, so
// an index is probably not worthwhile. // an index is probably not worthwhile.
StringBuilder createCasesTable = new StringBuilder(); StringBuilder createCasesTable = new StringBuilder();
createCasesTable.append("CREATE TABLE IF NOT EXISTS cases ("); createCasesTable.append("CREATE TABLE IF NOT EXISTS cases (");
createCasesTable.append("id integer primary key autoincrement NOT NULL,"); createCasesTable.append("id integer primary key autoincrement NOT NULL,");
@ -346,7 +347,6 @@ public final class SqliteEamDbSettings {
// NOTE: the db_info table currenly only has 1 row, so having an index // NOTE: the db_info table currenly only has 1 row, so having an index
// provides no benefit. // provides no benefit.
Connection conn = null; Connection conn = null;
try { try {
conn = getEphemeralConnection(); conn = getEphemeralConnection();
@ -385,7 +385,7 @@ public final class SqliteEamDbSettings {
for (EamArtifact.Type type : DEFAULT_CORRELATION_TYPES) { for (EamArtifact.Type type : DEFAULT_CORRELATION_TYPES) {
reference_type_dbname = EamDbUtil.correlationTypeToReferenceTableName(type); reference_type_dbname = EamDbUtil.correlationTypeToReferenceTableName(type);
instance_type_dbname = EamDbUtil.correlationTypeToInstanceTableName(type); instance_type_dbname = EamDbUtil.correlationTypeToInstanceTableName(type);
stmt.execute(String.format(createArtifactInstancesTableTemplate.toString(), instance_type_dbname, instance_type_dbname)); stmt.execute(String.format(createArtifactInstancesTableTemplate.toString(), instance_type_dbname, instance_type_dbname));
stmt.execute(String.format(instancesIdx1, instance_type_dbname, instance_type_dbname)); stmt.execute(String.format(instancesIdx1, instance_type_dbname, instance_type_dbname));
stmt.execute(String.format(instancesIdx2, instance_type_dbname, instance_type_dbname)); stmt.execute(String.format(instancesIdx2, instance_type_dbname, instance_type_dbname));
@ -397,7 +397,7 @@ public final class SqliteEamDbSettings {
stmt.execute(String.format(createReferenceTypesTableTemplate.toString(), reference_type_dbname, reference_type_dbname)); stmt.execute(String.format(createReferenceTypesTableTemplate.toString(), reference_type_dbname, reference_type_dbname));
stmt.execute(String.format(referenceTypesIdx1, reference_type_dbname, reference_type_dbname)); stmt.execute(String.format(referenceTypesIdx1, reference_type_dbname, reference_type_dbname));
stmt.execute(String.format(referenceTypesIdx2, reference_type_dbname, reference_type_dbname)); stmt.execute(String.format(referenceTypesIdx2, reference_type_dbname, reference_type_dbname));
} }
} }
} catch (SQLException ex) { } catch (SQLException ex) {
LOGGER.log(Level.SEVERE, "Error initializing db schema.", ex); // NON-NLS LOGGER.log(Level.SEVERE, "Error initializing db schema.", ex); // NON-NLS
@ -422,7 +422,7 @@ public final class SqliteEamDbSettings {
EamDbUtil.closeConnection(conn); EamDbUtil.closeConnection(conn);
return result; return result;
} }
public boolean isChanged() { public boolean isChanged() {
String dbNameString = ModuleSettings.getConfigSetting("CentralRepository", "db.sqlite.dbName"); // NON-NLS String dbNameString = ModuleSettings.getConfigSetting("CentralRepository", "db.sqlite.dbName"); // NON-NLS
String dbDirectoryString = ModuleSettings.getConfigSetting("CentralRepository", "db.sqlite.dbDirectory"); // NON-NLS String dbDirectoryString = ModuleSettings.getConfigSetting("CentralRepository", "db.sqlite.dbDirectory"); // NON-NLS

View File

@ -13,7 +13,7 @@ EamSqliteSettingsDialog.bnCancel.text=Cancel
EamSqliteSettingsDialog.lbTestDatabase.text= EamSqliteSettingsDialog.lbTestDatabase.text=
EamSqliteSettingsDialog.bnTestDatabase.text=Test Connection EamSqliteSettingsDialog.bnTestDatabase.text=Test Connection
EamSqliteSettingsDialog.lbTestDatabaseWarning.text= EamSqliteSettingsDialog.lbTestDatabaseWarning.text=
EamSqliteSettingsDialog.bnDatabasePathFileOpen.text=Open... EamSqliteSettingsDialog.bnDatabasePathFileOpen.text=Browse...
EamSqliteSettingsDialog.tfDatabasePath.toolTipText=Filename and path to store SQLite db file EamSqliteSettingsDialog.tfDatabasePath.toolTipText=Filename and path to store SQLite db file
EamSqliteSettingsDialog.tfDatabasePath.text= EamSqliteSettingsDialog.tfDatabasePath.text=
EamSqliteSettingsDialog.lbDatabasePath.text=Database Path : EamSqliteSettingsDialog.lbDatabasePath.text=Database Path :
@ -52,24 +52,16 @@ ManageTagsDialog.cancelButton.text=Cancel
ManageArtifactTypesDialog.taInstructionsMsg.text=Enable one or more correlation properties to use for correlation during ingest. Note, these properties are global and impact all users of the central repository. ManageArtifactTypesDialog.taInstructionsMsg.text=Enable one or more correlation properties to use for correlation during ingest. Note, these properties are global and impact all users of the central repository.
EamSqliteSettingsDialog.bnOk.text=OK EamSqliteSettingsDialog.bnOk.text=OK
EamPostgresSettingsDialog.bnSave.text=Save EamPostgresSettingsDialog.bnSave.text=Save
EamDbSettingsDialog.pnDatabaseConnectionSettings.border.title=Database Settings EamDbSettingsDialog.bnDatabasePathFileOpen.text=Browse...
EamDbSettingsDialog.rdioBnPostgreSQL.text=PostgreSQL
EamDbSettingsDialog.rdioBnSQLite.text=SQLite
EamDbSettingsDialog.bnDatabasePathFileOpen.text=Open...
EamDbSettingsDialog.tfDatabasePath.toolTipText=Filename and path to store SQLite db file EamDbSettingsDialog.tfDatabasePath.toolTipText=Filename and path to store SQLite db file
EamDbSettingsDialog.tfDatabasePath.text= EamDbSettingsDialog.tfDatabasePath.text=
EamDbSettingsDialog.lbDatabasePath.text=Database Path : EamDbSettingsDialog.lbDatabasePath.text=Database Path :
EamDbSettingsDialog.rdioBnDisabled.text=Disabled
EamDbSettingsDialog.bnCancel.text=Cancel EamDbSettingsDialog.bnCancel.text=Cancel
EamDbSettingsDialog.bnOk.text=OK EamDbSettingsDialog.bnOk.text=OK
EamDbSettingsDialog.bnTest.text=Test
EamDbSettingsDialog.lbHostName.text=Host Name / IP : EamDbSettingsDialog.lbHostName.text=Host Name / IP :
EamDbSettingsDialog.lbDatabaseName.text=Database name :
EamDbSettingsDialog.lbUserPassword.text=User Password : EamDbSettingsDialog.lbUserPassword.text=User Password :
EamDbSettingsDialog.lbUserName.text=User Name : EamDbSettingsDialog.lbUserName.text=User Name :
EamDbSettingsDialog.lbPort.text=Port : EamDbSettingsDialog.lbPort.text=Port :
EamDbSettingsDialog.bnCreateDb.text=Create
EamDbSettingsDialog.pnSetupGuidance.border.title=Setup Guidance
GlobalSettingsPanel.pnDatabaseConfiguration.title=Database Configuration GlobalSettingsPanel.pnDatabaseConfiguration.title=Database Configuration
GlobalSettingsPanel.lbDbPlatformTypeLabel.text=Type: GlobalSettingsPanel.lbDbPlatformTypeLabel.text=Type:
GlobalSettingsPanel.lbDbNameLabel.text=Name: GlobalSettingsPanel.lbDbNameLabel.text=Name:

View File

@ -29,12 +29,11 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0"> <Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Component id="pnSetupGuidance" max="32767" attributes="0"/> <Component id="pnButtons" max="32767" attributes="0"/>
<Component id="pnDatabaseConnectionSettings" alignment="0" max="32767" attributes="0"/> <Component id="pnSQLiteSettings" alignment="0" max="32767" attributes="0"/>
<Component id="pnButtons" alignment="1" max="32767" attributes="0"/>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
@ -43,303 +42,22 @@
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Component id="pnSetupGuidance" min="-2" max="-2" attributes="0"/> <Component id="pnSQLiteSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Component id="pnDatabaseConnectionSettings" min="-2" pref="348" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnButtons" min="-2" max="-2" attributes="0"/> <Component id="pnButtons" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/> <EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents> <SubComponents>
<Container class="javax.swing.JPanel" name="pnDatabaseConnectionSettings">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Database Settings">
<ResourceString PropertyName="titleX" bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.pnDatabaseConnectionSettings.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<Font PropertyName="font" name="Tahoma" size="12" style="0"/>
</TitledBorder>
</Border>
</Property>
<Property name="name" type="java.lang.String" value="" noResource="true"/>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="rdioBnPostgreSQL" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="rdioBnSQLite" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="rdioBnDisabled" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="pnSQLiteSettings" alignment="0" max="32767" attributes="0"/>
<Component id="pnPostgreSQLSettings" alignment="1" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Component id="rdioBnDisabled" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
<Component id="rdioBnSQLite" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnSQLiteSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
<Component id="rdioBnPostgreSQL" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="pnPostgreSQLSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="329" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnSQLiteSettings">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="lbDatabasePath" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="tfDatabasePath" min="-2" pref="343" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="bnDatabasePathFileOpen" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lbDatabasePath" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
<Component id="tfDatabasePath" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
<Component id="bnDatabasePathFileOpen" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="lbDatabasePath">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbDatabasePath.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="tfDatabasePath">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.tfDatabasePath.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.tfDatabasePath.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="tfDatabasePathFocusLost"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="bnDatabasePathFileOpen">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnDatabasePathFileOpen.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnDatabasePathFileOpenActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnPostgreSQLSettings">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<EtchetBorder/>
</Border>
</Property>
</Properties>
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lbHostName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbPort" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbDatabaseName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbUserName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbUserPassword" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="tbDbUsername" alignment="0" pref="439" max="32767" attributes="0"/>
<Component id="tbDbName" alignment="0" max="32767" attributes="0"/>
<Component id="tbDbPort" alignment="0" max="32767" attributes="0"/>
<Component id="tbDbHostname" max="32767" attributes="0"/>
<Component id="jpDbPassword" max="32767" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" attributes="0">
<Component id="tbDbHostname" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="lbHostName" alignment="1" min="-2" pref="22" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="tbDbPort" alignment="0" max="32767" attributes="0"/>
<Component id="lbPort" alignment="0" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="tbDbName" alignment="0" max="32767" attributes="0"/>
<Component id="lbDatabaseName" alignment="0" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="tbDbUsername" alignment="0" max="32767" attributes="0"/>
<Component id="lbUserName" alignment="0" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lbUserPassword" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
<Component id="jpDbPassword" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="19" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="lbHostName">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbHostName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lbPort">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbPort.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lbUserName">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbUserName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lbUserPassword">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbUserPassword.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lbDatabaseName">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbDatabaseName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="tbDbHostname">
</Component>
<Component class="javax.swing.JTextField" name="tbDbPort">
</Component>
<Component class="javax.swing.JTextField" name="tbDbName">
</Component>
<Component class="javax.swing.JTextField" name="tbDbUsername">
</Component>
<Component class="javax.swing.JPasswordField" name="jpDbPassword">
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JRadioButton" name="rdioBnSQLite">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.rdioBnSQLite.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdioBnSQLiteActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="rdioBnPostgreSQL">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.rdioBnPostgreSQL.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdioBnPostgreSQLActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="rdioBnDisabled">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.rdioBnDisabled.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rdioBnDisabledActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="pnButtons"> <Container class="javax.swing.JPanel" name="pnButtons">
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="bnTest" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbTestIcon" min="-2" pref="20" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="bnCreateDb" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbCreateIcon" min="-2" pref="21" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Component id="bnOk" min="-2" max="-2" attributes="0"/> <Component id="bnOk" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/> <EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
@ -352,20 +70,11 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace min="0" pref="0" max="-2" attributes="0"/> <EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<Component id="lbCreateIcon" max="32767" attributes="0"/> <Component id="bnOk" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbTestIcon" alignment="1" max="32767" attributes="0"/> <Component id="bnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="bnOk" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="bnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="bnTest" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="bnCreateDb" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -391,40 +100,13 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnOkActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnOkActionPerformed"/>
</Events> </Events>
</Component> </Component>
<Component class="javax.swing.JButton" name="bnTest">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnTest.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnTestActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="bnCreateDb">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnCreateDb.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnCreateDbActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lbTestIcon">
</Component>
<Component class="javax.swing.JLabel" name="lbCreateIcon">
</Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Container class="javax.swing.JPanel" name="pnSetupGuidance"> <Container class="javax.swing.JPanel" name="pnSQLiteSettings">
<Properties> <Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo"> <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
<TitledBorder title="Setup Guidance"> <EtchetBorder/>
<ResourceString PropertyName="titleX" bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.pnSetupGuidance.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<Font PropertyName="font" name="Tahoma" size="12" style="0"/>
</TitledBorder>
</Border> </Border>
</Property> </Property>
</Properties> </Properties>
@ -434,55 +116,176 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" max="32767" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <Component id="lbHostName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbPort" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbUserName" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbDatabaseType" alignment="0" min="-2" pref="82" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="lbDatabasePath" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="lbUserPassword" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="cbDatabaseType" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="lbSingleUserSqLite" pref="467" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="tfDatabasePath" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="bnDatabasePathFileOpen" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="tbDbHostname" max="32767" attributes="0"/>
<Component id="jpDbPassword" alignment="0" max="32767" attributes="0"/>
<Component id="tbDbUsername" alignment="1" max="32767" attributes="0"/>
<Component id="tbDbPort" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group>
</Group>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" groupAlignment="3" attributes="0">
<Component id="cbDatabaseType" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbSingleUserSqLite" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="lbDatabaseType" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0">
<EmptySpace max="32767" attributes="0"/> <Component id="lbDatabasePath" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
<Component id="tfDatabasePath" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
<Component id="bnDatabasePathFileOpen" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="tbDbHostname" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbHostName" alignment="3" min="-2" pref="22" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="tbDbPort" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbPort" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="tbDbUsername" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="lbUserName" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lbUserPassword" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
<Component id="jpDbPassword" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents> <SubComponents>
<Container class="javax.swing.JScrollPane" name="jScrollPane1"> <Component class="javax.swing.JLabel" name="lbDatabasePath">
<Properties> <Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<Border info="null"/> <ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbDatabasePath.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <Component class="javax.swing.JTextField" name="tfDatabasePath">
<SubComponents> <Properties>
<Component class="javax.swing.JTextArea" name="taSetupGuidance"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<Properties> <ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.tfDatabasePath.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<Property name="editable" type="boolean" value="false"/> </Property>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<Color blue="f0" green="f0" red="f0" type="rgb"/> <ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.tfDatabasePath.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="columns" type="int" value="20"/> </Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> </Component>
<Font name="Monospaced" size="12" style="0"/> <Component class="javax.swing.JButton" name="bnDatabasePathFileOpen">
</Property> <Properties>
<Property name="lineWrap" type="boolean" value="true"/> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<Property name="rows" type="int" value="3"/> <ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.bnDatabasePathFileOpen.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<Property name="tabSize" type="int" value="4"/> </Property>
<Property name="wrapStyleWord" type="boolean" value="true"/> </Properties>
<Property name="autoscrolls" type="boolean" value="false"/> <Events>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnDatabasePathFileOpenActionPerformed"/>
<Border info="null"/> </Events>
</Property> </Component>
<Property name="requestFocusEnabled" type="boolean" value="false"/> <Component class="javax.swing.JLabel" name="lbHostName">
<Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/> <Properties>
</Properties> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
</Component> <ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbHostName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</SubComponents> </Property>
</Container> </Properties>
</Component>
<Component class="javax.swing.JTextField" name="tbDbHostname">
</Component>
<Component class="javax.swing.JLabel" name="lbPort">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbPort.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="tbDbPort">
</Component>
<Component class="javax.swing.JLabel" name="lbUserName">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbUserName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="tbDbUsername">
</Component>
<Component class="javax.swing.JLabel" name="lbUserPassword">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbUserPassword.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JPasswordField" name="jpDbPassword">
</Component>
<Component class="javax.swing.JComboBox" name="cbDatabaseType">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new javax.swing.DefaultComboBoxModel&lt;&gt;(new EamDbPlatformEnum[]{EamDbPlatformEnum.POSTGRESQL, EamDbPlatformEnum.SQLITE})" type="code"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbDatabaseTypeActionPerformed"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;EamDbPlatformEnum&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="lbSingleUserSqLite">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbSingleUserSqLite.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="lbDatabaseType">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="EamDbSettingsDialog.lbDatabaseType.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents> </SubComponents>
</Container> </Container>
</SubComponents> </SubComponents>

View File

@ -25,6 +25,10 @@
<Component id="pnDatabaseContentButtons" max="32767" attributes="0"/> <Component id="pnDatabaseContentButtons" max="32767" attributes="0"/>
<Component id="tbOops" alignment="1" max="32767" attributes="0"/> <Component id="tbOops" alignment="1" max="32767" attributes="0"/>
<Component id="pnDatabaseConfiguration" max="32767" attributes="0"/> <Component id="pnDatabaseConfiguration" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="cbUseCentralRepo" min="-2" pref="186" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
@ -33,13 +37,14 @@
<DimensionLayout dim="1"> <DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/> <Component id="cbUseCentralRepo" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="pnDatabaseConfiguration" min="-2" max="-2" attributes="0"/> <Component id="pnDatabaseConfiguration" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="tbOops" min="-2" max="-2" attributes="0"/> <Component id="tbOops" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="pnDatabaseContentButtons" min="-2" pref="50" max="-2" attributes="0"/> <Component id="pnDatabaseContentButtons" min="-2" pref="50" max="-2" attributes="0"/>
<EmptySpace min="0" pref="18" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -240,5 +245,15 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JCheckBox" name="cbUseCentralRepo">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/centralrepository/optionspanel/Bundle.properties" key="GlobalSettingsPanel.cbUseCentralRepo.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cbUseCentralRepoActionPerformed"/>
</Events>
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View File

@ -29,6 +29,8 @@ import org.sleuthkit.autopsy.events.AutopsyEvent;
import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum; import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum;
import static org.sleuthkit.autopsy.centralrepository.datamodel.EamDbPlatformEnum.DISABLED;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbUtil;
import org.sleuthkit.autopsy.centralrepository.datamodel.PostgresEamDbSettings; import org.sleuthkit.autopsy.centralrepository.datamodel.PostgresEamDbSettings;
import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings; import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings;
@ -53,7 +55,8 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
addIngestJobEventsListener(); addIngestJobEventsListener();
} }
@Messages({"GlobalSettingsPanel.title=Central Repository Settings"}) @Messages({"GlobalSettingsPanel.title=Central Repository Settings",
"GlobalSettingsPanel.cbUseCentralRepo.text=Use a Central Repository"})
private void customizeComponents() { private void customizeComponents() {
setName(Bundle.GlobalSettingsPanel_title()); setName(Bundle.GlobalSettingsPanel_title());
} }
@ -85,6 +88,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
bnManageTags = new javax.swing.JButton(); bnManageTags = new javax.swing.JButton();
bnManageTypes = new javax.swing.JButton(); bnManageTypes = new javax.swing.JButton();
tbOops = new javax.swing.JTextField(); tbOops = new javax.swing.JTextField();
cbUseCentralRepo = new javax.swing.JCheckBox();
setName(""); // NOI18N setName(""); // NOI18N
@ -198,6 +202,13 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
tbOops.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.tbOops.text")); // NOI18N tbOops.setText(org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.tbOops.text")); // NOI18N
tbOops.setBorder(null); tbOops.setBorder(null);
org.openide.awt.Mnemonics.setLocalizedText(cbUseCentralRepo, org.openide.util.NbBundle.getMessage(GlobalSettingsPanel.class, "GlobalSettingsPanel.cbUseCentralRepo.text")); // NOI18N
cbUseCentralRepo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbUseCentralRepoActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
@ -207,50 +218,65 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pnDatabaseContentButtons, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pnDatabaseContentButtons, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(tbOops, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(tbOops, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(cbUseCentralRepo, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap()) .addContainerGap())
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap() .addComponent(cbUseCentralRepo)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pnDatabaseConfiguration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(tbOops, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tbOops, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pnDatabaseContentButtons, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pnDatabaseContentButtons, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 18, Short.MAX_VALUE)) .addContainerGap())
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void bnImportDatabaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnImportDatabaseActionPerformed private void bnImportDatabaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnImportDatabaseActionPerformed
store();
ImportHashDatabaseDialog dialog = new ImportHashDatabaseDialog(); ImportHashDatabaseDialog dialog = new ImportHashDatabaseDialog();
firePropertyChange(OptionsPanelController.PROP_VALID, null, null); firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}//GEN-LAST:event_bnImportDatabaseActionPerformed }//GEN-LAST:event_bnImportDatabaseActionPerformed
private void bnManageTagsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnManageTagsActionPerformed private void bnManageTagsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnManageTagsActionPerformed
store();
ManageTagsDialog dialog = new ManageTagsDialog(); ManageTagsDialog dialog = new ManageTagsDialog();
firePropertyChange(OptionsPanelController.PROP_VALID, null, null); firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}//GEN-LAST:event_bnManageTagsActionPerformed }//GEN-LAST:event_bnManageTagsActionPerformed
private void bnManageTypesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnManageTypesActionPerformed private void bnManageTypesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnManageTypesActionPerformed
store();
ManageCorrelationPropertiesDialog dialog = new ManageCorrelationPropertiesDialog(); ManageCorrelationPropertiesDialog dialog = new ManageCorrelationPropertiesDialog();
firePropertyChange(OptionsPanelController.PROP_VALID, null, null); firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}//GEN-LAST:event_bnManageTypesActionPerformed }//GEN-LAST:event_bnManageTypesActionPerformed
private void bnDbConfigureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnDbConfigureActionPerformed private void bnDbConfigureActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnDbConfigureActionPerformed
store();
EamDbSettingsDialog dialog = new EamDbSettingsDialog(); EamDbSettingsDialog dialog = new EamDbSettingsDialog();
load(); // reload db settings content and update buttons load(); // reload db settings content and update buttons
}//GEN-LAST:event_bnDbConfigureActionPerformed }//GEN-LAST:event_bnDbConfigureActionPerformed
private void cbUseCentralRepoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbUseCentralRepoActionPerformed
//if saved setting is disabled checkbox should be disabled already
enableDatabaseConfigureButton(cbUseCentralRepo.isSelected());
enableButtonSubComponents(cbUseCentralRepo.isSelected() && !EamDbPlatformEnum.getSelectedPlatform().equals(DISABLED));
this.ingestStateUpdated();
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}//GEN-LAST:event_cbUseCentralRepoActionPerformed
@Override @Override
@Messages({"GlobalSettingsPanel.validationerrMsg.mustConfigure=Configure the database to enable this module."}) @Messages({"GlobalSettingsPanel.validationerrMsg.mustConfigure=Configure the database to enable this module."})
public void load() { public void load() {
tbOops.setText(""); tbOops.setText("");
enableAllSubComponents(false); enableAllSubComponents(false);
EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.getSelectedPlatform(); EamDbPlatformEnum selectedPlatform = EamDbPlatformEnum.getSelectedPlatform();
cbUseCentralRepo.setSelected(EamDbUtil.useCentralRepo()); // NON-NLS
switch (selectedPlatform) { switch (selectedPlatform) {
case POSTGRESQL: case POSTGRESQL:
PostgresEamDbSettings dbSettingsPg = new PostgresEamDbSettings(); PostgresEamDbSettings dbSettingsPg = new PostgresEamDbSettings();
@ -270,16 +296,16 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
lbDbPlatformValue.setText(EamDbPlatformEnum.DISABLED.toString()); lbDbPlatformValue.setText(EamDbPlatformEnum.DISABLED.toString());
lbDbNameValue.setText(""); lbDbNameValue.setText("");
lbDbLocationValue.setText(""); lbDbLocationValue.setText("");
enableDatabaseConfigureButton(true); enableDatabaseConfigureButton(cbUseCentralRepo.isSelected());
tbOops.setText(Bundle.GlobalSettingsPanel_validationerrMsg_mustConfigure()); tbOops.setText(Bundle.GlobalSettingsPanel_validationerrMsg_mustConfigure());
break; break;
} }
this.ingestStateUpdated();
} }
@Override @Override
public void store() { // Click OK or Apply on Options Panel public void store() { // Click OK or Apply on Options Panel
EamDbUtil.setUseCentralRepo(cbUseCentralRepo.isSelected());
} }
/** /**
@ -293,6 +319,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
@Override @Override
public void saveSettings() { // Click OK on Global Settings Panel public void saveSettings() { // Click OK on Global Settings Panel
store();
} }
@Override @Override
@ -334,7 +361,10 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
if (IngestManager.getInstance().isIngestRunning()) { if (IngestManager.getInstance().isIngestRunning()) {
tbOops.setText(Bundle.GlobalSettingsPanel_validationErrMsg_ingestRunning()); tbOops.setText(Bundle.GlobalSettingsPanel_validationErrMsg_ingestRunning());
enableAllSubComponents(false); cbUseCentralRepo.setEnabled(false);
} else if (!cbUseCentralRepo.isEnabled()) {
cbUseCentralRepo.setEnabled(true);
load();
} }
} }
@ -347,8 +377,8 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
* @return True * @return True
*/ */
private boolean enableAllSubComponents(Boolean enable) { private boolean enableAllSubComponents(Boolean enable) {
enableDatabaseConfigureButton(enable); enableDatabaseConfigureButton(cbUseCentralRepo.isSelected() && enable);
enableButtonSubComponents(enable); enableButtonSubComponents(cbUseCentralRepo.isSelected() && enable);
return true; return true;
} }
@ -359,9 +389,18 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
* *
* @return True * @return True
*/ */
private boolean enableDatabaseConfigureButton(Boolean enable) { private void enableDatabaseConfigureButton(Boolean enable) {
bnDbConfigure.setEnabled(enable); boolean ingestRunning = IngestManager.getInstance().isIngestRunning();
return true; pnDatabaseConfiguration.setEnabled(enable && !ingestRunning);
pnDatabaseContentButtons.setEnabled(enable && !ingestRunning);
bnDbConfigure.setEnabled(enable && !ingestRunning);
lbDbLocationLabel.setEnabled(enable && !ingestRunning);
lbDbLocationValue.setEnabled(enable && !ingestRunning);
lbDbNameLabel.setEnabled(enable && !ingestRunning);
lbDbNameValue.setEnabled(enable && !ingestRunning);
lbDbPlatformTypeLabel.setEnabled(enable && !ingestRunning);
lbDbPlatformValue.setEnabled(enable && !ingestRunning);
tbOops.setEnabled(enable && !ingestRunning);
} }
/** /**
@ -373,9 +412,10 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
* @return True * @return True
*/ */
private boolean enableButtonSubComponents(Boolean enable) { private boolean enableButtonSubComponents(Boolean enable) {
bnManageTypes.setEnabled(enable); boolean ingestRunning = IngestManager.getInstance().isIngestRunning();
bnImportDatabase.setEnabled(enable); bnManageTypes.setEnabled(enable && !ingestRunning);
bnManageTags.setEnabled(enable); bnImportDatabase.setEnabled(enable && !ingestRunning);
bnManageTags.setEnabled(enable && !ingestRunning);
return true; return true;
} }
@ -384,6 +424,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
private javax.swing.JButton bnImportDatabase; private javax.swing.JButton bnImportDatabase;
private javax.swing.JButton bnManageTags; private javax.swing.JButton bnManageTags;
private javax.swing.JButton bnManageTypes; private javax.swing.JButton bnManageTypes;
private javax.swing.JCheckBox cbUseCentralRepo;
private javax.swing.JLabel lbDbLocationLabel; private javax.swing.JLabel lbDbLocationLabel;
private javax.swing.JLabel lbDbLocationValue; private javax.swing.JLabel lbDbLocationValue;
private javax.swing.JLabel lbDbNameLabel; private javax.swing.JLabel lbDbNameLabel;

View File

@ -72,6 +72,7 @@ final class ImportHashDatabaseDialog extends javax.swing.JDialog {
private final JFileChooser fileChooser = new JFileChooser(); private final JFileChooser fileChooser = new JFileChooser();
private final static String LAST_FILE_PATH_KEY = "CentralRepositoryImport_Path"; // NON-NLS private final static String LAST_FILE_PATH_KEY = "CentralRepositoryImport_Path"; // NON-NLS
private final int HASH_IMPORT_THRESHOLD = 10000;
private EamOrganization selectedOrg = null; private EamOrganization selectedOrg = null;
private List<EamOrganization> orgs = null; private List<EamOrganization> orgs = null;
private final Collection<JTextField> textBoxes; private final Collection<JTextField> textBoxes;
@ -533,7 +534,8 @@ final class ImportHashDatabaseDialog extends javax.swing.JDialog {
String errorMessage = Bundle.ImportHashDatabaseDialog_errorMessage_failedToOpenHashDbMsg(selectedFilePath); String errorMessage = Bundle.ImportHashDatabaseDialog_errorMessage_failedToOpenHashDbMsg(selectedFilePath);
// Future, make UI handle more than the "FILES" type. // Future, make UI handle more than the "FILES" type.
try { try {
EamArtifact.Type contentType = EamArtifact.getDefaultCorrelationTypes().get(0); // get "FILES" type EamDb dbManager = EamDb.getInstance();
EamArtifact.Type contentType = dbManager.getCorrelationTypeById(EamArtifact.FILES_TYPE_ID); // get "FILES" type
// run in the background and close dialog // run in the background and close dialog
SwingUtilities.invokeLater(new ImportHashDatabaseWorker(selectedFilePath, knownStatus, globalSetID, contentType)::execute); SwingUtilities.invokeLater(new ImportHashDatabaseWorker(selectedFilePath, knownStatus, globalSetID, contentType)::execute);
dispose(); dispose();
@ -647,10 +649,10 @@ final class ImportHashDatabaseDialog extends javax.swing.JDialog {
""); "");
globalInstances.add(eamGlobalFileInstance); globalInstances.add(eamGlobalFileInstance);
if(numLines % 10000 == 0){ if(numLines % HASH_IMPORT_THRESHOLD == 0){
dbManager.bulkInsertReferenceTypeEntries(globalInstances, contentType); dbManager.bulkInsertReferenceTypeEntries(globalInstances, contentType);
globalInstances.clear(); globalInstances.clear();
} }
} }

View File

@ -1,5 +1,5 @@
#Updated by build script #Updated by build script
#Thu, 22 Jun 2017 08:50:21 -0400 #Tue, 29 Aug 2017 09:47:52 -0400
LBL_splash_window_title=Starting Autopsy LBL_splash_window_title=Starting Autopsy
SPLASH_HEIGHT=314 SPLASH_HEIGHT=314
SPLASH_WIDTH=538 SPLASH_WIDTH=538

View File

@ -1,4 +1,4 @@
#Updated by build script #Updated by build script
#Thu, 22 Jun 2017 08:50:21 -0400 #Tue, 29 Aug 2017 09:47:52 -0400
CTL_MainWindow_Title=Autopsy 4.4.1 CTL_MainWindow_Title=Autopsy 4.4.1
CTL_MainWindow_Title_No_Project=Autopsy 4.4.1 CTL_MainWindow_Title_No_Project=Autopsy 4.4.1