Autopsy  4.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
FileTypeExtensionFilters.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011 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 java.util.List;
23 
24 import org.openide.util.NbBundle;
25 import org.sleuthkit.datamodel.SleuthkitCase;
26 
30 class FileTypeExtensionFilters implements AutopsyVisitableItem {
31 
32  private SleuthkitCase skCase;
33 
34  // root node filters
35  public enum RootFilter implements AutopsyVisitableItem, SearchFilterInterface {
36 
37  TSK_IMAGE_FILTER(0, "TSK_IMAGE_FILTER", //NON-NLS
38  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskImgFilter.text"),
40  TSK_VIDEO_FILTER(1, "TSK_VIDEO_FILTER", //NON-NLS
41  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskVideoFilter.text"),
43  TSK_AUDIO_FILTER(2, "TSK_AUDIO_FILTER", //NON-NLS
44  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskAudioFilter.text"),
46  TSK_ARCHIVE_FILTER(3, "TSK_ARCHIVE_FILTER", //NON-NLS
47  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskArchiveFilter.text"),
49  TSK_DOCUMENT_FILTER(3, "TSK_DOCUMENT_FILTER", //NON-NLS
50  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskDocumentFilter.text"),
51  Arrays.asList(".doc", ".docx", ".pdf", ".xls", ".rtf", ".txt")), //NON-NLS
52  TSK_EXECUTABLE_FILTER(3, "TSK_EXECUTABLE_FILTER", //NON-NLS
53  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskExecFilter.text"),
54  Arrays.asList(".exe", ".dll", ".bat", ".cmd", ".com")); //NON-NLS
55 
56  private int id;
57  private String name;
58  private String displayName;
59  private List<String> filter;
60 
61  private RootFilter(int id, String name, String displayName, List<String> filter) {
62  this.id = id;
63  this.name = name;
64  this.displayName = displayName;
65  this.filter = filter;
66  }
67 
68  @Override
69  public <T> T accept(AutopsyItemVisitor<T> v) {
70  return v.visit(this);
71  }
72 
73  @Override
74  public String getName() {
75  return this.name;
76  }
77 
78  @Override
79  public int getId() {
80  return this.id;
81  }
82 
83  @Override
84  public String getDisplayName() {
85  return this.displayName;
86  }
87 
88  @Override
89  public List<String> getFilter() {
90  return this.filter;
91  }
92  }
93 
94  // document sub-node filters
95  public enum DocumentFilter implements AutopsyVisitableItem, SearchFilterInterface {
96 
97  AUT_DOC_HTML(0, "AUT_DOC_HTML", //NON-NLS
98  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autDocHtmlFilter.text"),
99  Arrays.asList(".htm", ".html")), //NON-NLS
100  AUT_DOC_OFFICE(1, "AUT_DOC_OFFICE", //NON-NLS
101  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autDocOfficeFilter.text"),
102  Arrays.asList(".doc", ".docx", ".odt", ".xls", ".xlsx", ".ppt", ".pptx")), //NON-NLS
103  AUT_DOC_PDF(2, "AUT_DOC_PDF", //NON-NLS
104  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autoDocPdfFilter.text"),
105  Arrays.asList(".pdf")), //NON-NLS
106  AUT_DOC_TXT(3, "AUT_DOC_TXT", //NON-NLS
107  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autDocTxtFilter.text"),
108  Arrays.asList(".txt")), //NON-NLS
109  AUT_DOC_RTF(4, "AUT_DOC_RTF", //NON-NLS
110  NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autDocRtfFilter.text"),
111  Arrays.asList(".rtf")); //NON-NLS
112 
113  private int id;
114  private String name;
115  private String displayName;
116  private List<String> filter;
117 
118  private DocumentFilter(int id, String name, String displayName, List<String> filter) {
119  this.id = id;
120  this.name = name;
121  this.displayName = displayName;
122  this.filter = filter;
123  }
124 
125  @Override
126  public <T> T accept(AutopsyItemVisitor<T> v) {
127  return v.visit(this);
128  }
129 
130  @Override
131  public String getName() {
132  return this.name;
133  }
134 
135  @Override
136  public int getId() {
137  return this.id;
138  }
139 
140  @Override
141  public String getDisplayName() {
142  return this.displayName;
143  }
144 
145  @Override
146  public List<String> getFilter() {
147  return this.filter;
148  }
149  }
150 
151  // executable sub-node filters
152  public enum ExecutableFilter implements AutopsyVisitableItem, SearchFilterInterface {
153 
154  ExecutableFilter_EXE(0, "ExecutableFilter_EXE", ".exe", Arrays.asList(".exe")), //NON-NLS
155  ExecutableFilter_DLL(1, "ExecutableFilter_DLL", ".dll", Arrays.asList(".dll")), //NON-NLS
156  ExecutableFilter_BAT(2, "ExecutableFilter_BAT", ".bat", Arrays.asList(".bat")), //NON-NLS
157  ExecutableFilter_CMD(3, "ExecutableFilter_CMD", ".cmd", Arrays.asList(".cmd")), //NON-NLS
158  ExecutableFilter_COM(4, "ExecutableFilter_COM", ".com", Arrays.asList(".com")); //NON-NLS
159 
160  private int id;
161  private String name;
162  private String displayName;
163  private List<String> filter;
164 
165  private ExecutableFilter(int id, String name, String displayName, List<String> filter) {
166  this.id = id;
167  this.name = name;
168  this.displayName = displayName;
169  this.filter = filter;
170  }
171 
172  @Override
173  public <T> T accept(AutopsyItemVisitor<T> v) {
174  return v.visit(this);
175  }
176 
177  @Override
178  public String getName() {
179  return this.name;
180  }
181 
182  @Override
183  public int getId() {
184  return this.id;
185  }
186 
187  @Override
188  public String getDisplayName() {
189  return this.displayName;
190  }
191 
192  @Override
193  public List<String> getFilter() {
194  return this.filter;
195  }
196  }
197 
198  public FileTypeExtensionFilters(SleuthkitCase skCase) {
199  this.skCase = skCase;
200  }
201 
202  @Override
203  public <T> T accept(AutopsyItemVisitor<T> v) {
204  return v.visit(this);
205  }
206 
207  public SleuthkitCase getSleuthkitCase() {
208  return this.skCase;
209  }
210 
211  interface SearchFilterInterface {
212 
213  public String getName();
214 
215  public int getId();
216 
217  public String getDisplayName();
218 
219  public List<String> getFilter();
220  }
221 }
RootFilter(int id, String name, String displayName, List< String > filter)
DocumentFilter(int id, String name, String displayName, List< String > filter)
ExecutableFilter(int id, String name, String displayName, List< String > filter)

Copyright © 2012-2015 Basis Technology. Generated on: Wed Apr 6 2016
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.