Autopsy  4.6.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ContentTextExtractor.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-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.keywordsearch;
20 
21 import java.io.Reader;
22 import java.util.Arrays;
23 import java.util.List;
24 import org.sleuthkit.datamodel.Content;
25 
30 abstract class ContentTextExtractor implements TextExtractor<Content> {
31 
32 
33  static final List<String> BLOB_MIME_TYPES
34  = Arrays.asList(
35  //ignore binary blob data, for which string extraction will be used
36  "application/octet-stream", //NON-NLS
37  "application/x-msdownload"); //NON-NLS
38 
41  static final List<String> ARCHIVE_MIME_TYPES
42  = Arrays.asList(
43  //ignore unstructured binary and compressed data, for which string extraction or unzipper works better
44  "application/x-7z-compressed", //NON-NLS
45  "application/x-ace-compressed", //NON-NLS
46  "application/x-alz-compressed", //NON-NLS
47  "application/x-arj", //NON-NLS
48  "application/vnd.ms-cab-compressed", //NON-NLS
49  "application/x-cfs-compressed", //NON-NLS
50  "application/x-dgc-compressed", //NON-NLS
51  "application/x-apple-diskimage", //NON-NLS
52  "application/x-gca-compressed", //NON-NLS
53  "application/x-dar", //NON-NLS
54  "application/x-lzx", //NON-NLS
55  "application/x-lzh", //NON-NLS
56  "application/x-rar-compressed", //NON-NLS
57  "application/x-stuffit", //NON-NLS
58  "application/x-stuffitx", //NON-NLS
59  "application/x-gtar", //NON-NLS
60  "application/x-archive", //NON-NLS
61  "application/x-executable", //NON-NLS
62  "application/x-gzip", //NON-NLS
63  "application/zip", //NON-NLS
64  "application/x-zoo", //NON-NLS
65  "application/x-cpio", //NON-NLS
66  "application/x-shar", //NON-NLS
67  "application/x-tar", //NON-NLS
68  "application/x-bzip", //NON-NLS
69  "application/x-bzip2", //NON-NLS
70  "application/x-lzip", //NON-NLS
71  "application/x-lzma", //NON-NLS
72  "application/x-lzop", //NON-NLS
73  "application/x-z", //NON-NLS
74  "application/x-compress"); //NON-NLS
75 
83  abstract boolean isContentTypeSpecific();
84 
95  abstract boolean isSupported(Content file, String detectedFormat);
96 
97  @Override
98  public abstract Reader getReader(Content source) throws TextExtractorException;
99 
100  @Override
101  public long getID(Content source) {
102  return source.getId();
103  }
104 
105 
106  @Override
107  public String getName(Content source) {
108  return source.getName();
109  }
110 }

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