19 package org.sleuthkit.autopsy.communications;
21 import java.util.TimeZone;
22 import java.util.logging.Level;
23 import org.apache.commons.lang3.StringUtils;
24 import org.openide.nodes.Sheet;
30 import org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
31 import static org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME;
32 import static org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_SENT;
33 import static org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME_START;
34 import static org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL_FROM;
35 import static org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL_TO;
36 import static org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM;
37 import static org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO;
38 import static org.
sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SUBJECT;
39 import static org.
sleuthkit.datamodel.BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME;
52 final String stripEnd = StringUtils.stripEnd(artifact.getDisplayName(),
"s");
53 String removeEndIgnoreCase = StringUtils.removeEndIgnoreCase(stripEnd,
"message");
54 setDisplayName(removeEndIgnoreCase.isEmpty() ? stripEnd : removeEndIgnoreCase);
59 Sheet s =
new Sheet();
60 Sheet.Set ss = s.get(Sheet.PROPERTIES);
62 ss = Sheet.createPropertiesSet();
66 ss.put(
new NodeProperty<>(
"Type",
"Type",
"Type", getDisplayName()));
69 BlackboardArtifact.ARTIFACT_TYPE fromID = BlackboardArtifact.ARTIFACT_TYPE.fromID(
getArtifact().getArtifactTypeID());
83 ss.put(
new NodeProperty<>(
"Attms",
"Attms",
"Attms", artifact.getChildrenCount()));
84 }
catch (TskCoreException ex) {
85 logger.log(Level.WARNING,
"Error loading attachment count for " + artifact, ex);
99 ss.put(
new NodeProperty<>(
"Attms",
"Attms",
"Attms", artifact.getChildrenCount()));
100 }
catch (TskCoreException ex) {
101 logger.log(Level.WARNING,
"Error loading attachment count for " + artifact, ex);
132 BlackboardAttribute attribute = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.fromID(attributeType.getTypeID())));
133 if (attribute == null) {
135 }
else if (attributeType.getValueType() == DATETIME) {
136 return TimeUtilities.epochToTime(attribute.getValueLong(),
137 TimeZone.getTimeZone(Utils.getUserPreferredZoneId()));
139 return attribute.getDisplayString();
141 }
catch (TskCoreException tskCoreException) {
142 logger.log(Level.WARNING,
"Error getting attribute value.", tskCoreException);
static String getAttributeDisplayString(final BlackboardArtifact artifact, final ATTRIBUTE_TYPE attributeType)
static final Logger logger
RelationShipNode(BlackboardArtifact artifact)
final BlackboardArtifact artifact
BlackboardArtifact getArtifact()
synchronized static Logger getLogger(String name)