mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Addresses most of the review comments
This commit is contained in:
parent
61b7f89788
commit
c062a20213
@ -1276,7 +1276,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
|
||||
preparedStatement.setInt(1, referenceSetID);
|
||||
preparedStatement.executeUpdate();
|
||||
} catch (SQLException ex) {
|
||||
throw new EamDbException("Error deleting reference set", ex); // NON-NLS
|
||||
throw new EamDbException("Error deleting reference set " + referenceSetID, ex); // NON-NLS
|
||||
} finally {
|
||||
EamDbUtil.closePreparedStatement(preparedStatement);
|
||||
EamDbUtil.closeConnection(conn);
|
||||
@ -1285,7 +1285,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
|
||||
|
||||
/**
|
||||
* Remove all entries for this reference set from the reference tables
|
||||
* (Currently only removes entries from the files table)
|
||||
* (Currently only removes entries from the reference_file table)
|
||||
* @param referenceSetID
|
||||
* @throws EamDbException
|
||||
*/
|
||||
@ -1303,7 +1303,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
|
||||
preparedStatement.setInt(1, referenceSetID);
|
||||
preparedStatement.executeUpdate();
|
||||
} catch (SQLException ex) {
|
||||
throw new EamDbException("Error deleting files from reference set", ex); // NON-NLS
|
||||
throw new EamDbException("Error deleting files from reference set " + referenceSetID, ex); // NON-NLS
|
||||
} finally {
|
||||
EamDbUtil.closePreparedStatement(preparedStatement);
|
||||
EamDbUtil.closeConnection(conn);
|
||||
@ -1369,7 +1369,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
|
||||
resultSet.next();
|
||||
matchingInstances = resultSet.getLong(1);
|
||||
} catch (SQLException ex) {
|
||||
throw new EamDbException("Error determining if file is in reference set.", ex); // NON-NLS
|
||||
throw new EamDbException("Error determining if value (" + value + ") is in reference set " + referenceSetID, ex); // NON-NLS
|
||||
} finally {
|
||||
EamDbUtil.closePreparedStatement(preparedStatement);
|
||||
EamDbUtil.closeResultSet(resultSet);
|
||||
@ -1388,7 +1388,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
|
||||
* @return Global known status of the artifact
|
||||
*/
|
||||
@Override
|
||||
public boolean isArtifactlKnownBadByReference(CorrelationAttribute.Type aType, String value) throws EamDbException {
|
||||
public boolean isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value) throws EamDbException {
|
||||
|
||||
// TEMP: Only support file correlation type
|
||||
if (aType.getId() != CorrelationAttribute.FILES_TYPE_ID) {
|
||||
@ -1538,30 +1538,6 @@ public abstract class AbstractSqlEamDb implements EamDb {
|
||||
return (getOrganizationByID(globalSet.getOrgID()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new reference set
|
||||
*
|
||||
* @param orgID
|
||||
* @param setName
|
||||
* @param version
|
||||
* @param importDate
|
||||
* @return the reference set ID of the newly created set
|
||||
* @throws EamDbException
|
||||
*/
|
||||
@Override
|
||||
public int newReferenceSet(int orgID, String setName, String version, TskData.FileKnown knownStatus,
|
||||
boolean isReadOnly) throws EamDbException {
|
||||
EamDb dbManager = EamDb.getInstance();
|
||||
EamGlobalSet eamGlobalSet = new EamGlobalSet(
|
||||
orgID,
|
||||
setName,
|
||||
version,
|
||||
knownStatus,
|
||||
isReadOnly,
|
||||
LocalDate.now());
|
||||
return dbManager.newReferencelSet(eamGlobalSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing organization.
|
||||
*
|
||||
@ -1634,7 +1610,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
|
||||
* @throws EamDbException
|
||||
*/
|
||||
@Override
|
||||
public int newReferencelSet(EamGlobalSet eamGlobalSet) throws EamDbException {
|
||||
public int newReferenceSet(EamGlobalSet eamGlobalSet) throws EamDbException {
|
||||
Connection conn = connect();
|
||||
|
||||
PreparedStatement preparedStatement1 = null;
|
||||
@ -1796,7 +1772,8 @@ public abstract class AbstractSqlEamDb implements EamDb {
|
||||
return (resultSet.next());
|
||||
|
||||
} catch (SQLException ex) {
|
||||
throw new EamDbException("Error getting reference instances by type and value.", ex); // NON-NLS
|
||||
throw new EamDbException("Error testing whether reference set exists (name: " + referenceSetName
|
||||
+ " version: " + version, ex); // NON-NLS
|
||||
} finally {
|
||||
EamDbUtil.closePreparedStatement(preparedStatement1);
|
||||
EamDbUtil.closeResultSet(resultSet);
|
||||
|
@ -354,7 +354,7 @@ public interface EamDb {
|
||||
List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttribute.Type aType, String value) throws EamDbException;
|
||||
|
||||
/**
|
||||
* Remove a reference set and all hashes contained in it.
|
||||
* Remove a reference set and all values contained in it.
|
||||
* @param referenceSetID
|
||||
* @throws EamDbException
|
||||
*/
|
||||
@ -408,7 +408,7 @@ public interface EamDb {
|
||||
*
|
||||
* @return Global known status of the artifact
|
||||
*/
|
||||
boolean isArtifactlKnownBadByReference(CorrelationAttribute.Type aType, String value) throws EamDbException;
|
||||
boolean isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value) throws EamDbException;
|
||||
|
||||
/**
|
||||
* Add a new organization
|
||||
@ -477,20 +477,7 @@ public interface EamDb {
|
||||
*
|
||||
* @throws EamDbException
|
||||
*/
|
||||
int newReferencelSet(EamGlobalSet eamGlobalSet) throws EamDbException;
|
||||
|
||||
/**
|
||||
* Add a new reference set
|
||||
*
|
||||
* @param orgID
|
||||
* @param setName
|
||||
* @param version
|
||||
* @param importDate
|
||||
* @return the reference set ID of the newly created set
|
||||
* @throws EamDbException
|
||||
*/
|
||||
int newReferenceSet(int orgID, String setName, String version, TskData.FileKnown knownStatus,
|
||||
boolean isReadOnly) throws EamDbException;
|
||||
int newReferenceSet(EamGlobalSet eamGlobalSet) throws EamDbException;
|
||||
|
||||
/**
|
||||
* Get a global set by ID
|
||||
|
@ -19,7 +19,6 @@
|
||||
package org.sleuthkit.autopsy.centralrepository.datamodel;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
|
||||
/**
|
||||
@ -62,6 +61,26 @@ public class EamGlobalSet {
|
||||
this(-1, orgID, setName, version, knownStatus, isReadOnly, importDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new EamGlobalSet object.
|
||||
* This is intended to be used when creating a new global set as the
|
||||
* globalSetID will be unknown to start.
|
||||
* importDate will be automatically set to the current time.
|
||||
* @param orgID
|
||||
* @param setName
|
||||
* @param version
|
||||
* @param knownStatus
|
||||
* @param isReadOnly
|
||||
*/
|
||||
public EamGlobalSet(
|
||||
int orgID,
|
||||
String setName,
|
||||
String version,
|
||||
TskData.FileKnown knownStatus,
|
||||
boolean isReadOnly) {
|
||||
this(-1, orgID, setName, version, knownStatus, isReadOnly, LocalDate.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the globalSetID
|
||||
*/
|
||||
@ -146,17 +165,6 @@ public class EamGlobalSet {
|
||||
this.fileKnownStatus = fileKnownStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the FileKnown status as a KnownFilesType
|
||||
* @return KNOWN or KNOWN_BAD
|
||||
*/
|
||||
public HashDbManager.HashDb.KnownFilesType getKnownStatus(){
|
||||
if(fileKnownStatus.equals(TskData.FileKnown.BAD)){
|
||||
return HashDbManager.HashDb.KnownFilesType.KNOWN_BAD;
|
||||
}
|
||||
return HashDbManager.HashDb.KnownFilesType.KNOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the importDate
|
||||
*/
|
||||
|
@ -636,7 +636,7 @@ public class SqliteEamDb extends AbstractSqlEamDb {
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a reference set and all hashes contained in it.
|
||||
* Remove a reference set and all values contained in it.
|
||||
* @param referenceSetID
|
||||
* @throws EamDbException
|
||||
*/
|
||||
@ -693,10 +693,10 @@ public class SqliteEamDb extends AbstractSqlEamDb {
|
||||
* @return Global known status of the artifact
|
||||
*/
|
||||
@Override
|
||||
public boolean isArtifactlKnownBadByReference(CorrelationAttribute.Type aType, String value) throws EamDbException {
|
||||
public boolean isArtifactKnownBadByReference(CorrelationAttribute.Type aType, String value) throws EamDbException {
|
||||
try{
|
||||
acquireSharedLock();
|
||||
return super.isArtifactlKnownBadByReference(aType, value);
|
||||
return super.isArtifactKnownBadByReference(aType, value);
|
||||
} finally {
|
||||
releaseSharedLock();
|
||||
}
|
||||
@ -786,10 +786,10 @@ public class SqliteEamDb extends AbstractSqlEamDb {
|
||||
* @throws EamDbException
|
||||
*/
|
||||
@Override
|
||||
public int newReferencelSet(EamGlobalSet eamGlobalSet) throws EamDbException {
|
||||
public int newReferenceSet(EamGlobalSet eamGlobalSet) throws EamDbException {
|
||||
try{
|
||||
acquireExclusiveLock();
|
||||
return super.newReferencelSet(eamGlobalSet);
|
||||
return super.newReferenceSet(eamGlobalSet);
|
||||
} finally {
|
||||
releaseExclusiveLock();
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ import org.sleuthkit.datamodel.HashEntry;
|
||||
import org.sleuthkit.datamodel.HashHitInfo;
|
||||
import org.sleuthkit.datamodel.SleuthkitJNI;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
|
||||
/**
|
||||
* This class implements a singleton that manages the set of hash databases used
|
||||
@ -233,7 +234,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
return hashDb;
|
||||
}
|
||||
|
||||
private SleuthkitHashSet addHashDatabase(int handle, String hashSetName, boolean searchDuringIngest, boolean sendIngestMessages, SleuthkitHashSet.KnownFilesType knownFilesType) throws TskCoreException {
|
||||
private SleuthkitHashSet addHashDatabase(int handle, String hashSetName, boolean searchDuringIngest, boolean sendIngestMessages, HashDb.KnownFilesType knownFilesType) throws TskCoreException {
|
||||
// Wrap an object around the handle.
|
||||
SleuthkitHashSet hashDb = new SleuthkitHashSet(handle, hashSetName, searchDuringIngest, sendIngestMessages, knownFilesType);
|
||||
|
||||
@ -426,7 +427,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
*/
|
||||
public synchronized List<HashDb> getKnownFileHashSets() {
|
||||
List<HashDb> hashDbs = new ArrayList<>();
|
||||
this.hashSets.stream().filter((db) -> (db.getKnownFilesType() == SleuthkitHashSet.KnownFilesType.KNOWN)).forEach((db) -> {
|
||||
this.hashSets.stream().filter((db) -> (db.getKnownFilesType() == HashDb.KnownFilesType.KNOWN)).forEach((db) -> {
|
||||
hashDbs.add(db);
|
||||
});
|
||||
return hashDbs;
|
||||
@ -439,7 +440,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
*/
|
||||
public synchronized List<HashDb> getKnownBadFileHashSets() {
|
||||
List<HashDb> hashDbs = new ArrayList<>();
|
||||
this.hashSets.stream().filter((db) -> (db.getKnownFilesType() == SleuthkitHashSet.KnownFilesType.KNOWN_BAD)).forEach((db) -> {
|
||||
this.hashSets.stream().filter((db) -> (db.getKnownFilesType() == HashDb.KnownFilesType.KNOWN_BAD)).forEach((db) -> {
|
||||
hashDbs.add(db);
|
||||
});
|
||||
return hashDbs;
|
||||
@ -478,9 +479,9 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
// Defaults for fields not stored in the central repository:
|
||||
// searchDuringIngest: false
|
||||
// sendIngestMessages: true if the hash set is notable
|
||||
boolean sendIngestMessages = globalSet.getKnownStatus().equals(SleuthkitHashSet.KnownFilesType.KNOWN_BAD);
|
||||
boolean sendIngestMessages = convertFileKnown(globalSet.getFileKnownStatus()).equals(HashDb.KnownFilesType.KNOWN_BAD);
|
||||
crHashSets.add(new HashDbInfo(globalSet.getSetName(), globalSet.getVersion(),
|
||||
globalSet.getGlobalSetID(), globalSet.getKnownStatus(), globalSet.isReadOnly(), false, sendIngestMessages));
|
||||
globalSet.getGlobalSetID(), convertFileKnown(globalSet.getFileKnownStatus()), globalSet.isReadOnly(), false, sendIngestMessages));
|
||||
}
|
||||
} catch (EamDbException ex){
|
||||
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error loading central repository hash sets", ex); //NON-NLS
|
||||
@ -489,6 +490,13 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
return crHashSets;
|
||||
}
|
||||
|
||||
private static HashDb.KnownFilesType convertFileKnown(TskData.FileKnown fileKnown){
|
||||
if(fileKnown.equals(TskData.FileKnown.BAD)){
|
||||
return HashDb.KnownFilesType.KNOWN_BAD;
|
||||
}
|
||||
return HashDb.KnownFilesType.KNOWN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores the last saved hash sets configuration. This supports
|
||||
* cancellation of configuration panels.
|
||||
@ -700,7 +708,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
|
||||
public abstract String getDatabasePath() throws TskCoreException;
|
||||
|
||||
public abstract SleuthkitHashSet.KnownFilesType getKnownFilesType();
|
||||
public abstract HashDb.KnownFilesType getKnownFilesType();
|
||||
|
||||
public abstract boolean getSearchDuringIngest();
|
||||
|
||||
@ -773,7 +781,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
private final String hashSetName;
|
||||
private boolean searchDuringIngest;
|
||||
private boolean sendIngestMessages;
|
||||
private final SleuthkitHashSet.KnownFilesType knownFilesType;
|
||||
private final HashDb.KnownFilesType knownFilesType;
|
||||
private boolean indexing;
|
||||
private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
|
||||
|
||||
@ -1052,7 +1060,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
private final String hashSetName;
|
||||
private boolean searchDuringIngest;
|
||||
private boolean sendIngestMessages;
|
||||
private final SleuthkitHashSet.KnownFilesType knownFilesType;
|
||||
private final HashDb.KnownFilesType knownFilesType;
|
||||
private final int referenceSetID;
|
||||
private final String version;
|
||||
private String orgName;
|
||||
@ -1061,7 +1069,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
|
||||
@Messages({"HashDbManager.CentralRepoHashDb.orgError=Error loading organization"})
|
||||
private CentralRepoHashSet(String hashSetName, String version, int referenceSetID,
|
||||
boolean useForIngest, boolean sendHitMessages, SleuthkitHashSet.KnownFilesType knownFilesType,
|
||||
boolean useForIngest, boolean sendHitMessages, HashDb.KnownFilesType knownFilesType,
|
||||
boolean readOnly)
|
||||
throws TskCoreException{
|
||||
this.hashSetName = hashSetName;
|
||||
@ -1075,7 +1083,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
try{
|
||||
orgName = EamDb.getInstance().getReferenceSetOrganization(referenceSetID).getName();
|
||||
} catch (EamDbException ex){
|
||||
Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error looking up central repository organization", ex); //NON-NLS
|
||||
Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error looking up central repository organization for reference set " + referenceSetID, ex); //NON-NLS
|
||||
orgName = Bundle.HashDbManager_CentralRepoHashDb_orgError();
|
||||
}
|
||||
}
|
||||
@ -1139,7 +1147,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SleuthkitHashSet.KnownFilesType getKnownFilesType() {
|
||||
public HashDb.KnownFilesType getKnownFilesType() {
|
||||
return knownFilesType;
|
||||
}
|
||||
|
||||
@ -1242,7 +1250,8 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
try{
|
||||
return EamDb.getInstance().isFileHashInReferenceSet(file.getMd5Hash(), this.referenceSetID);
|
||||
} catch (EamDbException ex){
|
||||
Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error performing central reposiotry hash lookup", ex); //NON-NLS
|
||||
Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error performing central reposiotry hash lookup for hash "
|
||||
+ file.getMd5Hash() + " in reference set " + referenceSetID, ex); //NON-NLS
|
||||
throw new TskCoreException("Error performing central reposiotry hash lookup", ex);
|
||||
}
|
||||
}
|
||||
@ -1273,7 +1282,8 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
result = new HashHitInfo(file.getMd5Hash(), "", "");
|
||||
}
|
||||
} catch (EamDbException ex){
|
||||
Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error performing central reposiotry hash lookup", ex); //NON-NLS
|
||||
Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error performing central reposiotry hash lookup for hash "
|
||||
+ file.getMd5Hash() + " in reference set " + referenceSetID, ex); //NON-NLS
|
||||
throw new TskCoreException("Error performing central reposiotry hash lookup", ex);
|
||||
}
|
||||
}
|
||||
@ -1364,7 +1374,7 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
try {
|
||||
SleuthkitJNI.createLookupIndexForHashDatabase(hashDb.getHandle());
|
||||
} catch (TskCoreException ex) {
|
||||
Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error indexing hash database", ex); //NON-NLS
|
||||
Logger.getLogger(HashDbIndexer.class.getName()).log(Level.SEVERE, "Error indexing hash set " + hashDb.getHashSetName(), ex); //NON-NLS
|
||||
JOptionPane.showMessageDialog(null,
|
||||
NbBundle.getMessage(this.getClass(),
|
||||
"HashDbManager.dlgMsg.errorIndexingHashSet",
|
||||
|
@ -202,7 +202,7 @@ final class HashLookupSettings implements Serializable {
|
||||
|
||||
// Handle legacy known files types.
|
||||
if (knownFilesType.equals("NSRL")) { //NON-NLS
|
||||
knownFilesType = HashDbManager.SleuthkitHashSet.KnownFilesType.KNOWN.toString();
|
||||
knownFilesType = HashDbManager.HashDb.KnownFilesType.KNOWN.toString();
|
||||
updatedSchema = true;
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ final class HashLookupSettings implements Serializable {
|
||||
} else {
|
||||
throw new HashLookupSettingsException(String.format(elementErrorMessage, PATH_ELEMENT));
|
||||
}
|
||||
hashDbInfoList.add(new HashDbInfo(hashSetName, HashDbManager.SleuthkitHashSet.KnownFilesType.valueOf(knownFilesType),
|
||||
hashDbInfoList.add(new HashDbInfo(hashSetName, HashDbManager.HashDb.KnownFilesType.valueOf(knownFilesType),
|
||||
searchDuringIngestFlag, sendIngestMessagesFlag, dbPath));
|
||||
hashSetNames.add(hashSetName);
|
||||
}
|
||||
@ -304,7 +304,7 @@ final class HashLookupSettings implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final String hashSetName;
|
||||
private final HashDbManager.SleuthkitHashSet.KnownFilesType knownFilesType;
|
||||
private final HashDbManager.HashDb.KnownFilesType knownFilesType;
|
||||
private boolean searchDuringIngest;
|
||||
private final boolean sendIngestMessages;
|
||||
private final String path;
|
||||
@ -323,7 +323,7 @@ final class HashLookupSettings implements Serializable {
|
||||
* @param sendIngestMessages Whether or not ingest messages are sent
|
||||
* @param path The path to the db
|
||||
*/
|
||||
HashDbInfo(String hashSetName, HashDbManager.SleuthkitHashSet.KnownFilesType knownFilesType, boolean searchDuringIngest, boolean sendIngestMessages, String path) {
|
||||
HashDbInfo(String hashSetName, HashDbManager.HashDb.KnownFilesType knownFilesType, boolean searchDuringIngest, boolean sendIngestMessages, String path) {
|
||||
this.hashSetName = hashSetName;
|
||||
this.knownFilesType = knownFilesType;
|
||||
this.searchDuringIngest = searchDuringIngest;
|
||||
@ -335,7 +335,7 @@ final class HashLookupSettings implements Serializable {
|
||||
this.dbType = DatabaseType.FILE;
|
||||
}
|
||||
|
||||
HashDbInfo(String hashSetName, String version, int referenceSetID, HashDbManager.SleuthkitHashSet.KnownFilesType knownFilesType, boolean readOnly, boolean searchDuringIngest, boolean sendIngestMessages){
|
||||
HashDbInfo(String hashSetName, String version, int referenceSetID, HashDbManager.HashDb.KnownFilesType knownFilesType, boolean readOnly, boolean searchDuringIngest, boolean sendIngestMessages){
|
||||
this.hashSetName = hashSetName;
|
||||
this.version = version;
|
||||
this.referenceSetID = referenceSetID;
|
||||
@ -407,7 +407,7 @@ final class HashLookupSettings implements Serializable {
|
||||
*
|
||||
* @return The known files type setting.
|
||||
*/
|
||||
HashDbManager.SleuthkitHashSet.KnownFilesType getKnownFilesType() {
|
||||
HashDbManager.HashDb.KnownFilesType getKnownFilesType() {
|
||||
return knownFilesType;
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttribute;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamGlobalFileInstance;
|
||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamGlobalSet;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
@ -77,7 +78,7 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
||||
}
|
||||
|
||||
void importFile(String hashSetName, String version, int orgId,
|
||||
boolean searchDuringIngest, boolean sendIngestMessages, HashDbManager.SleuthkitHashSet.KnownFilesType knownFilesType,
|
||||
boolean searchDuringIngest, boolean sendIngestMessages, HashDbManager.HashDb.KnownFilesType knownFilesType,
|
||||
boolean readOnly, String importFileName){
|
||||
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
|
||||
@ -139,7 +140,7 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
||||
private final int orgId;
|
||||
private final boolean searchDuringIngest;
|
||||
private final boolean sendIngestMessages;
|
||||
private final HashDbManager.SleuthkitHashSet.KnownFilesType knownFilesType;
|
||||
private final HashDbManager.HashDb.KnownFilesType knownFilesType;
|
||||
private final boolean readOnly;
|
||||
private final File importFile;
|
||||
private final long totalLines;
|
||||
@ -148,7 +149,7 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
||||
private final AtomicLong numLines = new AtomicLong();
|
||||
|
||||
ImportIDXWorker(String hashSetName, String version, int orgId,
|
||||
boolean searchDuringIngest, boolean sendIngestMessages, HashDbManager.SleuthkitHashSet.KnownFilesType knownFilesType,
|
||||
boolean searchDuringIngest, boolean sendIngestMessages, HashDbManager.HashDb.KnownFilesType knownFilesType,
|
||||
boolean readOnly, File importFile){
|
||||
|
||||
this.hashSetName = hashSetName;
|
||||
@ -194,14 +195,14 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
||||
protected Void doInBackground() throws Exception {
|
||||
|
||||
TskData.FileKnown knownStatus;
|
||||
if (knownFilesType.equals(HashDbManager.SleuthkitHashSet.KnownFilesType.KNOWN)) {
|
||||
if (knownFilesType.equals(HashDbManager.HashDb.KnownFilesType.KNOWN)) {
|
||||
knownStatus = TskData.FileKnown.KNOWN;
|
||||
} else {
|
||||
knownStatus = TskData.FileKnown.BAD;
|
||||
}
|
||||
|
||||
// Create an empty hashset in the central repository
|
||||
referenceSetID = EamDb.getInstance().newReferenceSet(orgId, hashSetName, version, knownStatus, readOnly);
|
||||
referenceSetID = EamDb.getInstance().newReferenceSet(new EamGlobalSet(orgId, hashSetName, version, knownStatus, readOnly));
|
||||
|
||||
EamDb dbManager = EamDb.getInstance();
|
||||
CorrelationAttribute.Type contentType = dbManager.getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID); // get "FILES" type
|
||||
|
Loading…
x
Reference in New Issue
Block a user