diff --git a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/VcardParser.java b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/VcardParser.java index 84f4cd92c8..3cc4f64e64 100755 --- a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/VcardParser.java +++ b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/VcardParser.java @@ -224,8 +224,6 @@ final class VcardParser { if (!tskBlackboard.artifactExists(abstractFile, BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT, attributes)) { artifact = abstractFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT); artifact.addAttributes(attributes); - List blackboardArtifacts = new ArrayList<>(); - blackboardArtifacts.add(artifact); extractPhotos(vcard, abstractFile, artifact); @@ -388,8 +386,12 @@ final class VcardParser { */ private void addPhoneAttributes(Telephone telephone, AbstractFile abstractFile, Collection attributes) { String telephoneText = telephone.getText(); + if (telephoneText == null || telephoneText.isEmpty()) { - return; + telephoneText = telephone.getUri().getNumber(); + if (telephoneText == null || telephoneText.isEmpty()) { + return; + } } // Add phone number to collection for later creation of TSK_CONTACT. @@ -408,20 +410,25 @@ final class VcardParser { type.getValue().toUpperCase().replaceAll("\\s+","").split(",")); for (String splitType : splitTelephoneTypes) { - String attributeTypeName = "TSK_PHONE_NUMBER_" + splitType; + String attributeTypeName = "TSK_PHONE_NUMBER"; + if(splitType != null && !splitType.isEmpty()) { + attributeTypeName = "TSK_PHONE_NUMBER_" + splitType; + } + try { BlackboardAttribute.Type attributeType = tskCase.getAttributeType(attributeTypeName); if (attributeType == null) { // Add this attribute type to the case database. - attributeType = tskCase.addArtifactAttributeType(attributeTypeName, - BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING, - String.format("Phone (%s)", StringUtils.capitalize(splitType.toLowerCase()))); + attributeType = tskCase.addArtifactAttributeType(attributeTypeName, + BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.STRING, + String.format("Phone Number (%s)", StringUtils.capitalize(splitType.toLowerCase()))); + } - ThunderbirdMboxFileIngestModule.addArtifactAttribute(telephone.getText(), attributeType, attributes); + ThunderbirdMboxFileIngestModule.addArtifactAttribute(telephoneText, attributeType, attributes); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, String.format("Unable to retrieve attribute type '%s' for file '%s' (id=%d).", attributeTypeName, abstractFile.getName(), abstractFile.getId()), ex); + logger.log(Level.WARNING, String.format("Unable to retrieve attribute type '%s' for file '%s' (id=%d).", attributeTypeName, abstractFile.getName(), abstractFile.getId()), ex); } catch (TskDataException ex) { - logger.log(Level.SEVERE, String.format("Unable to add custom attribute type '%s' for file '%s' (id=%d).", attributeTypeName, abstractFile.getName(), abstractFile.getId()), ex); + logger.log(Level.WARNING, String.format("Unable to add custom attribute type '%s' for file '%s' (id=%d).", attributeTypeName, abstractFile.getName(), abstractFile.getId()), ex); } } } @@ -490,7 +497,11 @@ final class VcardParser { private void addPhoneAccountInstances(Telephone telephone, AbstractFile abstractFile, Collection accountInstances) { String telephoneText = telephone.getText(); if (telephoneText == null || telephoneText.isEmpty()) { - return; + telephoneText = telephone.getUri().getNumber(); + if (telephoneText == null || telephoneText.isEmpty()) { + return; + } + } // Add phone number as a TSK_ACCOUNT.