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());
String caseDirectory = (String) caseTableModel.getValueAt(modelRow, COLUMN_HEADERS.OUTPUTFOLDER.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

View File

@ -74,7 +74,7 @@ class AccountDetailsNode extends AbstractNode {
@Override
protected Node createNodeForKey(Content t) {
if (t instanceof BlackboardArtifact) {
return new RelationShipNode((BlackboardArtifact) t);
return new RelationshipNode((BlackboardArtifact) t);
} else {
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 CommunicationsFilter filter;
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.filter = filter;
this.messageCount = msgCount;
this.dataSourceName = dataSourceName;
}
AccountDeviceInstance getAccountDeviceInstance() {
@ -48,7 +50,11 @@ class AccountDeviceInstanceKey {
return filter;
}
long getMessageCount() {
long getMessageCount() {
return messageCount;
}
String getDataSourceName() {
return dataSourceName;
}
}

View File

@ -56,9 +56,10 @@ class AccountsRootChildren extends ChildFactory<AccountDeviceInstanceKey> {
protected boolean createKeys(List<AccountDeviceInstanceKey> list) {
List<AccountDeviceInstanceKey> accountDeviceInstanceKeys = new ArrayList<>();
try {
for (AccountDeviceInstance adi : commsManager.getAccountDeviceInstancesWithRelationships(commsFilter)) {
long communicationsCount = commsManager.getRelationshipSourcesCount(adi, commsFilter);
accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(adi, commsFilter, communicationsCount));
for (AccountDeviceInstance accountDeviceInstance : commsManager.getAccountDeviceInstancesWithRelationships(commsFilter)) {
long communicationsCount = commsManager.getRelationshipSourcesCount(accountDeviceInstance, commsFilter);
String dataSourceName = getDataSourceName(accountDeviceInstance);
accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(accountDeviceInstance, commsFilter, communicationsCount, dataSourceName));
};
} catch (TskCoreException 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);
}
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
*/
@ -121,22 +136,8 @@ class AccountsRootChildren extends ChildFactory<AccountDeviceInstanceKey> {
properties.put(new NodeProperty<>("count", Bundle.AccountNode_messageCount(), "count",
accountDeviceInstanceKey.getMessageCount())); // NON-NLS
properties.put(new NodeProperty<>("device", Bundle.AccountNode_device(), "device",
getDataSourceName())); // NON-NLS
accountDeviceInstanceKey.getDataSourceName())); // NON-NLS
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.
*/
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);
final String stripEnd = StringUtils.stripEnd(artifact.getDisplayName(), "s");
String removeEndIgnoreCase = StringUtils.removeEndIgnoreCase(stripEnd, "message");