mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
Merge branch 'develop' of https://github.com/sleuthkit/autopsy into 3326-MultiUserCaseOffEDT
This commit is contained in:
commit
58ba936d5b
@ -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()));
|
||||
new Thread(() -> {
|
||||
openCase(caseMetadataFilePath);
|
||||
}).start();
|
||||
}
|
||||
}//GEN-LAST:event_casesTableMouseClicked
|
||||
|
||||
|
@ -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.");
|
||||
}
|
||||
|
@ -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() {
|
||||
@ -51,4 +53,8 @@ class AccountDeviceInstanceKey {
|
||||
long getMessageCount() {
|
||||
return messageCount;
|
||||
}
|
||||
|
||||
String getDataSourceName() {
|
||||
return dataSourceName;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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");
|
Loading…
x
Reference in New Issue
Block a user