mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-20 11:26:53 +00:00
fixes for event updates
This commit is contained in:
parent
ea1fd713c2
commit
f2d7157365
@ -42,6 +42,7 @@ import java.util.logging.Level;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
@ -515,7 +516,7 @@ public class AnalysisResultDAO extends BlackboardArtifactDAO {
|
|||||||
return getSetTreeItem(type,
|
return getSetTreeItem(type,
|
||||||
dataSourceId,
|
dataSourceId,
|
||||||
entry.getKey(),
|
entry.getKey(),
|
||||||
entry.getKey() == null ? nullSetName : entry.getKey(),
|
StringUtils.isBlank(entry.getKey()) ? nullSetName : entry.getKey(),
|
||||||
displayCount);
|
displayCount);
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
@ -23,6 +23,7 @@ import java.util.Comparator;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openide.nodes.ChildFactory;
|
import org.openide.nodes.ChildFactory;
|
||||||
import org.openide.nodes.Children;
|
import org.openide.nodes.Children;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
@ -51,13 +52,6 @@ public class AnalysisResultTypeFactory extends TreeChildFactory<AnalysisResultSe
|
|||||||
|
|
||||||
private final static Comparator<String> STRING_COMPARATOR = Comparator.nullsFirst(Comparator.naturalOrder());
|
private final static Comparator<String> STRING_COMPARATOR = Comparator.nullsFirst(Comparator.naturalOrder());
|
||||||
|
|
||||||
// @SuppressWarnings("deprecation")
|
|
||||||
// private static Set<Integer> SET_TREE_ARTIFACTS = ImmutableSet.of(
|
|
||||||
// BlackboardArtifact.Type.TSK_HASHSET_HIT.getTypeID(),
|
|
||||||
// BlackboardArtifact.Type.TSK_INTERESTING_ARTIFACT_HIT.getTypeID(),
|
|
||||||
// BlackboardArtifact.Type.TSK_INTERESTING_FILE_HIT.getTypeID(),
|
|
||||||
// BlackboardArtifact.Type.TSK_INTERESTING_ITEM.getTypeID()
|
|
||||||
// );
|
|
||||||
/**
|
/**
|
||||||
* Returns the path to the icon to use for this artifact type.
|
* Returns the path to the icon to use for this artifact type.
|
||||||
*
|
*
|
||||||
@ -91,8 +85,7 @@ public class AnalysisResultTypeFactory extends TreeChildFactory<AnalysisResultSe
|
|||||||
protected TreeNode<AnalysisResultSearchParam> createNewNode(TreeResultsDTO.TreeItemDTO<? extends AnalysisResultSearchParam> rowData) {
|
protected TreeNode<AnalysisResultSearchParam> createNewNode(TreeResultsDTO.TreeItemDTO<? extends AnalysisResultSearchParam> rowData) {
|
||||||
if (BlackboardArtifact.Type.TSK_KEYWORD_HIT.equals(rowData.getSearchParams().getArtifactType())) {
|
if (BlackboardArtifact.Type.TSK_KEYWORD_HIT.equals(rowData.getSearchParams().getArtifactType())) {
|
||||||
return new TreeTypeNode(rowData, new KeywordSetFactory(dataSourceId));
|
return new TreeTypeNode(rowData, new KeywordSetFactory(dataSourceId));
|
||||||
} else if ((rowData instanceof AnalysisResultTreeItem && ((AnalysisResultTreeItem) rowData).getHasChildren().orElse(false))
|
} else if (rowData instanceof AnalysisResultTreeItem && ((AnalysisResultTreeItem) rowData).getHasChildren().orElse(false)) {
|
||||||
|| rowData.getSearchParams() instanceof AnalysisResultSetSearchParam) {
|
|
||||||
return new TreeTypeNode(rowData, new TreeSetFactory(rowData.getSearchParams().getArtifactType(), dataSourceId, Bundle.AnalysisResultTypeFactory_nullSetName()));
|
return new TreeTypeNode(rowData, new TreeSetFactory(rowData.getSearchParams().getArtifactType(), dataSourceId, Bundle.AnalysisResultTypeFactory_nullSetName()));
|
||||||
} else {
|
} else {
|
||||||
return new AnalysisResultTypeTreeNode(rowData);
|
return new AnalysisResultTypeTreeNode(rowData);
|
||||||
@ -112,7 +105,8 @@ public class AnalysisResultTypeFactory extends TreeChildFactory<AnalysisResultSe
|
|||||||
if (originalTreeItem instanceof AnalysisResultTreeItem) {
|
if (originalTreeItem instanceof AnalysisResultTreeItem) {
|
||||||
hasChildren = ((AnalysisResultTreeItem) originalTreeItem).getHasChildren().orElse(null);
|
hasChildren = ((AnalysisResultTreeItem) originalTreeItem).getHasChildren().orElse(null);
|
||||||
} else if (originalTreeItem.getSearchParams() instanceof AnalysisResultSetSearchParam) {
|
} else if (originalTreeItem.getSearchParams() instanceof AnalysisResultSetSearchParam) {
|
||||||
hasChildren = true;
|
String setName = ((AnalysisResultSetSearchParam) originalTreeItem.getSearchParams()).getSetName();
|
||||||
|
hasChildren = StringUtils.isNotBlank(setName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate new type so that if it is a subtree event (i.e. keyword hits), the right tree item is created.
|
// generate new type so that if it is a subtree event (i.e. keyword hits), the right tree item is created.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user