Skip to content
Snippets Groups Projects
Commit 507ca6ff authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #964 from sleuthkit/release-4.5.0

Merge in release-4.5.0 branch
parents 9227073d 92ddd140
No related branches found
No related tags found
No related merge requests found
...@@ -213,18 +213,23 @@ public String getShortDescription() throws TskCoreException { ...@@ -213,18 +213,23 @@ public String getShortDescription() throws TskCoreException {
case TSK_MESSAGE: case TSK_MESSAGE:
case TSK_CALLLOG: case TSK_CALLLOG:
//get the first of these attributes which exists and is non null //get the first of these attributes which exists and is non null
if (((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_NAME))) != null) && !attr.getDisplayString().isEmpty()) { final ATTRIBUTE_TYPE[] typesThatCanHaveName = {ATTRIBUTE_TYPE.TSK_NAME,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER))) != null) { ATTRIBUTE_TYPE.TSK_PHONE_NUMBER,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM))) != null) { ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_FROM,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO))) != null) { ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_TO,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_HOME))) != null) { ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_HOME,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_MOBILE))) != null) { ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_MOBILE,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_OFFICE))) != null) { ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_OFFICE,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL))) != null) { ATTRIBUTE_TYPE.TSK_EMAIL,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_FROM))) != null) { ATTRIBUTE_TYPE.TSK_EMAIL_FROM,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_TO))) != null) { ATTRIBUTE_TYPE.TSK_EMAIL_TO,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_HOME))) != null) { ATTRIBUTE_TYPE.TSK_EMAIL_HOME,
} else if ((attr = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_EMAIL_OFFICE))) != null) { ATTRIBUTE_TYPE.TSK_EMAIL_OFFICE}; //in the order we want to use them
for (ATTRIBUTE_TYPE t : typesThatCanHaveName) {
attr = getAttribute(new BlackboardAttribute.Type(t));
if (attr != null && !attr.getDisplayString().isEmpty()) {
break;
}
} }
break; break;
default: default:
...@@ -235,20 +240,23 @@ public String getShortDescription() throws TskCoreException { ...@@ -235,20 +240,23 @@ public String getShortDescription() throws TskCoreException {
} else { } else {
shortDescription.append(getDisplayName()); shortDescription.append(getDisplayName());
} }
BlackboardAttribute date;
//get the first of these date attributes which exists and is non null //get the first of these date attributes which exists and is non null
if ((date = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME))) != null) { final ATTRIBUTE_TYPE[] typesThatCanHaveDate = {ATTRIBUTE_TYPE.TSK_DATETIME,
} else if ((date = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_SENT))) != null) { ATTRIBUTE_TYPE.TSK_DATETIME_SENT,
} else if ((date = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_RCVD))) != null) { ATTRIBUTE_TYPE.TSK_DATETIME_RCVD,
} else if ((date = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_CREATED))) != null) { ATTRIBUTE_TYPE.TSK_DATETIME_CREATED,
} else if ((date = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_MODIFIED))) != null) { ATTRIBUTE_TYPE.TSK_DATETIME_MODIFIED,
} else if ((date = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED))) != null) { ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED,
} else if ((date = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_START))) != null) { ATTRIBUTE_TYPE.TSK_DATETIME_START,
} else if ((date = getAttribute(new BlackboardAttribute.Type(ATTRIBUTE_TYPE.TSK_DATETIME_END))) != null) { ATTRIBUTE_TYPE.TSK_DATETIME_END}; //in the order we want to use them
} BlackboardAttribute date;
if (date != null) { for (ATTRIBUTE_TYPE t : typesThatCanHaveDate) {
shortDescription.append(" "); date = getAttribute(new BlackboardAttribute.Type(t));
shortDescription.append(MessageFormat.format(bundle.getString("BlackboardArtifact.shortDescriptionDate.text"), date.getDisplayString())); //NON-NLS if (date != null && !date.getDisplayString().isEmpty()) {
shortDescription.append(" ");
shortDescription.append(MessageFormat.format(bundle.getString("BlackboardArtifact.shortDescriptionDate.text"), date.getDisplayString())); //NON-NLS
break;
}
} }
return shortDescription.toString(); return shortDescription.toString();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment