Autopsy  4.1
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 - 2015 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 
34 public abstract class DisplayableItemNode extends AbstractNode {
35 
36  public DisplayableItemNode(Children children) {
37  super(children);
38  }
39 
40  public DisplayableItemNode(Children children, Lookup lookup) {
41  super(children, lookup);
42  }
43 
44  public abstract boolean isLeafTypeNode();
45 
46  public abstract <T> T accept(DisplayableItemNodeVisitor<T> v);
47 
48  /*
49  * TODO (AUT-1849): Correct or remove peristent column reordering code
50  *
51  * Added to support this feature.
52  */
53 // public abstract String getItemType();
64  static AbstractFile findLinked(BlackboardArtifact artifact) throws TskCoreException {
65 
66  BlackboardAttribute pathIDAttribute = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH_ID));
67 
68  if (pathIDAttribute != null) {
69  long contentID = pathIDAttribute.getValueLong();
70  if (contentID != -1) {
71  return artifact.getSleuthkitCase().getAbstractFileById(contentID);
72  }
73  }
74 
75  return null;
76  }
77 }
abstract< T > T accept(DisplayableItemNodeVisitor< T > v)

Copyright © 2012-2016 Basis Technology. Generated on: Tue Oct 25 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.