Add all artifacts to list at once in createKeys.

This commit is contained in:
Jeff Wallace 2013-10-30 10:45:30 -04:00
parent f47aac4056
commit f8fa119b81

View File

@ -173,6 +173,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
@Override
protected boolean createKeys(List<BlackboardArtifact> list) {
//flatten all emails
List<BlackboardArtifact> tempList = new ArrayList<>();
for (String account : accounts.keySet()) {
Map<String, List<Long>> folders = accounts.get(account);
for (String folder : folders.keySet()) {
@ -180,7 +181,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
for (long l : messages) {
try {
//TODO: bulk artifact gettings
list.add(skCase.getBlackboardArtifact(l));
tempList.add(skCase.getBlackboardArtifact(l));
} catch (TskException ex) {
logger.log(Level.WARNING, "Error creating mail messages nodes", ex);
}
@ -189,7 +190,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
}
list.addAll(tempList);
return true;
}
@ -383,14 +384,16 @@ public class EmailExtracted implements AutopsyVisitableItem {
@Override
protected boolean createKeys(List<BlackboardArtifact> list) {
List<BlackboardArtifact> tempList = new ArrayList<>();
for (long l : messages) {
try {
//TODO: bulk artifact gettings
list.add(skCase.getBlackboardArtifact(l));
tempList.add(skCase.getBlackboardArtifact(l));
} catch (TskException ex) {
logger.log(Level.WARNING, "Error creating mail messages nodes", ex);
}
}
list.addAll(tempList);
return true;
}