Autopsy  4.6.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
DisplayableItemNode.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2017 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.datamodel;
20 
21 import org.openide.nodes.AbstractNode;
22 import org.openide.nodes.Children;
23 import org.openide.util.Lookup;
24 import org.sleuthkit.datamodel.AbstractFile;
25 import org.sleuthkit.datamodel.BlackboardArtifact;
26 import org.sleuthkit.datamodel.BlackboardAttribute;
27 import org.sleuthkit.datamodel.TskCoreException;
28 
37 public abstract class DisplayableItemNode extends AbstractNode {
38 
39  /*
40  * An item type shared by DisplayableItemNodes that can be the parents of
41  * file nodes.
42  */
43  static final String FILE_PARENT_NODE_KEY = "orgsleuthkitautopsydatamodel" + "FileTypeParentNode";
44 
54  static AbstractFile findLinked(BlackboardArtifact artifact) throws TskCoreException {
55  BlackboardAttribute pathIDAttribute = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID));
56  if (pathIDAttribute != null) {
57  long contentID = pathIDAttribute.getValueLong();
58  if (contentID != -1) {
59  return artifact.getSleuthkitCase().getAbstractFileById(contentID);
60  }
61  }
62  return null;
63  }
64 
66 
77  public DisplayableItemNode(Children children) {
78  super(children);
79  }
80 
92  public DisplayableItemNode(Children children, Lookup lookup) {
93  super(children, lookup);
94  }
95 
107  public abstract <T> T accept(DisplayableItemNodeVisitor<T> visitor);
108 
115  public abstract boolean isLeafTypeNode();
116 
122  public abstract String getItemType();
123 
130  public void setChildNodeSelectionInfo(NodeSelectionInfo selectedChildNodeInfo) {
131  this.selectedChildNodeInfo = selectedChildNodeInfo;
132  }
133 
142  return selectedChildNodeInfo;
143  }
144 
145 }
abstract< T > T accept(DisplayableItemNodeVisitor< T > visitor)
void setChildNodeSelectionInfo(NodeSelectionInfo selectedChildNodeInfo)

Copyright © 2012-2016 Basis Technology. Generated on: Mon May 7 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.