19package org.sleuthkit.autopsy.textextractors;
21import java.io.InputStreamReader;
23import java.nio.charset.StandardCharsets;
24import org.apache.commons.io.IOUtils;
25import org.sleuthkit.autopsy.coreutils.TimeZoneUtils;
26import org.sleuthkit.datamodel.BlackboardArtifact;
27import org.sleuthkit.datamodel.BlackboardAttribute;
28import org.sleuthkit.datamodel.TskCoreException;
36 private final BlackboardArtifact artifact;
38 public ArtifactTextExtractor(BlackboardArtifact artifact) {
39 this.artifact = artifact;
43 public Reader
getReader()
throws InitReaderException {
46 StringBuilder artifactContents =
new StringBuilder();
49 for (BlackboardAttribute attribute : artifact.getAttributes()) {
50 artifactContents.append(attribute.getAttributeType().getDisplayName());
51 artifactContents.append(
" : ");
57 switch (attribute.getValueType()) {
62 artifactContents.append(attribute.getDisplayString());
64 artifactContents.append(System.lineSeparator());
66 }
catch (TskCoreException tskCoreException) {
67 throw new InitReaderException(
"Unable to get attributes for artifact: " + artifact.toString(), tskCoreException);
70 return new InputStreamReader(IOUtils.toInputStream(artifactContents,
71 StandardCharsets.UTF_8), StandardCharsets.UTF_8);
static String getFormattedTime(long epochTime)