19 package org.sleuthkit.autopsy.textreaders;
21 import java.io.Reader;
22 import java.util.Arrays;
23 import java.util.List;
24 import org.openide.util.Lookup;
62 if (content instanceof AbstractFile) {
63 String mimeType = ((AbstractFile) content).getMIMEType();
64 List<TextExtractor> extractors = Arrays.asList(
65 new HtmlTextExtractor(content),
66 new SqliteTextExtractor(content),
67 new TikaTextExtractor(content));
68 for (TextExtractor extractor : extractors) {
69 extractor.setExtractionSettings(context);
70 if (extractor.isEnabled() && extractor.isSupported(content, mimeType)) {
71 return extractor.getReader();
74 }
else if (content instanceof BlackboardArtifact) {
75 TextExtractor artifactExtractor =
new ArtifactTextExtractor((BlackboardArtifact) content);
76 artifactExtractor.setExtractionSettings(context);
77 return artifactExtractor.getReader();
78 }
else if (content instanceof Report) {
79 TextExtractor reportExtractor =
new TikaTextExtractor(content);
80 reportExtractor.setExtractionSettings(context);
81 return reportExtractor.getReader();
88 String.format(
"Could not find a suitable reader for "
89 +
"content with name [%s] and id=[%d]. Try using "
90 +
"the default reader instead.",
91 content.getName(), content.getId())
129 StringsTextExtractor stringsInstance =
new StringsTextExtractor(content);
130 stringsInstance.setExtractionSettings(context);
131 return stringsInstance.getReader();
static Reader getStringsReader(Content content, Lookup context)
static Reader getReader(Content content, Lookup context)
NoTextReaderFound(Throwable ex)
static Reader getReader(Content content)
NoTextReaderFound(String msg)
NoTextReaderFound(String msg, Throwable ex)