From 3120993c5448fe360d9ac56cec3f3aec79b49a3d Mon Sep 17 00:00:00 2001 From: Raman Date: Fri, 15 Dec 2017 10:57:03 -0500 Subject: [PATCH 1/4] 922: Put DataSource name in AccountDeviceInstanceKey --- .../AccountDeviceInstanceKey.java | 10 ++++-- .../communications/AccountsRootChildren.java | 33 ++++++++++--------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java index 92b6938ac0..fbc2c17feb 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceKey.java @@ -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; + } } diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java b/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java index 9b0b5081d2..fec972b463 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java @@ -58,7 +58,8 @@ class AccountsRootChildren extends ChildFactory { try { for (AccountDeviceInstance adi : commsManager.getAccountDeviceInstancesWithRelationships(commsFilter)) { long communicationsCount = commsManager.getRelationshipSourcesCount(adi, commsFilter); - accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(adi, commsFilter, communicationsCount)); + String dataSourceName = getDataSourceName(adi); + accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(adi, 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 { return new AccountDeviceInstanceNode(key, commsManager); } + private String getDataSourceName(AccountDeviceInstance adi) { + try { + final SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase(); + for (DataSource dataSource : sleuthkitCase.getDataSources()) { + if (dataSource.getDeviceId().equals(adi.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 adi.getDeviceId(); + } + /** * Node to represent an Account in the AccountsBrowser */ @@ -121,22 +136,8 @@ class AccountsRootChildren extends ChildFactory { 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(); - } } } From 0209d81d82d8002fd94c4c49106f10c32910f529 Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Fri, 15 Dec 2017 12:34:40 -0500 Subject: [PATCH 2/4] 3350 move call to openCase when double clicking off EDT --- .../org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.java index 018def8ad3..a9ea61a187 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/MultiUserCasesPanel.java @@ -593,7 +593,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 From e3a303618da5d8a85d20656964843df3b9f8f350 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Fri, 15 Dec 2017 13:16:32 -0500 Subject: [PATCH 3/4] Rename RelationShipNode to RelationshipNode --- .../autopsy/communications/AccountDetailsNode.java | 2 +- .../{RelationShipNode.java => RelationshipNode.java} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename Core/src/org/sleuthkit/autopsy/communications/{RelationShipNode.java => RelationshipNode.java} (97%) diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountDetailsNode.java b/Core/src/org/sleuthkit/autopsy/communications/AccountDetailsNode.java index 9d1e3b0361..88470e87e0 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountDetailsNode.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountDetailsNode.java @@ -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."); } diff --git a/Core/src/org/sleuthkit/autopsy/communications/RelationShipNode.java b/Core/src/org/sleuthkit/autopsy/communications/RelationshipNode.java similarity index 97% rename from Core/src/org/sleuthkit/autopsy/communications/RelationShipNode.java rename to Core/src/org/sleuthkit/autopsy/communications/RelationshipNode.java index 5c060a262e..73fa033240 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/RelationShipNode.java +++ b/Core/src/org/sleuthkit/autopsy/communications/RelationshipNode.java @@ -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"); From 94b156bbfd6c27996091237a4e09378fcd593fb4 Mon Sep 17 00:00:00 2001 From: Raman Date: Fri, 15 Dec 2017 13:52:23 -0500 Subject: [PATCH 4/4] 922: Put DataSource name in AccountDeviceInstanceKey - address review comments --- .../communications/AccountsRootChildren.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java b/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java index fec972b463..63e1e17d82 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountsRootChildren.java @@ -56,10 +56,10 @@ class AccountsRootChildren extends ChildFactory { protected boolean createKeys(List list) { List accountDeviceInstanceKeys = new ArrayList<>(); try { - for (AccountDeviceInstance adi : commsManager.getAccountDeviceInstancesWithRelationships(commsFilter)) { - long communicationsCount = commsManager.getRelationshipSourcesCount(adi, commsFilter); - String dataSourceName = getDataSourceName(adi); - accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(adi, commsFilter, communicationsCount, dataSourceName)); + 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); @@ -74,18 +74,18 @@ class AccountsRootChildren extends ChildFactory { return new AccountDeviceInstanceNode(key, commsManager); } - private String getDataSourceName(AccountDeviceInstance adi) { + private String getDataSourceName(AccountDeviceInstance accountDeviceInstance) { try { final SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase(); for (DataSource dataSource : sleuthkitCase.getDataSources()) { - if (dataSource.getDeviceId().equals(adi.getDeviceId())) { + 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 adi.getDeviceId(); + return accountDeviceInstance.getDeviceId(); } /**