Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
VirtualDirectoryNode.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2021 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.Sheet;
22 import org.openide.util.NbBundle;
24 import org.sleuthkit.datamodel.VirtualDirectory;
25 
30 
31  private static final Logger logger = Logger.getLogger(VirtualDirectoryNode.class.getName());
32  //prefix for special VirtualDirectory root nodes grouping local files
33  public final static String LOGICAL_FILE_SET_PREFIX = "LogicalFileSet"; //NON-NLS
34 
35  public static String nameForVirtualDirectory(VirtualDirectory ld) {
36  return ld.getName();
37  }
38 
39  public VirtualDirectoryNode(VirtualDirectory ld) {
40  super(ld);
41 
42  this.setDisplayName(nameForVirtualDirectory(ld));
43 
44  this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-virtual.png"); //TODO NON-NLS
45  }
46 
47  @Override
48  protected Sheet createSheet() {
49  Sheet defaultSheet = super.createSheet();
50  Sheet.Set defaultSheetSet = defaultSheet.get(Sheet.PROPERTIES);
51 
52  //Pick out the location column
53  //This path should not show because VDs are not part of the data source
54  String locationCol = NbBundle.getMessage(AbstractAbstractFileNode.class, "AbstractAbstractFileNode.locationColLbl");
55  for (Property<?> p : defaultSheetSet.getProperties()) {
56  if(locationCol.equals(p.getName())) {
57  defaultSheetSet.remove(p.getName());
58  }
59  }
60 
61  return defaultSheet;
62  }
63 
64  @Override
65  public <T> T accept(ContentNodeVisitor<T> visitor) {
66  return visitor.visit(this);
67  }
68 
69  @Override
70  public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
71  return visitor.visit(this);
72  }
73 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:124
static String nameForVirtualDirectory(VirtualDirectory ld)

Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.