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