diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Bundle.properties-MERGED b/Core/src/org/sleuthkit/autopsy/datamodel/Bundle.properties-MERGED index 0e0df5a58c..ae4211741a 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Bundle.properties-MERGED +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Bundle.properties-MERGED @@ -268,10 +268,10 @@ ImageNode.getActions.viewInNewWin.text=View in New Window ImageNode.createSheet.name.name=Name ImageNode.createSheet.name.displayName=Name ImageNode.createSheet.name.desc=no description -Installer.exception.tskVerStringNull.msg=Sleuth Kit JNI test call returned without error, but version string was null! -Installer.exception.taskVerStringBang.msg=Sleuth Kit JNI test call returned without error, but version string was ""! -Installer.tskLibErr.msg=Problem with Sleuth Kit JNI. Test call failed!\n\nDetails: {0} -Installer.tskLibErr.err=Fatal Error! +Installer.exception.tskVerStringNull.msg=Sleuth Kit JNI test call returned without error, but version string was null\! +Installer.exception.taskVerStringBang.msg=Sleuth Kit JNI test call returned without error, but version string was ""\! +Installer.tskLibErr.msg=Problem with Sleuth Kit JNI. Test call failed\!\n\nDetails: {0} +Installer.tskLibErr.err=Fatal Error\! InterestingHits.interestingItems.text=INTERESTING ITEMS InterestingHits.displayName.text=Interesting Items InterestingHits.createSheet.name.name=Name @@ -301,6 +301,15 @@ OpenReportAction.actionPerformed.NoAssociatedEditorMessage=There is no associate OpenReportAction.actionPerformed.NoOpenInEditorSupportMessage=This platform (operating system) does not support opening a file in an editor this way. OpenReportAction.actionPerformed.MissingReportFileMessage=The report file no longer exists. OpenReportAction.actionPerformed.ReportFileOpenPermissionDeniedMessage=Permission to open the report file was denied. +PoolNode.createSheet.name.desc=no description +PoolNode.createSheet.name.displayName=Name +PoolNode.createSheet.name.name=Name +PoolNode.createSheet.offset.desc=no description +PoolNode.createSheet.offset.displayName=Starting offset +PoolNode.createSheet.offset.name=Starting offset +PoolNode.createSheet.type.desc=no description +PoolNode.createSheet.type.displayName=Type +PoolNode.createSheet.type.name=Type RecentFiles.aut0DayFilter.displayName.text=Final Day RecentFiles.aut1dayFilter.displayName.text=Final Day - 1 RecentFiles.aut2dayFilter.displayName.text=Final Day - 2 diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentNodeVisitor.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentNodeVisitor.java index 2277cb4b56..af7eb3a249 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentNodeVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentNodeVisitor.java @@ -35,6 +35,8 @@ interface ContentNodeVisitor { T visit(LocalDirectoryNode ldn); T visit(VolumeNode vn); + + T visit(PoolNode pn); T visit(DirectoryNode dn); @@ -85,6 +87,11 @@ interface ContentNodeVisitor { public T visit(VolumeNode vn) { return defaultVisit(vn); } + + @Override + public T visit(PoolNode pn) { + return defaultVisit(pn); + } @Override public T visit(LayoutFileNode lcn) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/CreateSleuthkitNodeVisitor.java b/Core/src/org/sleuthkit/autopsy/datamodel/CreateSleuthkitNodeVisitor.java index d9ff5fc33b..b5d808153d 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/CreateSleuthkitNodeVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/CreateSleuthkitNodeVisitor.java @@ -28,6 +28,7 @@ import org.sleuthkit.datamodel.Image; import org.sleuthkit.datamodel.LayoutFile; import org.sleuthkit.datamodel.LocalDirectory; import org.sleuthkit.datamodel.LocalFile; +import org.sleuthkit.datamodel.Pool; import org.sleuthkit.datamodel.SlackFile; import org.sleuthkit.datamodel.SleuthkitItemVisitor; import org.sleuthkit.datamodel.SleuthkitVisitableItem; @@ -58,6 +59,11 @@ public class CreateSleuthkitNodeVisitor extends SleuthkitItemVisitor.Default visit(Volume volume) { return new VolumeNode(volume); } + + @Override + public AbstractContentNode visit(Pool pool) { + return new PoolNode(pool); + } @Override public AbstractContentNode visit(LayoutFile lf) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNodeVisitor.java b/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNodeVisitor.java index 541cbc38f3..24f437251f 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNodeVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DisplayableItemNodeVisitor.java @@ -59,6 +59,8 @@ public interface DisplayableItemNodeVisitor { T visit(ImageNode in); T visit(VolumeNode vn); + + T visit(PoolNode pn); T visit(SlackFileNode sfn); @@ -262,6 +264,11 @@ public interface DisplayableItemNodeVisitor { public T visit(ImageNode in) { return defaultVisit(in); } + + @Override + public T visit(PoolNode pn) { + return defaultVisit(pn); + } @Override public T visit(VolumeNode vn) { diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/PoolNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/PoolNode.java new file mode 100644 index 0000000000..81e057d438 --- /dev/null +++ b/Core/src/org/sleuthkit/autopsy/datamodel/PoolNode.java @@ -0,0 +1,211 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2019 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.datamodel; + +import java.util.ArrayList; +import java.util.List; +import javax.swing.Action; +import org.apache.commons.lang3.tuple.Pair; +import org.openide.nodes.Sheet; +import org.openide.util.NbBundle; +import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttributeInstance; +import org.sleuthkit.autopsy.corecomponents.DataResultViewerTable; +import static org.sleuthkit.autopsy.datamodel.AbstractContentNode.NO_DESCR; +import org.sleuthkit.datamodel.Pool; +import org.sleuthkit.datamodel.Tag; + +/** + * This class is used to represent the "Node" for the pool. + */ +public class PoolNode extends AbstractContentNode { + + /** + * Helper so that the display name and the name used in building the path + * are determined the same way. + * + * @param pool Pool to get the name of + * + * @return short name for the pool + */ + static String nameForPool(Pool pool) { + return pool.getType().getName(); + } + + /** + * + * @param pool underlying Content instance + */ + public PoolNode(Pool pool) { + super(pool); + + // set name, display name, and icon + String poolName = nameForPool(pool); + this.setDisplayName(poolName); + + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/pool-icon.png"); //NON-NLS + } + + /** + * Right click action for volume node + * + * @param popup + * + * @return + */ + @Override + public Action[] getActions(boolean popup) { + List actionsList = new ArrayList<>(); + + for (Action a : super.getActions(true)) { + actionsList.add(a); + } + + return actionsList.toArray(new Action[actionsList.size()]); + + } + + @NbBundle.Messages({ + "PoolNode.createSheet.name.name=Name", + "PoolNode.createSheet.name.displayName=Name", + "PoolNode.createSheet.name.desc=no description", + "PoolNode.createSheet.offset.name=Starting offset", + "PoolNode.createSheet.offset.displayName=Starting offset", + "PoolNode.createSheet.offset.desc=no description", + "PoolNode.createSheet.type.name=Type", + "PoolNode.createSheet.type.displayName=Type", + "PoolNode.createSheet.type.desc=no description", + }) + @Override + protected Sheet createSheet() { + Sheet sheet = super.createSheet(); + Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES); + if (sheetSet == null) { + sheetSet = Sheet.createPropertiesSet(); + sheet.put(sheetSet); + } + + Pool pool = this.getContent(); + sheetSet.put(new NodeProperty<>(Bundle.PoolNode_createSheet_name_name(), + Bundle.PoolNode_createSheet_name_displayName(), + Bundle.PoolNode_createSheet_name_desc(), + this.getDisplayName())); + sheetSet.put(new NodeProperty<>(Bundle.PoolNode_createSheet_offset_name(), + Bundle.PoolNode_createSheet_offset_displayName(), + Bundle.PoolNode_createSheet_offset_desc(), + pool.getOffset())); + sheetSet.put(new NodeProperty<>(Bundle.PoolNode_createSheet_type_name(), + Bundle.PoolNode_createSheet_type_displayName(), + Bundle.PoolNode_createSheet_type_desc(), + pool.getType().getName())); + + return sheet; + } + + @Override + public T accept(ContentNodeVisitor visitor) { + return visitor.visit(this); + } + + @Override + public boolean isLeafTypeNode() { + return false; + } + + @Override + public T accept(DisplayableItemNodeVisitor visitor) { + return visitor.visit(this); + } + + @Override + public String getItemType() { + return getClass().getName(); + } + + /** + * Reads and returns a list of all tags associated with this content node. + * + * Null implementation of an abstract method. + * + * @return list of tags associated with the node. + */ + @Override + protected List getAllTagsFromDatabase() { + return new ArrayList<>(); + } + + /** + * Returns correlation attribute instance for the underlying content of the + * node. + * + * Null implementation of an abstract method. + * + * @return correlation attribute instance for the underlying content of the + * node. + */ + @Override + protected CorrelationAttributeInstance getCorrelationAttributeInstance() { + return null; + } + + /** + * Returns Score property for the node. + * + * Null implementation of an abstract method. + * + * @param tags list of tags. + * + * @return Score property for the underlying content of the node. + */ + @Override + protected Pair getScorePropertyAndDescription(List tags) { + return Pair.of(DataResultViewerTable.Score.NO_SCORE, NO_DESCR); + } + + /** + * Returns comment property for the node. + * + * Null implementation of an abstract method. + * + * @param tags list of tags + * @param attribute correlation attribute instance + * + * @return Comment property for the underlying content of the node. + */ + @Override + protected DataResultViewerTable.HasCommentStatus getCommentProperty(List tags, CorrelationAttributeInstance attribute) { + return DataResultViewerTable.HasCommentStatus.NO_COMMENT; + } + + /** + * Returns occurrences/count property for the node. + * + * Null implementation of an abstract method. + * + * @param attributeType the type of the attribute to count + * @param attributeValue the value of the attribute to coun + * @param defaultDescription a description to use when none is determined by + * the getCountPropertyAndDescription method + * + * @return count property for the underlying content of the node. + */ + @Override + protected Pair getCountPropertyAndDescription(CorrelationAttributeInstance.Type attributeType, String attributeValue, String defaultDescription) { + return Pair.of(-1L, NO_DESCR); + } +} diff --git a/Core/src/org/sleuthkit/autopsy/images/pool-icon.png b/Core/src/org/sleuthkit/autopsy/images/pool-icon.png new file mode 100644 index 0000000000..7300066c2d Binary files /dev/null and b/Core/src/org/sleuthkit/autopsy/images/pool-icon.png differ diff --git a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java index e0cb7176f9..7dfbdacb4c 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java @@ -30,6 +30,7 @@ import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Image; import org.sleuthkit.datamodel.VirtualDirectory; import org.sleuthkit.datamodel.LocalDirectory; +import org.sleuthkit.datamodel.Pool; import org.sleuthkit.datamodel.Report; import org.sleuthkit.datamodel.TskException; import org.sleuthkit.datamodel.Volume; @@ -71,6 +72,11 @@ abstract class GetFilesContentVisitor implements ContentVisitor visit(VolumeSystem vs) { return getAllFromChildren(vs); } + + @Override + public Collection visit(Pool pool) { + return getAllFromChildren(pool); + } @Override public Collection visit(Report r) {