Autopsy  4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
FileTypes.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2016 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 java.util.Arrays;
22 import org.openide.nodes.Sheet;
23 import org.openide.util.NbBundle;
24 import org.openide.util.lookup.Lookups;
25 import org.sleuthkit.datamodel.SleuthkitCase;
26 
30 public final class FileTypes implements AutopsyVisitableItem {
31 
32  private final SleuthkitCase skCase;
33 
34  FileTypes(SleuthkitCase skCase) {
35  this.skCase = skCase;
36  }
37 
38  @Override
39  public <T> T accept(AutopsyItemVisitor<T> v) {
40  return v.visit(this);
41  }
42 
43  SleuthkitCase getSleuthkitCase() {
44  return skCase;
45  }
46 
50  public static final class FileTypesNode extends DisplayableItemNode {
51 
52  @NbBundle.Messages("FileTypes.name.text=File Types")
53  private static final String NAME = Bundle.FileTypes_name_text();
54 
55  FileTypesNode(SleuthkitCase sleuthkitCase) {
56  super(new RootContentChildren(Arrays.asList(
57  new FileTypesByExtension(sleuthkitCase),
58  new FileTypesByMimeType(sleuthkitCase)
59  )), Lookups.singleton(NAME));
60  setName(NAME);
61  setDisplayName(NAME);
62  this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file_types.png");
63  }
64 
65  @Override
66  public boolean isLeafTypeNode() {
67  return false;
68  }
69 
70  @Override
71  public <T> T accept(DisplayableItemNodeVisitor<T> v) {
72  return v.visit(this);
73  }
74 
75  @Override
76  @NbBundle.Messages({
77  "FileTypes.createSheet.name.name=Name",
78  "FileTypes.createSheet.name.displayName=Name",
79  "FileTypes.createSheet.name.desc=no description"})
80  protected Sheet createSheet() {
81  Sheet s = super.createSheet();
82  Sheet.Set ss = s.get(Sheet.PROPERTIES);
83  if (ss == null) {
84  ss = Sheet.createPropertiesSet();
85  s.put(ss);
86  }
87 
88  ss.put(new NodeProperty<>(Bundle.FileTypes_createSheet_name_name(),
89  Bundle.FileTypes_createSheet_name_displayName(),
90  Bundle.FileTypes_createSheet_name_desc(),
91  NAME
92  ));
93  return s;
94  }
95 
96  @Override
97  public String getItemType() {
98  return getClass().getName();
99  }
100 
101  }
102 }

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