Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
FilterUtils.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2018 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.timeline.utils;
20 
21 import java.util.HashSet;
22 import java.util.Set;
23 import org.openide.util.NbBundle;
27 import org.sleuthkit.datamodel.TimelineFilter.FileTypeFilter;
28 import org.sleuthkit.datamodel.TimelineFilter.InverseFileTypeFilter;
29 import org.sleuthkit.datamodel.TimelineFilter.FileTypesFilter;
30 
34 public final class FilterUtils {
35 
36  private static final Set<String> NON_OTHER_MIME_TYPES = new HashSet<>();
37 
38  static {
39  NON_OTHER_MIME_TYPES.addAll(DOCUMENTS.getMediaTypes());
40  NON_OTHER_MIME_TYPES.addAll(EXECUTABLE.getMediaTypes());
41  NON_OTHER_MIME_TYPES.addAll(MEDIA.getMediaTypes());
42  }
43 
44  private FilterUtils() {
45  }
46 
53  @NbBundle.Messages({
54  "FilterUtils.otherFilter.displayName=Other"})
55  public static FileTypesFilter createDefaultFileTypesFilter() {
56  FileTypesFilter fileTypesFilter = new FileTypesFilter();
57  fileTypesFilter.addSubFilter(new FileTypeFilter(MEDIA.getDisplayName(), MEDIA.getMediaTypes()));
58  fileTypesFilter.addSubFilter(new FileTypeFilter(DOCUMENTS.getDisplayName(), DOCUMENTS.getMediaTypes()));
59  fileTypesFilter.addSubFilter(new FileTypeFilter(EXECUTABLE.getDisplayName(), EXECUTABLE.getMediaTypes()));
60  fileTypesFilter.addSubFilter(new InverseFileTypeFilter(Bundle.FilterUtils_otherFilter_displayName(), NON_OTHER_MIME_TYPES));
61  return fileTypesFilter;
62  }
63 }
static final Set< String > NON_OTHER_MIME_TYPES
static FileTypesFilter createDefaultFileTypesFilter()

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.