mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Changed query for tags associated with this artifact to match the actual DB schema, and extracted that to a method
This commit is contained in:
parent
8b9742ea91
commit
420eee58c6
@ -47,6 +47,7 @@ import javax.swing.JDialog;
|
|||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.SwingWorker;
|
import javax.swing.SwingWorker;
|
||||||
import org.openide.filesystems.FileUtil;
|
import org.openide.filesystems.FileUtil;
|
||||||
|
import org.openide.util.Exceptions;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||||
@ -909,16 +910,12 @@ import org.sleuthkit.datamodel.TskData;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get any tags that associated with this artifact and apply the tag filter.
|
// Get any tags that associated with this artifact and apply the tag filter.
|
||||||
HashSet<String> uniqueTagNames = new HashSet<>();
|
HashSet<String> uniqueTagNames = getUniqueTagNames(rs.getLong("artifact_id"));
|
||||||
ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); //NON-NLS
|
if(failsTagFilter(uniqueTagNames, tagNamesFilter)) {
|
||||||
while (tagNameRows.next()) {
|
continue;
|
||||||
uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS
|
}
|
||||||
}
|
String tagsList = makeCommaSeparatedList(uniqueTagNames);
|
||||||
if(failsTagFilter(uniqueTagNames, tagNamesFilter)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
String tagsList = makeCommaSeparatedList(uniqueTagNames);
|
|
||||||
|
|
||||||
Long objId = rs.getLong("obj_id"); //NON-NLS
|
Long objId = rs.getLong("obj_id"); //NON-NLS
|
||||||
String keyword = rs.getString("keyword"); //NON-NLS
|
String keyword = rs.getString("keyword"); //NON-NLS
|
||||||
@ -1050,11 +1047,7 @@ import org.sleuthkit.datamodel.TskData;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get any tags that associated with this artifact and apply the tag filter.
|
// Get any tags that associated with this artifact and apply the tag filter.
|
||||||
HashSet<String> uniqueTagNames = new HashSet<>();
|
HashSet<String> uniqueTagNames = getUniqueTagNames(rs.getLong("artifact_id"));
|
||||||
ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); //NON-NLS
|
|
||||||
while (tagNameRows.next()) {
|
|
||||||
uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS
|
|
||||||
}
|
|
||||||
if(failsTagFilter(uniqueTagNames, tagNamesFilter)) {
|
if(failsTagFilter(uniqueTagNames, tagNamesFilter)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1664,6 +1657,16 @@ import org.sleuthkit.datamodel.TskData;
|
|||||||
return ReportGenerator.this.getMappedAttributes(attributes);
|
return ReportGenerator.this.getMappedAttributes(attributes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private HashSet<String> getUniqueTagNames(long artifactId) throws SQLException {
|
||||||
|
HashSet<String> uniqueTagNames = new HashSet<>();
|
||||||
|
ResultSet tagNameRows = skCase.runQuery("SELECT display_name, artifact_id FROM tag_names AS tn, blackboard_artifact_tags AS bat " + //NON-NLS
|
||||||
|
"WHERE tn.tag_name_id = bat.tag_name_id AND bat.artifact_id = " + artifactId); //NON-NLS
|
||||||
|
while (tagNameRows.next()) {
|
||||||
|
uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS
|
||||||
|
}
|
||||||
|
return uniqueTagNames;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user