mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
Importing dialog cancellation done
This commit is contained in:
parent
6694b05551
commit
d9b605af50
@ -489,7 +489,7 @@ final public class ImportCentralRepoDatabaseDialog extends javax.swing.JDialog {
|
|||||||
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
||||||
// Note that the error handlers in this method call return without disposing of the
|
// Note that the error handlers in this method call return without disposing of the
|
||||||
// dialog to allow the user to try again, if desired.
|
// dialog to allow the user to try again, if desired.
|
||||||
String selectedFilePath = tfFilePath.getText();
|
/*String selectedFilePath = tfFilePath.getText();
|
||||||
|
|
||||||
// have valid file path
|
// have valid file path
|
||||||
if (selectedFilePath.isEmpty()) {
|
if (selectedFilePath.isEmpty()) {
|
||||||
@ -517,7 +517,7 @@ final public class ImportCentralRepoDatabaseDialog extends javax.swing.JDialog {
|
|||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}*/
|
||||||
/*
|
/*
|
||||||
// create global set
|
// create global set
|
||||||
int globalSetID;
|
int globalSetID;
|
||||||
|
@ -242,7 +242,13 @@ ImportHashDatabaseDialog.tfDatabaseName.tooltip=Name for this database
|
|||||||
ImportHashDatabaseDialog.tfDatabaseVersion.tooltip.text=Database Version Number
|
ImportHashDatabaseDialog.tfDatabaseVersion.tooltip.text=Database Version Number
|
||||||
ImportHashDatabaseDialog.tfDatabaseName.tooltip=Name for this database
|
ImportHashDatabaseDialog.tfDatabaseName.tooltip=Name for this database
|
||||||
ImportHashDatabaseDialog.tfDatabaseVersion.tooltip.text=Database Version Number
|
ImportHashDatabaseDialog.tfDatabaseVersion.tooltip.text=Database Version Number
|
||||||
ImportCentralRepoDbProgressDialog.jButton1.text=jButton1
|
ImportCentralRepoDbProgressDialog.lbProgress.text=Starting import...
|
||||||
ImportCentralRepoDbProgressDialog.lbProgress.text=jLabel1
|
|
||||||
ImportCentralRepoDbProgressDialog.bnOk.text=OK
|
ImportCentralRepoDbProgressDialog.bnOk.text=OK
|
||||||
ImportCentralRepoDbProgressDialog.bnCancel.text=Cancel
|
ImportCentralRepoDbProgressDialog.bnCancel.text=Cancel
|
||||||
|
HashLookupSettingsPanel.versionLabel.text_1=Version:
|
||||||
|
HashLookupSettingsPanel.hashDbVersionLabel.text_1=No database selected
|
||||||
|
HashLookupSettingsPanel.orgLabel.text_1=Organization:
|
||||||
|
HashLookupSettingsPanel.hashDbOrgLabel.text_1=No database selected
|
||||||
|
HashLookupSettingsPanel.readOnlyLabel.text_1=Read only:
|
||||||
|
HashLookupSettingsPanel.hashDbReadOnlyLabel.text_1=No database selected
|
||||||
|
ImportCentralRepoDbProgressDialog.jLabel1.text=Importing hash set into the central repository
|
||||||
|
@ -329,7 +329,7 @@ public class HashDbManager implements PropertyChangeListener {
|
|||||||
return db;
|
return db;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
public CentralRepoHashDb importCentralRepoHashSet(String hashSetName, String version, int orgId,
|
public CentralRepoHashDb importCentralRepoHashSet(String hashSetName, String version, int orgId,
|
||||||
boolean searchDuringIngest, boolean sendIngestMessages, HashDb.KnownFilesType knownFilesType,
|
boolean searchDuringIngest, boolean sendIngestMessages, HashDb.KnownFilesType knownFilesType,
|
||||||
String importFile) throws TskCoreException {
|
String importFile) throws TskCoreException {
|
||||||
@ -415,7 +415,7 @@ public class HashDbManager implements PropertyChangeListener {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
throw new TskCoreException(ex.getLocalizedMessage());
|
throw new TskCoreException(ex.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
synchronized void indexHashDatabase(HashDb hashDb) {
|
synchronized void indexHashDatabase(HashDb hashDb) {
|
||||||
hashDb.addPropertyChangeListener(this);
|
hashDb.addPropertyChangeListener(this);
|
||||||
@ -703,7 +703,8 @@ public class HashDbManager implements PropertyChangeListener {
|
|||||||
allDatabasesLoadedCorrectly = false;
|
allDatabasesLoadedCorrectly = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
addExistingCentralRepoHashSet(hashDbInfo.getHashSetName(), hashDbInfo.getVersion(), hashDbInfo.getCentralRepoIndex(),
|
addExistingCentralRepoHashSet(hashDbInfo.getHashSetName(), hashDbInfo.getVersion(),
|
||||||
|
hashDbInfo.getCentralRepoIndex(),
|
||||||
hashDbInfo.getSearchDuringIngest(), hashDbInfo.getSendIngestMessages(), hashDbInfo.getKnownFilesType());
|
hashDbInfo.getSearchDuringIngest(), hashDbInfo.getSendIngestMessages(), hashDbInfo.getKnownFilesType());
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
@ -1168,6 +1169,7 @@ public class HashDbManager implements PropertyChangeListener {
|
|||||||
private final HashDb.KnownFilesType knownFilesType;
|
private final HashDb.KnownFilesType knownFilesType;
|
||||||
private final int centralRepoIndex;
|
private final int centralRepoIndex;
|
||||||
private final String version;
|
private final String version;
|
||||||
|
private final String orgName = "";
|
||||||
private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
|
private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
|
||||||
|
|
||||||
private CentralRepoHashDb(String hashSetName, String version, int centralRepoIndex,
|
private CentralRepoHashDb(String hashSetName, String version, int centralRepoIndex,
|
||||||
@ -1215,6 +1217,10 @@ public class HashDbManager implements PropertyChangeListener {
|
|||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOrgName(){
|
||||||
|
return "org name";
|
||||||
|
}
|
||||||
|
|
||||||
public int getCentralRepoIndex(){
|
public int getCentralRepoIndex(){
|
||||||
return centralRepoIndex;
|
return centralRepoIndex;
|
||||||
}
|
}
|
||||||
|
@ -307,6 +307,7 @@ final class HashLookupSettings implements Serializable {
|
|||||||
private final boolean sendIngestMessages;
|
private final boolean sendIngestMessages;
|
||||||
private final String path;
|
private final String path;
|
||||||
private final String version;
|
private final String version;
|
||||||
|
private final String orgName;
|
||||||
private final int centralRepoIndex;
|
private final int centralRepoIndex;
|
||||||
private DatabaseType dbType;
|
private DatabaseType dbType;
|
||||||
|
|
||||||
@ -328,12 +329,14 @@ final class HashLookupSettings implements Serializable {
|
|||||||
this.path = path;
|
this.path = path;
|
||||||
this.centralRepoIndex = -1;
|
this.centralRepoIndex = -1;
|
||||||
this.version = "";
|
this.version = "";
|
||||||
|
this.orgName = "";
|
||||||
this.dbType = DatabaseType.FILE;
|
this.dbType = DatabaseType.FILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashDbInfo(String hashSetName, String version, int centralRepoIndex, HashDbManager.HashDb.KnownFilesType knownFilesType, boolean searchDuringIngest, boolean sendIngestMessages){
|
HashDbInfo(String hashSetName, String version, String orgName, int centralRepoIndex, HashDbManager.HashDb.KnownFilesType knownFilesType, boolean searchDuringIngest, boolean sendIngestMessages){
|
||||||
this.hashSetName = hashSetName;
|
this.hashSetName = hashSetName;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
|
this.orgName = orgName;
|
||||||
this.centralRepoIndex = centralRepoIndex;
|
this.centralRepoIndex = centralRepoIndex;
|
||||||
this.knownFilesType = knownFilesType;
|
this.knownFilesType = knownFilesType;
|
||||||
this.searchDuringIngest = searchDuringIngest;
|
this.searchDuringIngest = searchDuringIngest;
|
||||||
@ -351,6 +354,7 @@ final class HashLookupSettings implements Serializable {
|
|||||||
this.sendIngestMessages = fileTypeDb.getSendIngestMessages();
|
this.sendIngestMessages = fileTypeDb.getSendIngestMessages();
|
||||||
this.centralRepoIndex = -1;
|
this.centralRepoIndex = -1;
|
||||||
this.version = "";
|
this.version = "";
|
||||||
|
this.orgName = "";
|
||||||
this.dbType = DatabaseType.FILE;
|
this.dbType = DatabaseType.FILE;
|
||||||
if (fileTypeDb.hasIndexOnly()) {
|
if (fileTypeDb.hasIndexOnly()) {
|
||||||
this.path = fileTypeDb.getIndexPath();
|
this.path = fileTypeDb.getIndexPath();
|
||||||
@ -361,6 +365,7 @@ final class HashLookupSettings implements Serializable {
|
|||||||
HashDbManager.CentralRepoHashDb centralRepoDb = (HashDbManager.CentralRepoHashDb)db;
|
HashDbManager.CentralRepoHashDb centralRepoDb = (HashDbManager.CentralRepoHashDb)db;
|
||||||
this.hashSetName = centralRepoDb.getHashSetName();
|
this.hashSetName = centralRepoDb.getHashSetName();
|
||||||
this.version = centralRepoDb.getVersion();
|
this.version = centralRepoDb.getVersion();
|
||||||
|
this.orgName = centralRepoDb.getOrgName();
|
||||||
this.knownFilesType = centralRepoDb.getKnownFilesType();
|
this.knownFilesType = centralRepoDb.getKnownFilesType();
|
||||||
this.searchDuringIngest = centralRepoDb.getSearchDuringIngest();
|
this.searchDuringIngest = centralRepoDb.getSearchDuringIngest();
|
||||||
this.sendIngestMessages = centralRepoDb.getSendIngestMessages();
|
this.sendIngestMessages = centralRepoDb.getSendIngestMessages();
|
||||||
@ -388,6 +393,14 @@ final class HashLookupSettings implements Serializable {
|
|||||||
String getVersion(){
|
String getVersion(){
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the organization name for the hash set
|
||||||
|
* @return org name
|
||||||
|
*/
|
||||||
|
String getOrgName(){
|
||||||
|
return orgName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the known files type setting.
|
* Gets the known files type setting.
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace min="1" pref="1" max="-2" attributes="0"/>
|
<EmptySpace min="1" pref="1" max="-2" attributes="0"/>
|
||||||
<Component id="jScrollPane1" min="-2" pref="395" max="-2" attributes="0"/>
|
<Component id="jScrollPane1" min="-2" pref="395" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="informationLabel" max="32767" attributes="0"/>
|
<Component id="informationLabel" max="32767" attributes="0"/>
|
||||||
@ -102,29 +102,24 @@
|
|||||||
</Group>
|
</Group>
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
|
||||||
<Component id="optionsLabel" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Component id="optionsSeparator" min="-2" pref="334" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="locationLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="locationLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="indexButton" alignment="0" min="-2" pref="120" max="-2" attributes="0"/>
|
|
||||||
<Component id="typeLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="typeLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="indexLabel" alignment="0" min="-2" pref="66" max="-2" attributes="0"/>
|
<Component id="versionLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="indexPathLabelLabel" min="-2" max="-2" attributes="0"/>
|
<Component id="orgLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="readOnlyLabel" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="55" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="hashDbTypeLabel" min="-2" pref="225" max="-2" attributes="0"/>
|
<Component id="hashDbTypeLabel" min="-2" pref="225" max="-2" attributes="0"/>
|
||||||
<Component id="hashDbLocationLabel" alignment="0" min="-2" pref="225" max="-2" attributes="0"/>
|
<Component id="hashDbLocationLabel" alignment="0" min="-2" pref="225" max="-2" attributes="0"/>
|
||||||
<Component id="indexPathLabel" min="-2" pref="225" max="-2" attributes="0"/>
|
<Component id="hashDbVersionLabel" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="hashDbIndexStatusLabel" alignment="0" min="-2" pref="225" max="-2" attributes="0"/>
|
<Component id="hashDbOrgLabel" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="addHashesToDatabaseButton" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="hashDbReadOnlyLabel" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
@ -132,25 +127,48 @@
|
|||||||
<EmptySpace min="-2" pref="53" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="53" max="-2" attributes="0"/>
|
||||||
<Component id="hashDbNameLabel" min="-2" max="-2" attributes="0"/>
|
<Component id="hashDbNameLabel" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="indexLabel" alignment="0" min="-2" pref="66" max="-2" attributes="0"/>
|
||||||
|
<Component id="indexPathLabelLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="64" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Component id="indexPathLabel" min="-2" pref="225" max="-2" attributes="0"/>
|
||||||
|
<Component id="hashDbIndexStatusLabel" min="-2" pref="225" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="indexButton" min="-2" pref="120" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||||
|
<Component id="addHashesToDatabaseButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace min="-2" pref="70" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="70" max="-2" attributes="0"/>
|
||||||
<Component id="informationSeparator" min="-2" pref="305" max="-2" attributes="0"/>
|
<Component id="informationSeparator" min="-2" pref="305" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<Component id="sendIngestMessagesCheckBox" min="-2" max="-2" attributes="0"/>
|
<Component id="optionsLabel" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Component id="optionsSeparator" min="-2" pref="334" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
|
</Group>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
|
||||||
<Component id="jButton1" min="-2" pref="148" max="-2" attributes="0"/>
|
<Component id="sendIngestMessagesCheckBox" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="ingestWarningLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jButton1" min="-2" pref="148" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
|
<EmptySpace min="50" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@ -202,6 +220,21 @@
|
|||||||
<Component id="hashDbLocationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="hashDbLocationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="versionLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="hashDbVersionLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="orgLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="hashDbOrgLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="7" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="readOnlyLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="hashDbReadOnlyLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="indexPathLabelLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="indexPathLabelLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="indexPathLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="indexPathLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
@ -211,12 +244,12 @@
|
|||||||
<Component id="indexLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="indexLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="hashDbIndexStatusLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="hashDbIndexStatusLabel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="indexButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="indexButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="addHashesToDatabaseButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="addHashesToDatabaseButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="optionsLabel" min="-2" max="-2" attributes="0"/>
|
<Component id="optionsLabel" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="optionsSeparator" alignment="1" min="-2" max="-2" attributes="0"/>
|
<Component id="optionsSeparator" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
@ -597,6 +630,48 @@
|
|||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="versionLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashLookupSettingsPanel.versionLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="hashDbVersionLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashLookupSettingsPanel.hashDbVersionLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="orgLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashLookupSettingsPanel.orgLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="hashDbOrgLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashLookupSettingsPanel.hashDbOrgLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="readOnlyLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashLookupSettingsPanel.readOnlyLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="hashDbReadOnlyLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="HashLookupSettingsPanel.hashDbReadOnlyLabel.text_1" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
|
@ -27,6 +27,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JTable;
|
import javax.swing.JTable;
|
||||||
import javax.swing.ListSelectionModel;
|
import javax.swing.ListSelectionModel;
|
||||||
@ -45,6 +46,7 @@ import org.sleuthkit.autopsy.events.AutopsyEvent;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
|
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
||||||
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.CentralRepoHashDb;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb.KnownFilesType;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb.KnownFilesType;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDatabase;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDatabase;
|
||||||
@ -120,7 +122,11 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
hashDbNameLabel.setText(NO_SELECTION_TEXT);
|
hashDbNameLabel.setText(NO_SELECTION_TEXT);
|
||||||
hashDbTypeLabel.setText(NO_SELECTION_TEXT);
|
hashDbTypeLabel.setText(NO_SELECTION_TEXT);
|
||||||
hashDbLocationLabel.setText(NO_SELECTION_TEXT);
|
hashDbLocationLabel.setText(NO_SELECTION_TEXT);
|
||||||
|
hashDbVersionLabel.setText(NO_SELECTION_TEXT);
|
||||||
|
hashDbOrgLabel.setText(NO_SELECTION_TEXT);
|
||||||
|
hashDbReadOnlyLabel.setText(NO_SELECTION_TEXT);
|
||||||
indexPathLabel.setText(NO_SELECTION_TEXT);
|
indexPathLabel.setText(NO_SELECTION_TEXT);
|
||||||
|
|
||||||
|
|
||||||
// Update indexing components.
|
// Update indexing components.
|
||||||
hashDbIndexStatusLabel.setText(NO_SELECTION_TEXT);
|
hashDbIndexStatusLabel.setText(NO_SELECTION_TEXT);
|
||||||
@ -144,18 +150,26 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
ingestWarningLabel.setVisible(ingestIsRunning);
|
ingestWarningLabel.setVisible(ingestIsRunning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NbBundle.Messages({"HashLookupSettingsPanel.readOnly=Read only",
|
||||||
|
"HashLookupSettingsPanel.editable=Editable",
|
||||||
|
"HashLookupSettingsPanel.updateStatusError=Error reading status",
|
||||||
|
"HashLookupSettingsPanel.notApplicable=N/A",
|
||||||
|
"HashLookupSettingsPanel.centralRepo=Central Repository"
|
||||||
|
})
|
||||||
private void updateComponentsForSelection(HashDatabase db) {
|
private void updateComponentsForSelection(HashDatabase db) {
|
||||||
boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning();
|
boolean ingestIsRunning = IngestManager.getInstance().isIngestRunning();
|
||||||
|
|
||||||
// Update descriptive labels.
|
// Update descriptive labels.
|
||||||
hashDbNameLabel.setText(db.getHashSetName());
|
hashDbNameLabel.setText(db.getHashSetName());
|
||||||
hashDbTypeLabel.setText(db.getKnownFilesType().getDisplayName());
|
hashDbTypeLabel.setText(db.getKnownFilesType().getDisplayName());
|
||||||
|
try{
|
||||||
try {
|
if(db.isUpdateable()){
|
||||||
hashDbLocationLabel.setText(shortenPath(db.getDatabasePath()));
|
hashDbReadOnlyLabel.setText(Bundle.HashLookupSettingsPanel_editable());
|
||||||
} catch (TskCoreException ex) {
|
} else {
|
||||||
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting database path of " + db.getHashSetName() + " hash database", ex); //NON-NLS
|
hashDbReadOnlyLabel.setText(Bundle.HashLookupSettingsPanel_readOnly());
|
||||||
hashDbLocationLabel.setText(ERROR_GETTING_PATH_TEXT);
|
}
|
||||||
|
} catch (TskCoreException ex){
|
||||||
|
hashDbReadOnlyLabel.setText(Bundle.HashLookupSettingsPanel_updateStatusError());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -167,6 +181,21 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
|
|
||||||
if(db instanceof HashDb){
|
if(db instanceof HashDb){
|
||||||
HashDb hashDb = (HashDb)db;
|
HashDb hashDb = (HashDb)db;
|
||||||
|
|
||||||
|
// Disable the central repo fields
|
||||||
|
hashDbVersionLabel.setText(Bundle.HashLookupSettingsPanel_notApplicable());
|
||||||
|
hashDbOrgLabel.setText(Bundle.HashLookupSettingsPanel_notApplicable());
|
||||||
|
|
||||||
|
// Enable the delete button if ingest is not running
|
||||||
|
deleteDatabaseButton.setEnabled(!ingestIsRunning);
|
||||||
|
|
||||||
|
try {
|
||||||
|
hashDbLocationLabel.setText(shortenPath(db.getDatabasePath()));
|
||||||
|
} catch (TskCoreException ex) {
|
||||||
|
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting database path of " + db.getHashSetName() + " hash database", ex); //NON-NLS
|
||||||
|
hashDbLocationLabel.setText(ERROR_GETTING_PATH_TEXT);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
indexPathLabel.setText(shortenPath(hashDb.getIndexPath()));
|
indexPathLabel.setText(shortenPath(hashDb.getIndexPath()));
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
@ -214,6 +243,19 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
indexButton.setText(NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexButtonText.index"));
|
indexButton.setText(NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexButtonText.index"));
|
||||||
indexButton.setEnabled(false);
|
indexButton.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// Disable the file type fields/buttons
|
||||||
|
indexPathLabel.setText(Bundle.HashLookupSettingsPanel_notApplicable());
|
||||||
|
hashDbIndexStatusLabel.setText(Bundle.HashLookupSettingsPanel_notApplicable());
|
||||||
|
hashDbLocationLabel.setText(Bundle.HashLookupSettingsPanel_centralRepo());
|
||||||
|
indexButton.setEnabled(false);
|
||||||
|
deleteDatabaseButton.setEnabled(false);
|
||||||
|
|
||||||
|
CentralRepoHashDb crDb = (CentralRepoHashDb)db;
|
||||||
|
|
||||||
|
hashDbVersionLabel.setText(crDb.getVersion());
|
||||||
|
hashDbOrgLabel.setText(crDb.getOrgName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable the indexing button if ingest is in progress.
|
// Disable the indexing button if ingest is in progress.
|
||||||
@ -230,7 +272,6 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
// Update database action buttons.
|
// Update database action buttons.
|
||||||
createDatabaseButton.setEnabled(true);
|
createDatabaseButton.setEnabled(true);
|
||||||
importDatabaseButton.setEnabled(true);
|
importDatabaseButton.setEnabled(true);
|
||||||
deleteDatabaseButton.setEnabled(!ingestIsRunning);
|
|
||||||
|
|
||||||
// Update ingest in progress warning label.
|
// Update ingest in progress warning label.
|
||||||
ingestWarningLabel.setVisible(ingestIsRunning);
|
ingestWarningLabel.setVisible(ingestIsRunning);
|
||||||
@ -380,7 +421,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
// Give the user a visual indication of any hash sets with a hash
|
// Give the user a visual indication of any hash sets with a hash
|
||||||
// database that needs to be indexed by displaying the hash set name
|
// database that needs to be indexed by displaying the hash set name
|
||||||
// in red.
|
// in red.
|
||||||
if (hashSetTableModel.indexExists(row)) {
|
if (hashSetTableModel.isValid(row)) {
|
||||||
cellRenderer.setForeground(Color.black);
|
cellRenderer.setForeground(Color.black);
|
||||||
} else {
|
} else {
|
||||||
cellRenderer.setForeground(Color.red);
|
cellRenderer.setForeground(Color.red);
|
||||||
@ -437,12 +478,9 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
return hashSets.get(rowIndex).getHashSetName();
|
return hashSets.get(rowIndex).getHashSetName();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean indexExists(int rowIndex) {
|
private boolean isValid(int rowIndex) {
|
||||||
try {
|
try {
|
||||||
if(hashSets.get(rowIndex) instanceof HashDb){
|
return hashSets.get(rowIndex).isValid();
|
||||||
return ((HashDb)(hashSets.get(rowIndex))).hasIndex();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(HashSetTableModel.class.getName()).log(Level.SEVERE, "Error getting index info for hash database", ex); //NON-NLS
|
Logger.getLogger(HashSetTableModel.class.getName()).log(Level.SEVERE, "Error getting index info for hash database", ex); //NON-NLS
|
||||||
return false;
|
return false;
|
||||||
@ -541,6 +579,12 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
indexPathLabel = new javax.swing.JLabel();
|
indexPathLabel = new javax.swing.JLabel();
|
||||||
addHashesToDatabaseButton = new javax.swing.JButton();
|
addHashesToDatabaseButton = new javax.swing.JButton();
|
||||||
jButton1 = new javax.swing.JButton();
|
jButton1 = new javax.swing.JButton();
|
||||||
|
versionLabel = new javax.swing.JLabel();
|
||||||
|
hashDbVersionLabel = new javax.swing.JLabel();
|
||||||
|
orgLabel = new javax.swing.JLabel();
|
||||||
|
hashDbOrgLabel = new javax.swing.JLabel();
|
||||||
|
readOnlyLabel = new javax.swing.JLabel();
|
||||||
|
hashDbReadOnlyLabel = new javax.swing.JLabel();
|
||||||
|
|
||||||
jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
|
jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jLabel2.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jLabel2.text")); // NOI18N
|
||||||
@ -686,6 +730,18 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(versionLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.versionLabel.text_1")); // NOI18N
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(hashDbVersionLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbVersionLabel.text_1")); // NOI18N
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(orgLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.orgLabel.text_1")); // NOI18N
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(hashDbOrgLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbOrgLabel.text_1")); // NOI18N
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(readOnlyLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.readOnlyLabel.text_1")); // NOI18N
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(hashDbReadOnlyLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.hashDbReadOnlyLabel.text_1")); // NOI18N
|
||||||
|
|
||||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||||
jPanel1.setLayout(jPanel1Layout);
|
jPanel1.setLayout(jPanel1Layout);
|
||||||
jPanel1Layout.setHorizontalGroup(
|
jPanel1Layout.setHorizontalGroup(
|
||||||
@ -703,43 +759,56 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
.addGap(309, 309, 309))
|
.addGap(309, 309, 309))
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
|
||||||
.addComponent(optionsLabel)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
||||||
.addComponent(optionsSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 334, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
.addGap(10, 10, 10)
|
.addGap(10, 10, 10)
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(locationLabel)
|
.addComponent(locationLabel)
|
||||||
.addComponent(indexButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addComponent(typeLabel)
|
.addComponent(typeLabel)
|
||||||
.addComponent(indexLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(versionLabel)
|
||||||
.addComponent(indexPathLabelLabel))
|
.addComponent(orgLabel)
|
||||||
.addGap(10, 10, 10)
|
.addComponent(readOnlyLabel))
|
||||||
|
.addGap(55, 55, 55)
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(hashDbTypeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(hashDbTypeLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(hashDbLocationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(hashDbLocationLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(indexPathLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(hashDbVersionLabel)
|
||||||
.addComponent(hashDbIndexStatusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(hashDbOrgLabel)
|
||||||
.addComponent(addHashesToDatabaseButton)))
|
.addComponent(hashDbReadOnlyLabel)))
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
.addComponent(nameLabel)
|
.addComponent(nameLabel)
|
||||||
.addGap(53, 53, 53)
|
.addGap(53, 53, 53)
|
||||||
.addComponent(hashDbNameLabel))))
|
.addComponent(hashDbNameLabel))
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(indexLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(indexPathLabelLabel))
|
||||||
|
.addGap(64, 64, 64)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addComponent(indexPathLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addComponent(hashDbIndexStatusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addComponent(indexButton, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addGap(10, 10, 10)
|
||||||
|
.addComponent(addHashesToDatabaseButton))))
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
.addGap(70, 70, 70)
|
.addGap(70, 70, 70)
|
||||||
.addComponent(informationSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(informationSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGap(25, 25, 25)
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||||
.addComponent(sendIngestMessagesCheckBox))
|
.addComponent(optionsLabel)
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGap(10, 10, 10)
|
.addComponent(optionsSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 334, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
.addComponent(ingestWarningLabel)
|
.addGap(25, 25, 25)
|
||||||
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
.addComponent(sendIngestMessagesCheckBox))
|
||||||
.addGap(50, 50, 50))))
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addGap(10, 10, 10)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(ingestWarningLabel)
|
||||||
|
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)))))
|
||||||
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(hashDatabasesLabel)
|
.addComponent(hashDatabasesLabel)
|
||||||
@ -777,6 +846,18 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
.addComponent(locationLabel)
|
.addComponent(locationLabel)
|
||||||
.addComponent(hashDbLocationLabel))
|
.addComponent(hashDbLocationLabel))
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(versionLabel)
|
||||||
|
.addComponent(hashDbVersionLabel))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(orgLabel)
|
||||||
|
.addComponent(hashDbOrgLabel))
|
||||||
|
.addGap(7, 7, 7)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(readOnlyLabel)
|
||||||
|
.addComponent(hashDbReadOnlyLabel))
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(indexPathLabelLabel)
|
.addComponent(indexPathLabelLabel)
|
||||||
.addComponent(indexPathLabel))
|
.addComponent(indexPathLabel))
|
||||||
@ -784,11 +865,11 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(indexLabel)
|
.addComponent(indexLabel)
|
||||||
.addComponent(hashDbIndexStatusLabel))
|
.addComponent(hashDbIndexStatusLabel))
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(indexButton)
|
.addComponent(indexButton)
|
||||||
.addComponent(addHashesToDatabaseButton))
|
.addComponent(addHashesToDatabaseButton))
|
||||||
.addGap(18, 18, 18)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(optionsLabel)
|
.addComponent(optionsLabel)
|
||||||
.addComponent(optionsSeparator, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(optionsSeparator, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
@ -946,7 +1027,10 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
private javax.swing.JLabel hashDbIndexStatusLabel;
|
private javax.swing.JLabel hashDbIndexStatusLabel;
|
||||||
private javax.swing.JLabel hashDbLocationLabel;
|
private javax.swing.JLabel hashDbLocationLabel;
|
||||||
private javax.swing.JLabel hashDbNameLabel;
|
private javax.swing.JLabel hashDbNameLabel;
|
||||||
|
private javax.swing.JLabel hashDbOrgLabel;
|
||||||
|
private javax.swing.JLabel hashDbReadOnlyLabel;
|
||||||
private javax.swing.JLabel hashDbTypeLabel;
|
private javax.swing.JLabel hashDbTypeLabel;
|
||||||
|
private javax.swing.JLabel hashDbVersionLabel;
|
||||||
private javax.swing.JTable hashSetTable;
|
private javax.swing.JTable hashSetTable;
|
||||||
private javax.swing.JButton importDatabaseButton;
|
private javax.swing.JButton importDatabaseButton;
|
||||||
private javax.swing.JButton indexButton;
|
private javax.swing.JButton indexButton;
|
||||||
@ -968,7 +1052,10 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
|
|||||||
private javax.swing.JLabel nameLabel;
|
private javax.swing.JLabel nameLabel;
|
||||||
private javax.swing.JLabel optionsLabel;
|
private javax.swing.JLabel optionsLabel;
|
||||||
private javax.swing.JSeparator optionsSeparator;
|
private javax.swing.JSeparator optionsSeparator;
|
||||||
|
private javax.swing.JLabel orgLabel;
|
||||||
|
private javax.swing.JLabel readOnlyLabel;
|
||||||
private javax.swing.JCheckBox sendIngestMessagesCheckBox;
|
private javax.swing.JCheckBox sendIngestMessagesCheckBox;
|
||||||
private javax.swing.JLabel typeLabel;
|
private javax.swing.JLabel typeLabel;
|
||||||
|
private javax.swing.JLabel versionLabel;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -24,49 +24,45 @@
|
|||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Component id="progressBar" max="32767" attributes="0"/>
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="progressBar" min="-2" pref="346" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace pref="27" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<Component id="lbProgress" min="-2" max="-2" attributes="0"/>
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="bnOk" min="-2" max="-2" attributes="0"/>
|
<Component id="lbProgress" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
</Group>
|
||||||
<Component id="bnCancel" min="-2" max="-2" attributes="0"/>
|
<EmptySpace min="0" pref="172" max="32767" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Component id="bnOk" min="-2" pref="65" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="bnCancel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="102" attributes="0">
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="112" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
<Component id="progressBar" min="-2" max="-2" attributes="0"/>
|
<Component id="lbProgress" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="lbProgress" min="-2" max="-2" attributes="0"/>
|
<Component id="progressBar" min="-2" pref="24" max="-2" attributes="0"/>
|
||||||
<EmptySpace pref="89" max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Component id="bnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<Component id="bnOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
|
||||||
<Component id="bnOk" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="bnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace min="-2" pref="72" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="42" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@ -81,16 +77,6 @@
|
|||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="jButton1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
|
||||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="ImportCentralRepoDbProgressDialog.jButton1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="bnOk">
|
<Component class="javax.swing.JButton" name="bnOk">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
@ -111,5 +97,12 @@
|
|||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnCancelActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnCancelActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/modules/hashdatabase/Bundle.properties" key="ImportCentralRepoDbProgressDialog.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -33,12 +33,16 @@ import java.util.logging.Level;
|
|||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JProgressBar;
|
import javax.swing.JProgressBar;
|
||||||
import javax.swing.SwingWorker;
|
import javax.swing.SwingWorker;
|
||||||
|
import javax.swing.WindowConstants;
|
||||||
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttribute;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttribute;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.EamGlobalFileInstance;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamGlobalFileInstance;
|
||||||
|
import org.sleuthkit.autopsy.centralrepository.datamodel.EamOrganization;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
@ -49,9 +53,7 @@ import org.sleuthkit.datamodel.TskData;
|
|||||||
*/
|
*/
|
||||||
class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements PropertyChangeListener{
|
class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements PropertyChangeListener{
|
||||||
|
|
||||||
|
private CentralRepoImportWorker worker;
|
||||||
long totalHashes;
|
|
||||||
private SwingWorker<Void, Void> worker;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,8 +72,14 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
super((JFrame) WindowManager.getDefault().getMainWindow(),
|
super((JFrame) WindowManager.getDefault().getMainWindow(),
|
||||||
Bundle.ImportCentralRepoDbProgressDialog_title_text(),
|
Bundle.ImportCentralRepoDbProgressDialog_title_text(),
|
||||||
true);
|
true);
|
||||||
|
|
||||||
initComponents();
|
initComponents();
|
||||||
|
customizeComponents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void customizeComponents(){
|
||||||
|
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||||
|
bnOk.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void importFile(String hashSetName, String version, int orgId,
|
void importFile(String hashSetName, String version, int orgId,
|
||||||
@ -81,8 +89,7 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
|
|
||||||
File importFile = new File(importFileName);
|
File importFile = new File(importFileName);
|
||||||
worker = new ImportIDXWorker(hashSetName, version, orgId, searchDuringIngest, sendIngestMessages,
|
worker = new ImportIDXWorker(hashSetName, version, orgId, searchDuringIngest, sendIngestMessages,
|
||||||
knownFilesType, importFile, totalHashes);
|
knownFilesType, importFile);
|
||||||
totalHashes = ((ImportIDXWorker)worker).getEstimatedTotalHashes();
|
|
||||||
worker.addPropertyChangeListener(this);
|
worker.addPropertyChangeListener(this);
|
||||||
worker.execute();
|
worker.execute();
|
||||||
|
|
||||||
@ -91,16 +98,16 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
this.setVisible(true);
|
this.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NbBundle.Messages({"ImportCentralRepoDbProgressDialog.linesProcessed= lines processed"})
|
||||||
@Override
|
@Override
|
||||||
public void propertyChange(PropertyChangeEvent evt) {
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
System.out.println("### Evt type: " + evt.getPropertyName());
|
System.out.println("### Evt type: " + evt.getPropertyName());
|
||||||
System.out.println(" newValue: " + evt.getNewValue().toString());
|
System.out.println(" newValue: " + evt.getNewValue().toString());
|
||||||
System.out.println("### Setting progress to " + worker.getProgress());
|
System.out.println("### Setting progress to " + worker.getProgressPercentage());
|
||||||
|
|
||||||
if("progress".equals(evt.getPropertyName())){
|
if("progress".equals(evt.getPropertyName())){
|
||||||
progressBar.setValue(worker.getProgress());
|
progressBar.setValue(worker.getProgressPercentage());
|
||||||
String mes = "Count: " + worker.getProgress();
|
lbProgress.setText(getProgressString());
|
||||||
lbProgress.setText(mes);
|
|
||||||
} else if ("state".equals(evt.getPropertyName())
|
} else if ("state".equals(evt.getPropertyName())
|
||||||
&& (SwingWorker.StateValue.DONE.equals(evt.getNewValue()))) {
|
&& (SwingWorker.StateValue.DONE.equals(evt.getNewValue()))) {
|
||||||
// Disable cancel and enable ok
|
// Disable cancel and enable ok
|
||||||
@ -108,12 +115,24 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
bnOk.setEnabled(true);
|
bnOk.setEnabled(true);
|
||||||
|
|
||||||
progressBar.setValue(progressBar.getMaximum());
|
progressBar.setValue(progressBar.getMaximum());
|
||||||
String mes = "Count: " + worker.getProgress();
|
lbProgress.setText(getProgressString());
|
||||||
lbProgress.setText(mes);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ImportIDXWorker extends SwingWorker<Void, Void>{
|
private String getProgressString(){
|
||||||
|
return worker.getLinesProcessed() + Bundle.ImportCentralRepoDbProgressDialog_linesProcessed();
|
||||||
|
}
|
||||||
|
|
||||||
|
private interface CentralRepoImportWorker{
|
||||||
|
|
||||||
|
void execute();
|
||||||
|
boolean cancel(boolean mayInterruptIfRunning);
|
||||||
|
void addPropertyChangeListener(PropertyChangeListener dialog);
|
||||||
|
int getProgressPercentage();
|
||||||
|
long getLinesProcessed();
|
||||||
|
}
|
||||||
|
|
||||||
|
class ImportIDXWorker extends SwingWorker<Void,Void> implements CentralRepoImportWorker{
|
||||||
|
|
||||||
private final int HASH_IMPORT_THRESHOLD = 10000;
|
private final int HASH_IMPORT_THRESHOLD = 10000;
|
||||||
private final String hashSetName;
|
private final String hashSetName;
|
||||||
@ -125,10 +144,11 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
private final File importFile;
|
private final File importFile;
|
||||||
private final long totalLines;
|
private final long totalLines;
|
||||||
private int crIndex = -1;
|
private int crIndex = -1;
|
||||||
|
private AtomicLong numLines = new AtomicLong();
|
||||||
|
|
||||||
ImportIDXWorker(String hashSetName, String version, int orgId,
|
ImportIDXWorker(String hashSetName, String version, int orgId,
|
||||||
boolean searchDuringIngest, boolean sendIngestMessages, HashDbManager.HashDb.KnownFilesType knownFilesType,
|
boolean searchDuringIngest, boolean sendIngestMessages, HashDbManager.HashDb.KnownFilesType knownFilesType,
|
||||||
File importFile, long totalLines){
|
File importFile){
|
||||||
|
|
||||||
this.hashSetName = hashSetName;
|
this.hashSetName = hashSetName;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
@ -137,7 +157,9 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
this.sendIngestMessages = sendIngestMessages;
|
this.sendIngestMessages = sendIngestMessages;
|
||||||
this.knownFilesType = knownFilesType;
|
this.knownFilesType = knownFilesType;
|
||||||
this.importFile = importFile;
|
this.importFile = importFile;
|
||||||
this.totalLines = totalLines;
|
this.numLines.set(0);
|
||||||
|
|
||||||
|
this.totalLines = getEstimatedTotalHashes();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -146,11 +168,31 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
* progress bar.
|
* progress bar.
|
||||||
* @return Approximate number of hashes in the file
|
* @return Approximate number of hashes in the file
|
||||||
*/
|
*/
|
||||||
long getEstimatedTotalHashes(){
|
final long getEstimatedTotalHashes(){
|
||||||
long fileSize = importFile.length();
|
long fileSize = importFile.length();
|
||||||
return (fileSize / 0x33); // IDX file lines are generally 0x33 bytes long
|
return (fileSize / 0x33); // IDX file lines are generally 0x33 bytes long
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getLinesProcessed(){
|
||||||
|
return numLines.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getProgressPercentage(){
|
||||||
|
return this.getProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
//@Override
|
||||||
|
//public void addPropertyChangeListener(PropertyChangeListener dialog){
|
||||||
|
// super.addPropertyChangeListener(dialog);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//@Override
|
||||||
|
//public void run(){
|
||||||
|
// this.execute();
|
||||||
|
//}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Void doInBackground() throws Exception {
|
protected Void doInBackground() throws Exception {
|
||||||
|
|
||||||
@ -176,8 +218,10 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
String line;
|
String line;
|
||||||
Set<EamGlobalFileInstance> globalInstances = new HashSet<>();
|
Set<EamGlobalFileInstance> globalInstances = new HashSet<>();
|
||||||
|
|
||||||
long numLines = 0;
|
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
|
if(isCancelled()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
String[] parts = line.split("\\|");
|
String[] parts = line.split("\\|");
|
||||||
|
|
||||||
@ -193,13 +237,13 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
"");
|
"");
|
||||||
|
|
||||||
globalInstances.add(eamGlobalFileInstance);
|
globalInstances.add(eamGlobalFileInstance);
|
||||||
numLines++;
|
numLines.incrementAndGet();
|
||||||
|
|
||||||
if(numLines % HASH_IMPORT_THRESHOLD == 0){
|
if(numLines.get() % HASH_IMPORT_THRESHOLD == 0){
|
||||||
dbManager.bulkInsertReferenceTypeEntries(globalInstances, contentType);
|
dbManager.bulkInsertReferenceTypeEntries(globalInstances, contentType);
|
||||||
globalInstances.clear();
|
globalInstances.clear();
|
||||||
|
|
||||||
int progress = (int)(numLines * 100 / totalLines);
|
int progress = (int)(numLines.get() * 100 / totalLines);
|
||||||
if(progress < 100){
|
if(progress < 100){
|
||||||
this.setProgress(progress);
|
this.setProgress(progress);
|
||||||
} else {
|
} else {
|
||||||
@ -218,28 +262,40 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
throw new TskCoreException(ex.getLocalizedMessage());
|
throw new TskCoreException(ex.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteIncompleteSet(int crIndex){
|
||||||
|
if(crIndex >= 0){
|
||||||
|
System.out.println("Deleting incomplete reference set");
|
||||||
|
|
||||||
|
// This can be slow on large reference sets
|
||||||
|
Executors.newSingleThreadExecutor().execute(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try{
|
||||||
|
EamDb.getInstance().deleteReferenceSet(crIndex);
|
||||||
|
} catch (EamDbException ex2){
|
||||||
|
|
||||||
|
}
|
||||||
// Let any external listeners know that there's a new set
|
}
|
||||||
//try {
|
});
|
||||||
// changeSupport.firePropertyChange(HashDbManager.SetEvt.DB_ADDED.toString(), null, hashSetName);
|
}
|
||||||
//} catch (Exception e) {
|
|
||||||
// logger.log(Level.SEVERE, "HashDbManager listener threw exception", e); //NON-NLS
|
|
||||||
// MessageNotifyUtil.Notify.show(
|
|
||||||
// NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErr"),
|
|
||||||
// NbBundle.getMessage(this.getClass(), "HashDbManager.moduleErrorListeningToUpdatesMsg"),
|
|
||||||
// MessageNotifyUtil.MessageType.ERROR);
|
|
||||||
//}
|
|
||||||
//return hashDb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void done() {
|
protected void done() {
|
||||||
|
if(isCancelled()){
|
||||||
|
// If the user hit cancel, delete this incomplete hash set from the central repo
|
||||||
|
deleteIncompleteSet(crIndex);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
get();
|
get();
|
||||||
try{
|
try{
|
||||||
System.out.println("### Finished - adding hashDb object");
|
System.out.println("### Finished - adding hashDb object");
|
||||||
HashDbManager.CentralRepoHashDb hashDb = HashDbManager.getInstance().addExistingCentralRepoHashSet(hashSetName, version, crIndex,
|
HashDbManager.CentralRepoHashDb hashDb = HashDbManager.getInstance().addExistingCentralRepoHashSet(hashSetName, version,
|
||||||
|
crIndex,
|
||||||
searchDuringIngest, sendIngestMessages, knownFilesType);
|
searchDuringIngest, sendIngestMessages, knownFilesType);
|
||||||
} catch (TskCoreException ex){
|
} catch (TskCoreException ex){
|
||||||
System.out.println("\n### Error!");
|
System.out.println("\n### Error!");
|
||||||
@ -248,7 +304,7 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
|
|
||||||
System.out.println("\n### Interrupted!");
|
System.out.println("\n### Interrupted!");
|
||||||
|
|
||||||
// If the user hit cancel, delete this incomplete hash set from the central repo
|
// Delete this incomplete hash set from the central repo
|
||||||
if(crIndex >= 0){
|
if(crIndex >= 0){
|
||||||
try{
|
try{
|
||||||
EamDb.getInstance().deleteReferenceSet(crIndex);
|
EamDb.getInstance().deleteReferenceSet(crIndex);
|
||||||
@ -257,7 +313,12 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@Override
|
||||||
|
//public boolean cancel(boolean mayInterruptIfRunning) {
|
||||||
|
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -271,21 +332,14 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
|
|
||||||
progressBar = new javax.swing.JProgressBar();
|
progressBar = new javax.swing.JProgressBar();
|
||||||
lbProgress = new javax.swing.JLabel();
|
lbProgress = new javax.swing.JLabel();
|
||||||
jButton1 = new javax.swing.JButton();
|
|
||||||
bnOk = new javax.swing.JButton();
|
bnOk = new javax.swing.JButton();
|
||||||
bnCancel = new javax.swing.JButton();
|
bnCancel = new javax.swing.JButton();
|
||||||
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(lbProgress, org.openide.util.NbBundle.getMessage(ImportCentralRepoDbProgressDialog.class, "ImportCentralRepoDbProgressDialog.lbProgress.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(lbProgress, org.openide.util.NbBundle.getMessage(ImportCentralRepoDbProgressDialog.class, "ImportCentralRepoDbProgressDialog.lbProgress.text")); // NOI18N
|
||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(ImportCentralRepoDbProgressDialog.class, "ImportCentralRepoDbProgressDialog.jButton1.text")); // NOI18N
|
|
||||||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
||||||
jButton1ActionPerformed(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
org.openide.awt.Mnemonics.setLocalizedText(bnOk, org.openide.util.NbBundle.getMessage(ImportCentralRepoDbProgressDialog.class, "ImportCentralRepoDbProgressDialog.bnOk.text")); // NOI18N
|
org.openide.awt.Mnemonics.setLocalizedText(bnOk, org.openide.util.NbBundle.getMessage(ImportCentralRepoDbProgressDialog.class, "ImportCentralRepoDbProgressDialog.bnOk.text")); // NOI18N
|
||||||
bnOk.addActionListener(new java.awt.event.ActionListener() {
|
bnOk.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
@ -300,55 +354,52 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(ImportCentralRepoDbProgressDialog.class, "ImportCentralRepoDbProgressDialog.jLabel1.text")); // NOI18N
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
getContentPane().setLayout(layout);
|
getContentPane().setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGap(27, 27, 27)
|
.addContainerGap()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addComponent(progressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addComponent(jButton1)
|
.addContainerGap())
|
||||||
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
||||||
.addContainerGap(27, Short.MAX_VALUE))
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(lbProgress)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(jLabel1)
|
||||||
.addComponent(bnOk)
|
.addComponent(lbProgress))
|
||||||
.addGap(18, 18, 18)
|
.addGap(0, 172, Short.MAX_VALUE))))
|
||||||
.addComponent(bnCancel)
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
.addGap(24, 24, 24))))
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(bnOk, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(bnCancel)
|
||||||
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addContainerGap()
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addComponent(jLabel1)
|
||||||
.addGap(112, 112, 112)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(lbProgress)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(lbProgress)
|
.addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 89, Short.MAX_VALUE))
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(bnCancel)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addComponent(bnOk))
|
||||||
.addComponent(bnOk)
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
.addComponent(bnCancel))
|
|
||||||
.addGap(72, 72, 72)))
|
|
||||||
.addComponent(jButton1)
|
|
||||||
.addGap(42, 42, 42))
|
|
||||||
);
|
);
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
|
||||||
this.dispose();
|
|
||||||
}//GEN-LAST:event_jButton1ActionPerformed
|
|
||||||
|
|
||||||
private void bnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnCancelActionPerformed
|
private void bnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnCancelActionPerformed
|
||||||
this.worker.cancel(true);
|
this.worker.cancel(true);
|
||||||
|
this.dispose();
|
||||||
}//GEN-LAST:event_bnCancelActionPerformed
|
}//GEN-LAST:event_bnCancelActionPerformed
|
||||||
|
|
||||||
private void bnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnOkActionPerformed
|
private void bnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnOkActionPerformed
|
||||||
@ -359,7 +410,7 @@ class ImportCentralRepoDbProgressDialog extends javax.swing.JDialog implements P
|
|||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton bnCancel;
|
private javax.swing.JButton bnCancel;
|
||||||
private javax.swing.JButton bnOk;
|
private javax.swing.JButton bnOk;
|
||||||
private javax.swing.JButton jButton1;
|
private javax.swing.JLabel jLabel1;
|
||||||
private javax.swing.JLabel lbProgress;
|
private javax.swing.JLabel lbProgress;
|
||||||
private javax.swing.JProgressBar progressBar;
|
private javax.swing.JProgressBar progressBar;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
|
Loading…
x
Reference in New Issue
Block a user