Merge pull request #2884 from narfindustries/global_bad_files

Eam - properly use and display global files (hash db imported files)
This commit is contained in:
Richard Cordovano 2017-06-22 14:07:26 -04:00 committed by GitHub
commit 9f23fb104f
3 changed files with 11 additions and 5 deletions

View File

@ -483,7 +483,7 @@ public class DataContentViewerOtherCases extends javax.swing.JPanel implements D
Collection<EamArtifactInstance> eamArtifactInstances = new ArrayList<>(); Collection<EamArtifactInstance> eamArtifactInstances = new ArrayList<>();
try { try {
EamDb dbManager = EamDb.getInstance(); EamDb dbManager = EamDb.getInstance();
if (dbManager.getCorrelationArtifactTypeByName("FILES") == eamArtifact.getArtifactType()) { if (dbManager.getCorrelationArtifactTypeByName("FILES").equals(eamArtifact.getArtifactType())) {
try { try {
Collection<EamGlobalFileInstance> eamGlobalFileInstances = dbManager.getGlobalFileInstancesByHash(eamArtifact.getArtifactValue()); Collection<EamGlobalFileInstance> eamGlobalFileInstances = dbManager.getGlobalFileInstancesByHash(eamArtifact.getArtifactValue());
for (EamGlobalFileInstance eamGlobalFileInstance : eamGlobalFileInstances) { for (EamGlobalFileInstance eamGlobalFileInstance : eamGlobalFileInstances) {

View File

@ -133,13 +133,19 @@ public class DataContentViewerOtherCasesTableModel extends AbstractTableModel {
switch (colId) { switch (colId) {
case CASE_NAME: case CASE_NAME:
if (null != eamArtifactInstance.getEamCase()) {
value = eamArtifactInstance.getEamCase().getDisplayName(); value = eamArtifactInstance.getEamCase().getDisplayName();
}
break; break;
case DEVICE: case DEVICE:
if (null != eamArtifactInstance.getEamDataSource()) {
value = eamArtifactInstance.getEamDataSource().getDeviceID(); value = eamArtifactInstance.getEamDataSource().getDeviceID();
}
break; break;
case DATA_SOURCE: case DATA_SOURCE:
if (null != eamArtifactInstance.getEamDataSource()) {
value = eamArtifactInstance.getEamDataSource().getName(); value = eamArtifactInstance.getEamDataSource().getName();
}
break; break;
case FILE_PATH: case FILE_PATH:
value = eamArtifactInstance.getFilePath(); value = eamArtifactInstance.getFilePath();

View File

@ -1204,7 +1204,7 @@ public abstract class AbstractSqlEamDb implements EamDb {
public boolean isArtifactGlobalKnownBad(EamArtifact eamArtifact) throws EamDbException { public boolean isArtifactGlobalKnownBad(EamArtifact eamArtifact) throws EamDbException {
// TEMP: Only support file types // TEMP: Only support file types
if (eamArtifact.getArtifactType() != getCorrelationArtifactTypeByName("FILES")) { if (!eamArtifact.getArtifactType().equals(getCorrelationArtifactTypeByName("FILES"))) {
return false; return false;
} }