From 52d13face45012d2bb7f2dbfe011f514d7f747b3 Mon Sep 17 00:00:00 2001 From: Brian Sweeney Date: Tue, 26 Jun 2018 10:59:55 -0600 Subject: [PATCH] more fiddling --- .../commonfilesearch/FileInstanceNode.java | 15 ++-- .../commonfilesearch/InstanceCountNode.java | 15 ++-- .../autopsy/commonfilesearch/Md5Node.java | 81 ++++++++++--------- 3 files changed, 59 insertions(+), 52 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/FileInstanceNode.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/FileInstanceNode.java index bf1e139ca0..8c2f774dcb 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/FileInstanceNode.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/FileInstanceNode.java @@ -76,15 +76,16 @@ public class FileInstanceNode extends FileNode { } Map map = new LinkedHashMap<>(); - fillPropertyMap(map, this); + //fillPropertyMap(map, this); final String NO_DESCR = Bundle.FileInstanceNode_createSheet_noDescription(); - for (CommonFilePropertyType propType : CommonFilePropertyType.values()) { - final String propString = propType.toString(); - final Object property = map.get(propString); - final NodeProperty nodeProperty = new NodeProperty<>(propString, propString, NO_DESCR, property); - sheetSet.put(nodeProperty); - } + + sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_filesColLbl(), Bundle.CommonFilesSearchResultsViewerTable_filesColLbl(), NO_DESCR, this.getContent().getName())); + sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), NO_DESCR, "")); + sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_pathColLbl(), Bundle.CommonFilesSearchResultsViewerTable_pathColLbl(), NO_DESCR, this.getContent().getParentPath())); + sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_hashsetHitsColLbl(), Bundle.CommonFilesSearchResultsViewerTable_hashsetHitsColLbl(), NO_DESCR, getHashSetHitsForFile(this.getContent()))); + sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), NO_DESCR, this.getDataSource())); + sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_mimeTypeColLbl(), Bundle.CommonFilesSearchResultsViewerTable_mimeTypeColLbl(), NO_DESCR, StringUtils.defaultString(this.getContent().getMIMEType()))); this.addTagProperty(sheetSet); diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/InstanceCountNode.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/InstanceCountNode.java index 81b5cd0557..1dd2059373 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/InstanceCountNode.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/InstanceCountNode.java @@ -103,14 +103,17 @@ final public class InstanceCountNode extends DisplayableItemNode { sheet.put(sheetSet); } - Map map = new LinkedHashMap<>(); - fillPropertyMap(map, this); + //Map map = new LinkedHashMap<>(); + //fillPropertyMap(map, this); final String NO_DESCR = Bundle.InstanceCountNode_createSheet_noDescription(); - for (InstanceCountNode.InstanceCountNodePropertyType propType : InstanceCountNode.InstanceCountNodePropertyType.values()) { - final String propString = propType.toString(); - sheetSet.put(new NodeProperty<>(propString, propString, NO_DESCR, map.get(propString))); - } + + sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), NO_DESCR, this.getInstanceCount())); + +// for (InstanceCountNode.InstanceCountNodePropertyType propType : InstanceCountNode.InstanceCountNodePropertyType.values()) { +// final String propString = propType.toString(); +// sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), NO_DESCR, this.getInstanceCount())); +// } return sheet; } diff --git a/Core/src/org/sleuthkit/autopsy/commonfilesearch/Md5Node.java b/Core/src/org/sleuthkit/autopsy/commonfilesearch/Md5Node.java index 3a6f1c986f..2a88684cb4 100644 --- a/Core/src/org/sleuthkit/autopsy/commonfilesearch/Md5Node.java +++ b/Core/src/org/sleuthkit/autopsy/commonfilesearch/Md5Node.java @@ -105,15 +105,18 @@ public class Md5Node extends DisplayableItemNode { sheetSet = Sheet.createPropertiesSet(); sheet.put(sheetSet); } - - Map map = new LinkedHashMap<>(); - fillPropertyMap(map, this); +// +// Map map = new LinkedHashMap<>(); + //fillPropertyMap(map, this); final String NO_DESCR = Bundle.Md5Node_createSheet_noDescription(); - for (Md5Node.CommonFileParentPropertyType propType : Md5Node.CommonFileParentPropertyType.values()) { - final String propString = propType.toString(); - sheetSet.put(new NodeProperty<>(propString, propString, NO_DESCR, map.get(propString))); - } + + sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), NO_DESCR, this.getDataSources())); + +// for (Md5Node.CommonFileParentPropertyType propType : Md5Node.CommonFileParentPropertyType.values()) { +// final String propString = propType.toString(); +// sheetSet.put(new NodeProperty<>(propString, propString, NO_DESCR, map.get(propString))); +// } return sheet; } @@ -125,16 +128,16 @@ public class Md5Node extends DisplayableItemNode { * put * @param node The item to get properties for. */ - static private void fillPropertyMap(Map map, Md5Node node) { - - //map.put(CommonFileParentPropertyType.Files.toString(), ""); - //map.put(CommonFileParentPropertyType.Instances.toString(), ""); - //map.put(CommonFileParentPropertyType.ParentPath.toString(), ""); - //map.put(CommonFileParentPropertyType.HashsetHits.toString(), ""); - map.put(CommonFileParentPropertyType.DataSource.toString(), node.getDataSources()); - //map.put(CommonFileParentPropertyType.MimeType.toString(), ""); - //map.put(CommonFileParentPropertyType.Tags.toString(), ""); - } +// static private void fillPropertyMap(Map map, Md5Node node) { +// +// //map.put(CommonFileParentPropertyType.Files.toString(), ""); +// //map.put(CommonFileParentPropertyType.Instances.toString(), ""); +// //map.put(CommonFileParentPropertyType.ParentPath.toString(), ""); +// //map.put(CommonFileParentPropertyType.HashsetHits.toString(), ""); +// map.put(CommonFileParentPropertyType.DataSource.toString(), node.getDataSources()); +// //map.put(CommonFileParentPropertyType.MimeType.toString(), ""); +// //map.put(CommonFileParentPropertyType.Tags.toString(), ""); +// } @Override public T accept(DisplayableItemNodeVisitor visitor) { @@ -183,25 +186,25 @@ public class Md5Node extends DisplayableItemNode { } } - public enum CommonFileParentPropertyType { - - //Files(Bundle.CommonFileParentPropertyType_filesColLbl1()), - //Instances(Bundle.CommonFilesParentPropertyType_instancesColLbl1()), - //ParentPath(Bundle.CommonFileParentPropertyType_parentPathColLbl()), - //HashSetHits(Bundle.CommonFileParentPropertyType_hashSetHitsColLbl1()), - DataSource(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl()), - //MimeType(Bundle.CommonFilePropertyType_mimeTypeColLbl1()) - ; - - final private String displayString; - - private CommonFileParentPropertyType(String displayString) { - this.displayString = displayString; - } - - @Override - public String toString() { - return this.displayString; - } - } -} +// public enum CommonFileParentPropertyType { +// +// //Files(Bundle.CommonFileParentPropertyType_filesColLbl1()), +// //Instances(Bundle.CommonFilesParentPropertyType_instancesColLbl1()), +// //ParentPath(Bundle.CommonFileParentPropertyType_parentPathColLbl()), +// //HashSetHits(Bundle.CommonFileParentPropertyType_hashSetHitsColLbl1()), +// DataSource(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl()), +// //MimeType(Bundle.CommonFilePropertyType_mimeTypeColLbl1()) +// ; +// +// final private String displayString; +// +// private CommonFileParentPropertyType(String displayString) { +// this.displayString = displayString; +// } +// +// @Override +// public String toString() { +// return this.displayString; +// } +// } +} \ No newline at end of file