20 package org.sleuthkit.autopsy.communications.relationships;
22 import java.util.TimeZone;
23 import java.util.logging.Level;
28 import static org.
sleuthkit.datamodel.BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME;
36 final class RelationshipsNodeUtilities {
38 private static final Logger logger = Logger.getLogger(RelationshipsNodeUtilities.class.getName());
41 private RelationshipsNodeUtilities(){
55 static String getAttributeDisplayString(
final BlackboardArtifact artifact,
final BlackboardAttribute.ATTRIBUTE_TYPE attributeType) {
57 BlackboardAttribute attribute = artifact.getAttribute(
new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.fromID(attributeType.getTypeID())));
58 if (attribute == null) {
60 }
else if (attributeType.getValueType() == DATETIME) {
61 return TimeUtilities.epochToTime(attribute.getValueLong(),
62 TimeZone.getTimeZone(Utils.getUserPreferredZoneId()));
64 return attribute.getDisplayString();
66 }
catch (TskCoreException tskCoreException) {
67 logger.log(Level.WARNING,
"Error getting attribute value.", tskCoreException);
82 static String normalizePhoneNum(String phoneNum) {
83 String normailzedPhoneNum = phoneNum.replaceAll(
"\\D",
"");
85 if (phoneNum.startsWith(
"+")) {
86 normailzedPhoneNum =
"+" + normailzedPhoneNum;
89 if (normailzedPhoneNum.isEmpty()) {
90 normailzedPhoneNum = phoneNum;
93 return normailzedPhoneNum;
105 static String normalizeEmailAddress(String emailAddress) {
106 String normailzedEmailAddr = emailAddress.toLowerCase();
108 return normailzedEmailAddr;