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

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.