mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
Only show full path for certain artifact nodes.
This commit is contained in:
parent
4e9e354a45
commit
eb82122a09
@ -19,6 +19,7 @@
|
|||||||
package org.sleuthkit.autopsy.datamodel;
|
package org.sleuthkit.autopsy.datamodel;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -45,6 +46,15 @@ public class BlackboardArtifactNode extends DisplayableItemNode {
|
|||||||
private Content associated;
|
private Content associated;
|
||||||
private List<NodeProperty> customProperties;
|
private List<NodeProperty> customProperties;
|
||||||
static final Logger logger = Logger.getLogger(BlackboardArtifactNode.class.getName());
|
static final Logger logger = Logger.getLogger(BlackboardArtifactNode.class.getName());
|
||||||
|
/**
|
||||||
|
* Artifact types which should have the associated content's full unique path
|
||||||
|
* as a property.
|
||||||
|
*/
|
||||||
|
private static final Integer[] SHOW_UNIQUE_PATH = new Integer[] {
|
||||||
|
BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID(),
|
||||||
|
BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID(),
|
||||||
|
BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_FILE.getTypeID(),
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct blackboard artifact node from an artifact and using provided
|
* Construct blackboard artifact node from an artifact and using provided
|
||||||
@ -100,18 +110,6 @@ public class BlackboardArtifactNode extends DisplayableItemNode {
|
|||||||
NO_DESCR,
|
NO_DESCR,
|
||||||
associated.getName()));
|
associated.getName()));
|
||||||
|
|
||||||
String sourcePath = "";
|
|
||||||
try {
|
|
||||||
sourcePath = associated.getUniquePath();
|
|
||||||
} catch (TskCoreException ex) {
|
|
||||||
logger.log(Level.WARNING, "Failed to get unique path from: " + associated.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sourcePath.isEmpty() == false) {
|
|
||||||
ss.put(new NodeProperty("File Path", "File Path",
|
|
||||||
NO_DESCR, sourcePath));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||||
ss.put(new NodeProperty(entry.getKey(),
|
ss.put(new NodeProperty(entry.getKey(),
|
||||||
entry.getKey(),
|
entry.getKey(),
|
||||||
@ -125,6 +123,33 @@ public class BlackboardArtifactNode extends DisplayableItemNode {
|
|||||||
ss.put(np);
|
ss.put(np);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
final int artifactTypeId = artifact.getArtifactTypeID();
|
||||||
|
|
||||||
|
if (Arrays.asList(SHOW_UNIQUE_PATH).contains(artifactTypeId)) {
|
||||||
|
String sourcePath = "";
|
||||||
|
try {
|
||||||
|
sourcePath = associated.getUniquePath();
|
||||||
|
} catch (TskCoreException ex) {
|
||||||
|
logger.log(Level.WARNING, "Failed to get unique path from: " + associated.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sourcePath.isEmpty() == false) {
|
||||||
|
ss.put(new NodeProperty("File Path", "File Path",
|
||||||
|
NO_DESCR, sourcePath));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String dataSource = "";
|
||||||
|
try {
|
||||||
|
dataSource = associated.getImage().getName();
|
||||||
|
} catch (TskCoreException ex) {
|
||||||
|
logger.log(Level.WARNING, "Failed to get image name from " + associated.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dataSource.isEmpty() == false) {
|
||||||
|
ss.put(new NodeProperty("Data Source", "Data Source",
|
||||||
|
NO_DESCR, dataSource));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user