diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java index fa03d01321..eb73f9ef66 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/AbstractSqlEamDb.java @@ -34,7 +34,6 @@ import java.time.LocalDate; import java.util.HashMap; import java.util.Map; import java.util.Set; -import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger; @@ -1312,7 +1311,8 @@ public abstract class AbstractSqlEamDb implements EamDb { } /** - * Check whether the given reference set exists in the central repository. + * Check whether a reference set with the given parameters exists in the central repository. + * Used to check whether reference sets saved in the settings are still present. * @param referenceSetID * @param setName * @param version @@ -1773,14 +1773,15 @@ public abstract class AbstractSqlEamDb implements EamDb { } /** - * Check whether a reference set with the given name/version is in the central repo - * @param hashSetName + * Check whether a reference set with the given name/version is in the central repo. + * Used to check for name collisions when creating reference sets. + * @param referenceSetName * @param version * @return true if a matching set is found * @throws EamDbException */ @Override - public boolean referenceSetExists(String hashSetName, String version) throws EamDbException{ + public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException{ Connection conn = connect(); PreparedStatement preparedStatement1 = null; @@ -1789,7 +1790,7 @@ public abstract class AbstractSqlEamDb implements EamDb { try { preparedStatement1 = conn.prepareStatement(sql1); - preparedStatement1.setString(1, hashSetName); + preparedStatement1.setString(1, referenceSetName); preparedStatement1.setString(2, version); resultSet = preparedStatement1.executeQuery(); return (resultSet.next()); diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamDb.java index 1f1bd8a942..2ab708e5de 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/EamDb.java @@ -361,23 +361,25 @@ public interface EamDb { public void deleteReferenceSet(int referenceSetID) throws EamDbException; /** - * Check whether the given reference set exists in the central repository. + * Check whether a reference set with the given parameters exists in the central repository. + * Used to check whether reference sets saved in the settings are still present. * @param referenceSetID - * @param hashSetName + * @param referenceSetName * @param version * @return true if a matching entry exists in the central repository * @throws EamDbException */ - public boolean referenceSetIsValid(int referenceSetID, String hashSetName, String version) throws EamDbException; + public boolean referenceSetIsValid(int referenceSetID, String referenceSetName, String version) throws EamDbException; /** - * Check whether a reference set with the given name/version is in the central repo - * @param hashSetName + * Check whether a reference set with the given name/version is in the central repo. + * Used to check for name collisions when creating reference sets. + * @param referenceSetName * @param version * @return true if a matching set is found * @throws EamDbException */ - public boolean referenceSetExists(String hashSetName, String version) throws EamDbException; + public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException; /** * Check if the given file hash is in this reference set. diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/SqliteEamDb.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/SqliteEamDb.java index 4ee57db0b2..efbda95156 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/SqliteEamDb.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/SqliteEamDb.java @@ -667,17 +667,18 @@ public class SqliteEamDb extends AbstractSqlEamDb { } /** - * Check whether a reference set with the given name/version is in the central repo - * @param hashSetName + * Check whether a reference set with the given name/version is in the central repo. + * Used to check for name collisions when creating reference sets. + * @param referenceSetName * @param version * @return true if a matching set is found * @throws EamDbException */ @Override - public boolean referenceSetExists(String hashSetName, String version) throws EamDbException { + public boolean referenceSetExists(String referenceSetName, String version) throws EamDbException { try{ acquireSharedLock(); - return super.referenceSetExists(hashSetName, version); + return super.referenceSetExists(referenceSetName, version); } finally { releaseSharedLock(); }