Go to the documentation of this file.
19package org.sleuthkit.autopsy.textextractors;
21import java.io.BufferedInputStream;
22import java.io.IOException;
23import java.io.InputStreamReader;
25import java.nio.charset.Charset;
26import java.nio.charset.StandardCharsets;
27import java.util.logging.Level;
28import org.apache.commons.lang.StringUtils;
29import org.sleuthkit.autopsy.coreutils.Logger;
30import org.sleuthkit.autopsy.coreutils.textutils.EncodingUtils;
31import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
32import org.sleuthkit.datamodel.AbstractFile;
33import org.sleuthkit.datamodel.ReadContentInputStream;
34import org.sleuthkit.datamodel.TskCoreException;
42 private final AbstractFile
file;
64 }
catch (TskCoreException | IOException ex) {
65 logger.log(Level.WARNING, String.format(
"Error detecting the "
66 +
"encoding for %s (objID=%d)",
file.getName(),
file.getId()), ex);
75 return new InputStreamReader(
new BufferedInputStream(
new ReadContentInputStream(
file)),
encoding);
81 String mimeType =
file.getMIMEType();
84 if (StringUtils.isEmpty(mimeType)) {
89 logger.log(Level.SEVERE,
"Unable to create file type detector for determining MIME type", ex);
synchronized static Logger getLogger(String name)
static Charset getEncoding(AbstractFile file)
static final Charset UNKNOWN_CHARSET
String getMIMEType(AbstractFile file)
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.