Merge remote-tracking branch 'upstream/develop' into 7673-postartifacts-feeds-pipeline-other-apis

This commit is contained in:
Richard Cordovano 2021-11-01 11:34:12 -04:00
commit 4978eb11e5
2 changed files with 17 additions and 17 deletions

View File

@ -149,7 +149,8 @@ class MessageArtifactWorker extends SwingWorker<MessageArtifactWorker.MesssageAr
static Optional<BlackboardArtifact> getAssociatedArtifact(final BlackboardArtifact artifact) throws TskCoreException { static Optional<BlackboardArtifact> getAssociatedArtifact(final BlackboardArtifact artifact) throws TskCoreException {
BlackboardAttribute attribute = artifact.getAttribute(TSK_ASSOCIATED_TYPE); BlackboardAttribute attribute = artifact.getAttribute(TSK_ASSOCIATED_TYPE);
if (attribute != null) { if (attribute != null) {
return Optional.of(artifact.getSleuthkitCase().getArtifactByArtifactId(attribute.getValueLong())); //in the context of the Message content viewer the associated artifact will always be a data artifact
return Optional.of(artifact.getSleuthkitCase().getBlackboard().getDataArtifactById(attribute.getValueLong()));
} }
return Optional.empty(); return Optional.empty();
} }

View File

@ -45,7 +45,6 @@ import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.casemodule.services.TagsManager; import org.sleuthkit.autopsy.casemodule.services.TagsManager;
import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.ImageUtils;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.datamodel.ContentUtils;
import org.sleuthkit.autopsy.report.ReportProgressPanel; import org.sleuthkit.autopsy.report.ReportProgressPanel;
import static org.sleuthkit.autopsy.casemodule.services.TagsManager.getNotableTagLabel; import static org.sleuthkit.autopsy.casemodule.services.TagsManager.getNotableTagLabel;
import org.sleuthkit.autopsy.coreutils.TimeZoneUtils; import org.sleuthkit.autopsy.coreutils.TimeZoneUtils;
@ -358,7 +357,7 @@ class TableReportGenerator {
// Give the modules the rows for the content tags. // Give the modules the rows for the content tags.
for (ContentTag tag : tags) { for (ContentTag tag : tags) {
try { try {
if(shouldFilterFromReport(tag.getContent())) { if (shouldFilterFromReport(tag.getContent())) {
continue; continue;
} }
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
@ -451,7 +450,7 @@ class TableReportGenerator {
// Give the modules the rows for the content tags. // Give the modules the rows for the content tags.
for (BlackboardArtifactTag tag : tags) { for (BlackboardArtifactTag tag : tags) {
try { try {
if(shouldFilterFromReport(tag.getContent())) { if (shouldFilterFromReport(tag.getContent())) {
continue; continue;
} }
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
@ -813,7 +812,7 @@ class TableReportGenerator {
AbstractFile f = openCase.getSleuthkitCase().getAbstractFileById(objId); AbstractFile f = openCase.getSleuthkitCase().getAbstractFileById(objId);
if (f != null) { if (f != null) {
uniquePath = openCase.getSleuthkitCase().getAbstractFileById(objId).getUniquePath(); uniquePath = openCase.getSleuthkitCase().getAbstractFileById(objId).getUniquePath();
if(shouldFilterFromReport(f)) { if (shouldFilterFromReport(f)) {
continue; continue;
} }
} }
@ -973,7 +972,7 @@ class TableReportGenerator {
AbstractFile f = openCase.getSleuthkitCase().getAbstractFileById(objId); AbstractFile f = openCase.getSleuthkitCase().getAbstractFileById(objId);
if (f != null) { if (f != null) {
uniquePath = openCase.getSleuthkitCase().getAbstractFileById(objId).getUniquePath(); uniquePath = openCase.getSleuthkitCase().getAbstractFileById(objId).getUniquePath();
if(shouldFilterFromReport(f)) { if (shouldFilterFromReport(f)) {
continue; continue;
} }
} }
@ -1217,8 +1216,8 @@ class TableReportGenerator {
private List<ArtifactData> getFilteredArtifacts(BlackboardArtifact.Type type, HashSet<String> tagNamesFilter) { private List<ArtifactData> getFilteredArtifacts(BlackboardArtifact.Type type, HashSet<String> tagNamesFilter) {
List<ArtifactData> artifacts = new ArrayList<>(); List<ArtifactData> artifacts = new ArrayList<>();
try { try {
for (BlackboardArtifact artifact : Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboardArtifacts(type.getTypeID())) { for (BlackboardArtifact artifact : Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard().getArtifacts(Collections.singletonList(type), settings.getSelectedDataSources())) {
if(shouldFilterFromReport(artifact)) { if (shouldFilterFromReport(artifact)) {
continue; continue;
} }
@ -1339,7 +1338,7 @@ class TableReportGenerator {
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH))); new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH)));
columns.add(new AttributeColumn(NbBundle.getMessage(this.getClass(), "ReportGenerator.artTableColHdr.dateTime"), columns.add(new AttributeColumn(NbBundle.getMessage(this.getClass(), "ReportGenerator.artTableColHdr.dateTime"),
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED ))); new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED)));
attributeTypeSet.remove(new Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID)); attributeTypeSet.remove(new Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID));
} else if (BlackboardArtifact.ARTIFACT_TYPE.TSK_INSTALLED_PROG.getTypeID() == artifactTypeId) { } else if (BlackboardArtifact.ARTIFACT_TYPE.TSK_INSTALLED_PROG.getTypeID() == artifactTypeId) {
@ -1822,7 +1821,7 @@ class TableReportGenerator {
* Indicates if the content should be filtered from the report. * Indicates if the content should be filtered from the report.
*/ */
private boolean shouldFilterFromReport(Content content) throws TskCoreException { private boolean shouldFilterFromReport(Content content) throws TskCoreException {
if(this.settings.getSelectedDataSources() == null) { if (this.settings.getSelectedDataSources() == null) {
return false; return false;
} }