Go to the documentation of this file.
19package org.sleuthkit.autopsy.datamodel;
21import java.util.logging.Level;
22import org.apache.commons.lang.StringUtils;
23import org.openide.util.NbBundle;
24import org.openide.util.NbBundle.Messages;
25import org.sleuthkit.autopsy.coreutils.Logger;
26import org.sleuthkit.autopsy.coreutils.TimeZoneUtils;
27import org.sleuthkit.datamodel.BlackboardArtifact;
28import org.sleuthkit.datamodel.BlackboardAttribute;
29import org.sleuthkit.datamodel.Content;
30import org.sleuthkit.datamodel.TskCoreException;
65 "ArtifactStringContent.attrsTableHeader.type=Type",
66 "ArtifactStringContent.attrsTableHeader.value=Value",
67 "ArtifactStringContent.attrsTableHeader.sources=Source(s)",
68 "ArtifactStringContent.failedToGetSourcePath.message=Failed to get source file path from case database",
69 "ArtifactStringContent.failedToGetAttributes.message=Failed to get some or all attributes from case database"
77 StringBuilder buffer =
new StringBuilder(1024);
78 buffer.append(
"<html>\n");
79 buffer.append(
"<body>\n");
84 buffer.append(
"<h3>");
85 buffer.append(
artifact.getDisplayName());
86 buffer.append(
"</h3>\n");
92 buffer.append(
"<table border='1'>");
95 buffer.append(
"<tr>");
96 buffer.append(
"<th><b>");
97 buffer.append(Bundle.ArtifactStringContent_attrsTableHeader_type());
98 buffer.append(
"</b></th>");
99 buffer.append(
"<th><b>");
100 buffer.append(Bundle.ArtifactStringContent_attrsTableHeader_value());
101 buffer.append(
"</b></th>");
102 buffer.append(
"<th><b>");
103 buffer.append(Bundle.ArtifactStringContent_attrsTableHeader_sources());
104 buffer.append(
"</b></th>");
105 buffer.append(
"</tr>\n");
107 Content content =
artifact.getSleuthkitCase().getContentById(
artifact.getObjectID());
112 for (BlackboardAttribute attr :
artifact.getAttributes()) {
118 switch (attr.getAttributeType().getValueType()) {
126 value = attr.getDisplayString();
131 long epoch = attr.getValueLong();
139 String sources = StringUtils.join(attr.getSources(),
", ");
140 buffer.append(
makeTableRow(attr.getAttributeType().getDisplayName(), value, sources));
149 if (
null != content) {
150 path = content.getUniquePath();
152 }
catch (TskCoreException ex) {
153 logger.log(Level.SEVERE, String.format(
"Error getting source content path for artifact (artifact_id=%d, obj_id=%d)",
artifact.getArtifactID(),
artifact.getObjectID()), ex);
154 path = Bundle.ArtifactStringContent_failedToGetSourcePath_message();
157 buffer.append(
makeTableRow(NbBundle.getMessage(
this.getClass(),
"ArtifactStringContent.getStr.srcFilePath.text"),
164 buffer.append(
makeTableRow(NbBundle.getMessage(
this.getClass(),
"ArtifactStringContent.getStr.artifactId.text"),
165 Long.toString(
artifact.getArtifactID()),
""));
167 }
catch (TskCoreException ex) {
168 logger.log(Level.SEVERE, String.format(
"Error getting data for artifact (artifact_id=%d)",
artifact.getArtifactID()), ex);
169 buffer.append(
makeTableRow(Bundle.ArtifactStringContent_failedToGetAttributes_message(),
"",
""));
174 buffer.append(
"</table>");
175 buffer.append(
"</html>\n");
185 str = str.replaceAll(
" ",
" ");
186 str = str.replaceAll(
"<",
"<");
187 str = str.replaceAll(
">",
">");
188 str = str.replaceAll(
"(\r\n|\n)",
"<br />");
199 private String
makeTableRow(String type, String value, String source) {
synchronized static Logger getLogger(String name)
static String getFormattedTime(long epochTime)
final BlackboardArtifact artifact
String escapeHtmlString(String str)
ArtifactStringContent(BlackboardArtifact artifact)
static final Logger logger
String makeTableRow(String type, String value, String source)
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.