Merge branch 'develop' of https://github.com/sleuthkit/autopsy into 3326-MultiUserCaseOffEDT

This commit is contained in:
William Schaefer 2017-12-15 14:20:53 -05:00
commit 58ba936d5b
5 changed files with 34 additions and 25 deletions

View File

@ -580,7 +580,9 @@ final class MultiUserCasesPanel extends javax.swing.JPanel {
int modelRow = casesTable.convertRowIndexToModel(casesTable.getSelectedRow()); int modelRow = casesTable.convertRowIndexToModel(casesTable.getSelectedRow());
String caseDirectory = (String) caseTableModel.getValueAt(modelRow, COLUMN_HEADERS.OUTPUTFOLDER.ordinal()); String caseDirectory = (String) caseTableModel.getValueAt(modelRow, COLUMN_HEADERS.OUTPUTFOLDER.ordinal());
Path caseMetadataFilePath = Paths.get(caseDirectory, (String) caseTableModel.getValueAt(modelRow, COLUMN_HEADERS.METADATA_FILE.ordinal())); Path caseMetadataFilePath = Paths.get(caseDirectory, (String) caseTableModel.getValueAt(modelRow, COLUMN_HEADERS.METADATA_FILE.ordinal()));
openCase(caseMetadataFilePath); new Thread(() -> {
openCase(caseMetadataFilePath);
}).start();
} }
}//GEN-LAST:event_casesTableMouseClicked }//GEN-LAST:event_casesTableMouseClicked

View File

@ -74,7 +74,7 @@ class AccountDetailsNode extends AbstractNode {
@Override @Override
protected Node createNodeForKey(Content t) { protected Node createNodeForKey(Content t) {
if (t instanceof BlackboardArtifact) { if (t instanceof BlackboardArtifact) {
return new RelationShipNode((BlackboardArtifact) t); return new RelationshipNode((BlackboardArtifact) t);
} else { } else {
throw new UnsupportedOperationException("Cannot create a RelationshipNode for non BlackboardArtifact content."); throw new UnsupportedOperationException("Cannot create a RelationshipNode for non BlackboardArtifact content.");
} }

View File

@ -31,13 +31,15 @@ class AccountDeviceInstanceKey {
private final AccountDeviceInstance accountDeviceInstance; private final AccountDeviceInstance accountDeviceInstance;
private final CommunicationsFilter filter; private final CommunicationsFilter filter;
private final long messageCount; private final long messageCount;
private final String dataSourceName;
AccountDeviceInstanceKey(AccountDeviceInstance accountDeviceInstance, CommunicationsFilter filter, long msgCount) { AccountDeviceInstanceKey(AccountDeviceInstance accountDeviceInstance, CommunicationsFilter filter, long msgCount, String dataSourceName) {
this.accountDeviceInstance = accountDeviceInstance; this.accountDeviceInstance = accountDeviceInstance;
this.filter = filter; this.filter = filter;
this.messageCount = msgCount; this.messageCount = msgCount;
this.dataSourceName = dataSourceName;
} }
AccountDeviceInstance getAccountDeviceInstance() { AccountDeviceInstance getAccountDeviceInstance() {
@ -48,7 +50,11 @@ class AccountDeviceInstanceKey {
return filter; return filter;
} }
long getMessageCount() { long getMessageCount() {
return messageCount; return messageCount;
} }
String getDataSourceName() {
return dataSourceName;
}
} }

View File

@ -56,9 +56,10 @@ class AccountsRootChildren extends ChildFactory<AccountDeviceInstanceKey> {
protected boolean createKeys(List<AccountDeviceInstanceKey> list) { protected boolean createKeys(List<AccountDeviceInstanceKey> list) {
List<AccountDeviceInstanceKey> accountDeviceInstanceKeys = new ArrayList<>(); List<AccountDeviceInstanceKey> accountDeviceInstanceKeys = new ArrayList<>();
try { try {
for (AccountDeviceInstance adi : commsManager.getAccountDeviceInstancesWithRelationships(commsFilter)) { for (AccountDeviceInstance accountDeviceInstance : commsManager.getAccountDeviceInstancesWithRelationships(commsFilter)) {
long communicationsCount = commsManager.getRelationshipSourcesCount(adi, commsFilter); long communicationsCount = commsManager.getRelationshipSourcesCount(accountDeviceInstance, commsFilter);
accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(adi, commsFilter, communicationsCount)); String dataSourceName = getDataSourceName(accountDeviceInstance);
accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(accountDeviceInstance, commsFilter, communicationsCount, dataSourceName));
}; };
} catch (TskCoreException tskCoreException) { } catch (TskCoreException tskCoreException) {
logger.log(Level.SEVERE, "Error getting filtered account device instances", tskCoreException); logger.log(Level.SEVERE, "Error getting filtered account device instances", tskCoreException);
@ -73,6 +74,20 @@ class AccountsRootChildren extends ChildFactory<AccountDeviceInstanceKey> {
return new AccountDeviceInstanceNode(key, commsManager); return new AccountDeviceInstanceNode(key, commsManager);
} }
private String getDataSourceName(AccountDeviceInstance accountDeviceInstance) {
try {
final SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase();
for (DataSource dataSource : sleuthkitCase.getDataSources()) {
if (dataSource.getDeviceId().equals(accountDeviceInstance.getDeviceId())) {
return sleuthkitCase.getContentById(dataSource.getId()).getName();
}
}
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Error getting datasource name, falling back on device ID.", ex);
}
return accountDeviceInstance.getDeviceId();
}
/** /**
* Node to represent an Account in the AccountsBrowser * Node to represent an Account in the AccountsBrowser
*/ */
@ -121,22 +136,8 @@ class AccountsRootChildren extends ChildFactory<AccountDeviceInstanceKey> {
properties.put(new NodeProperty<>("count", Bundle.AccountNode_messageCount(), "count", properties.put(new NodeProperty<>("count", Bundle.AccountNode_messageCount(), "count",
accountDeviceInstanceKey.getMessageCount())); // NON-NLS accountDeviceInstanceKey.getMessageCount())); // NON-NLS
properties.put(new NodeProperty<>("device", Bundle.AccountNode_device(), "device", properties.put(new NodeProperty<>("device", Bundle.AccountNode_device(), "device",
getDataSourceName())); // NON-NLS accountDeviceInstanceKey.getDataSourceName())); // NON-NLS
return s; return s;
} }
private String getDataSourceName() {
try {
final SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase();
for (DataSource dataSource : sleuthkitCase.getDataSources()) {
if (dataSource.getDeviceId().equals(getAccountDeviceInstance().getDeviceId())) {
return sleuthkitCase.getContentById(dataSource.getId()).getName();
}
}
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Error getting datasource name, falling back on device ID.", ex);
}
return getAccountDeviceInstance().getDeviceId();
}
} }
} }

View File

@ -43,11 +43,11 @@ import org.sleuthkit.datamodel.TskCoreException;
/** /**
* Node for a relationship, as represented by a BlackboardArtifact. * Node for a relationship, as represented by a BlackboardArtifact.
*/ */
public class RelationShipNode extends BlackboardArtifactNode { public class RelationshipNode extends BlackboardArtifactNode {
private static final Logger logger = Logger.getLogger(RelationShipNode.class.getName()); private static final Logger logger = Logger.getLogger(RelationshipNode.class.getName());
public RelationShipNode(BlackboardArtifact artifact) { public RelationshipNode(BlackboardArtifact artifact) {
super(artifact); super(artifact);
final String stripEnd = StringUtils.stripEnd(artifact.getDisplayName(), "s"); final String stripEnd = StringUtils.stripEnd(artifact.getDisplayName(), "s");
String removeEndIgnoreCase = StringUtils.removeEndIgnoreCase(stripEnd, "message"); String removeEndIgnoreCase = StringUtils.removeEndIgnoreCase(stripEnd, "message");