Merge pull request #668 from mrtizmo/hashdatabase

Hashdatabase - Added NON-NLS tags
This commit is contained in:
Richard Cordovano 2014-04-22 12:59:58 -04:00
commit 33236d6065
9 changed files with 106 additions and 106 deletions

View File

@ -107,7 +107,7 @@ public final class HashDatabaseOptionsPanelController extends OptionsPanelContro
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
}
catch (Exception e) {
logger.log(Level.SEVERE, "HashDatabaseOptionsPanelController listener threw exception", e);
logger.log(Level.SEVERE, "HashDatabaseOptionsPanelController listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(
NbBundle.getMessage(this.getClass(), "HashDatabaseOptionsPanelController.moduleErr"),
NbBundle.getMessage(this.getClass(), "HashDatabaseOptionsPanelController.moduleErrMsg"),
@ -119,7 +119,7 @@ public final class HashDatabaseOptionsPanelController extends OptionsPanelContro
pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
}
catch (Exception e) {
logger.log(Level.SEVERE, "HashDatabaseOptionsPanelController listener threw exception", e);
logger.log(Level.SEVERE, "HashDatabaseOptionsPanelController listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(
NbBundle.getMessage(this.getClass(), "HashDatabaseOptionsPanelController.moduleErr"),
NbBundle.getMessage(this.getClass(), "HashDatabaseOptionsPanelController.moduleErrMsg"),

View File

@ -288,7 +288,7 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
}
}
catch (IOException ex) {
Logger.getLogger(HashDbCreateDatabaseDialog.class.getName()).log(Level.WARNING, "Couldn't get selected file path.", ex);
Logger.getLogger(HashDbCreateDatabaseDialog.class.getName()).log(Level.WARNING, "Couldn't get selected file path.", ex); //NON-NLS
}
}//GEN-LAST:event_saveAsButtonActionPerformed

View File

@ -72,7 +72,7 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
private void initFileChooser() {
fileChooser.setDragEnabled(false);
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
String[] EXTENSION = new String[] { "txt", "kdb", "idx", "hash", "Hash", "hsh"};
String[] EXTENSION = new String[] { "txt", "kdb", "idx", "hash", "Hash", "hsh"}; //NON-NLS
FileNameExtensionFilter filter = new FileNameExtensionFilter(
NbBundle.getMessage(this.getClass(), "HashDbImportDatabaseDialog.fileNameExtFilter.text"), EXTENSION);
fileChooser.setFileFilter(filter);
@ -254,13 +254,13 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
selectedFilePath = databaseFile.getCanonicalPath();
databasePathTextField.setText(shortenPath(selectedFilePath));
hashSetNameTextField.setText(FilenameUtils.removeExtension(databaseFile.getName()));
if (hashSetNameTextField.getText().toLowerCase().contains("nsrl")) {
if (hashSetNameTextField.getText().toLowerCase().contains("nsrl")) { //NON-NLS
knownRadioButton.setSelected(true);
knownRadioButtonActionPerformed(null);
}
}
catch (IOException ex) {
Logger.getLogger(HashDbImportDatabaseDialog.class.getName()).log(Level.SEVERE, "Failed to get path of selected database", ex);
Logger.getLogger(HashDbImportDatabaseDialog.class.getName()).log(Level.SEVERE, "Failed to get path of selected database", ex); //NON-NLS
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(),
"HashDbImportDatabaseDialog.failedToGetDbPathMsg"));

View File

@ -105,7 +105,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
}
}
catch (TskCoreException ex) {
logger.log(Level.WARNING, "Error getting index status for " + db.getHashSetName() +" hash database", ex);
logger.log(Level.WARNING, "Error getting index status for " + db.getHashSetName() +" hash database", ex); //NON-NLS
}
}
}
@ -134,7 +134,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
totalCalctime.addAndGet(delta);
} catch (IOException ex) {
logger.log(Level.WARNING, "Error calculating hash of file " + name, ex);
logger.log(Level.WARNING, "Error calculating hash of file " + name, ex); //NON-NLS
services.postMessage(IngestMessage.createErrorMessage(
HashLookupModuleFactory.getModuleName(),
NbBundle.getMessage(this.getClass(),
@ -161,7 +161,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
try {
skCase.setKnown(file, TskData.FileKnown.BAD);
} catch (TskException ex) {
logger.log(Level.WARNING, "Couldn't set known bad state for file " + name + " - see sleuthkit log for details", ex);
logger.log(Level.WARNING, "Couldn't set known bad state for file " + name + " - see sleuthkit log for details", ex); //NON-NLS
services.postMessage(IngestMessage.createErrorMessage(
HashLookupModuleFactory.getModuleName(),
NbBundle.getMessage(this.getClass(),
@ -194,7 +194,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
totalLookuptime.addAndGet(delta);
} catch (TskException ex) {
logger.log(Level.WARNING, "Couldn't lookup known bad hash for file " + name + " - see sleuthkit log for details", ex);
logger.log(Level.WARNING, "Couldn't lookup known bad hash for file " + name + " - see sleuthkit log for details", ex); //NON-NLS
services.postMessage(IngestMessage.createErrorMessage(
HashLookupModuleFactory.getModuleName(),
NbBundle.getMessage(this.getClass(),
@ -219,7 +219,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
skCase.setKnown(file, TskData.FileKnown.KNOWN);
break;
} catch (TskException ex) {
logger.log(Level.WARNING, "Couldn't set known state for file " + name + " - see sleuthkit log for details", ex);
logger.log(Level.WARNING, "Couldn't set known state for file " + name + " - see sleuthkit log for details", ex); //NON-NLS
ret = ProcessResult.ERROR;
}
}
@ -227,7 +227,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
totalLookuptime.addAndGet(delta);
} catch (TskException ex) {
logger.log(Level.WARNING, "Couldn't lookup known hash for file " + name + " - see sleuthkit log for details", ex);
logger.log(Level.WARNING, "Couldn't lookup known hash for file " + name + " - see sleuthkit log for details", ex); //NON-NLS
services.postMessage(IngestMessage.createErrorMessage(
HashLookupModuleFactory.getModuleName(),
NbBundle.getMessage(this.getClass(),
@ -261,32 +261,32 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
if (showInboxMessage) {
StringBuilder detailsSb = new StringBuilder();
//details
detailsSb.append("<table border='0' cellpadding='4' width='280'>");
detailsSb.append("<table border='0' cellpadding='4' width='280'>"); //NON-NLS
//hit
detailsSb.append("<tr>");
detailsSb.append("<th>")
detailsSb.append("<tr>"); //NON-NLS
detailsSb.append("<th>") //NON-NLS
.append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.postToBB.fileName"))
.append("</th>");
detailsSb.append("<td>")
.append("</th>"); //NON-NLS
detailsSb.append("<td>") //NON-NLS
.append(abstractFile.getName())
.append("</td>");
detailsSb.append("</tr>");
.append("</td>"); //NON-NLS
detailsSb.append("</tr>"); //NON-NLS
detailsSb.append("<tr>");
detailsSb.append("<th>")
detailsSb.append("<tr>"); //NON-NLS
detailsSb.append("<th>") //NON-NLS
.append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.postToBB.md5Hash"))
.append("</th>");
detailsSb.append("<td>").append(md5Hash).append("</td>");
detailsSb.append("</tr>");
.append("</th>"); //NON-NLS
detailsSb.append("<td>").append(md5Hash).append("</td>"); //NON-NLS
detailsSb.append("</tr>"); //NON-NLS
detailsSb.append("<tr>");
detailsSb.append("<th>")
detailsSb.append("<tr>"); //NON-NLS
detailsSb.append("<th>") //NON-NLS
.append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.postToBB.hashsetName"))
.append("</th>");
detailsSb.append("<td>").append(hashSetName).append("</td>");
detailsSb.append("</tr>");
.append("</th>"); //NON-NLS
detailsSb.append("<td>").append(hashSetName).append("</td>"); //NON-NLS
detailsSb.append("</tr>"); //NON-NLS
detailsSb.append("</table>");
detailsSb.append("</table>"); //NON-NLS
services.postMessage(IngestMessage.createDataMessage( HashLookupModuleFactory.getModuleName(),
NbBundle.getMessage(this.getClass(),
@ -298,7 +298,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
}
services.fireModuleDataEvent(new ModuleDataEvent(MODULE_NAME, ARTIFACT_TYPE.TSK_HASHSET_HIT, Collections.singletonList(badFile)));
} catch (TskException ex) {
logger.log(Level.WARNING, "Error creating blackboard artifact", ex);
logger.log(Level.WARNING, "Error creating blackboard artifact", ex); //NON-NLS
}
}
@ -309,29 +309,29 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges
if ((!knownBadHashSets.isEmpty()) || (!knownHashSets.isEmpty())) {
StringBuilder detailsSb = new StringBuilder();
//details
detailsSb.append("<table border='0' cellpadding='4' width='280'>");
detailsSb.append("<table border='0' cellpadding='4' width='280'>"); //NON-NLS
detailsSb.append("<tr><td>")
detailsSb.append("<tr><td>") //NON-NLS
.append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.complete.knownBadsFound"))
.append("</td>");
detailsSb.append("<td>").append(totalKnownBadCount.get()).append("</td></tr>");
.append("</td>"); //NON-NLS
detailsSb.append("<td>").append(totalKnownBadCount.get()).append("</td></tr>"); //NON-NLS
detailsSb.append("<tr><td>")
detailsSb.append("<tr><td>") //NON-NLS
.append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.complete.totalCalcTime"))
.append("</td><td>").append(totalCalctime.get()).append("</td></tr>\n");
detailsSb.append("<tr><td>")
.append("</td><td>").append(totalCalctime.get()).append("</td></tr>\n"); //NON-NLS
detailsSb.append("<tr><td>") //NON-NLS
.append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.complete.totalLookupTime"))
.append("</td><td>").append(totalLookuptime.get()).append("</td></tr>\n");
detailsSb.append("</table>");
.append("</td><td>").append(totalLookuptime.get()).append("</td></tr>\n"); //NON-NLS
detailsSb.append("</table>"); //NON-NLS
detailsSb.append("<p>")
detailsSb.append("<p>") //NON-NLS
.append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.complete.databasesUsed"))
.append("</p>\n<ul>");
.append("</p>\n<ul>"); //NON-NLS
for (HashDb db : knownBadHashSets) {
detailsSb.append("<li>").append(db.getHashSetName()).append("</li>\n");
detailsSb.append("<li>").append(db.getHashSetName()).append("</li>\n"); //NON-NLS
}
detailsSb.append("</ul>");
detailsSb.append("</ul>"); //NON-NLS
services.postMessage(IngestMessage.createMessage(
IngestMessage.MessageType.INFO,
HashLookupModuleFactory.getModuleName(),

View File

@ -63,20 +63,20 @@ import org.sleuthkit.autopsy.ingest.IngestManager;
*/
public class HashDbManager implements PropertyChangeListener {
private static final String ROOT_ELEMENT = "hash_sets";
private static final String SET_ELEMENT = "hash_set";
private static final String SET_NAME_ATTRIBUTE = "name";
private static final String SET_TYPE_ATTRIBUTE = "type";
private static final String SEARCH_DURING_INGEST_ATTRIBUTE = "use_for_ingest";
private static final String SEND_INGEST_MESSAGES_ATTRIBUTE = "show_inbox_messages";
private static final String PATH_ELEMENT = "hash_set_path";
private static final String LEGACY_PATH_NUMBER_ATTRIBUTE = "number";
private static final String CONFIG_FILE_NAME = "hashsets.xml";
private static final String XSD_FILE_NAME = "HashsetsSchema.xsd";
private static final String ENCODING = "UTF-8";
private static final String ALWAYS_CALCULATE_HASHES_ELEMENT = "hash_calculate";
private static final String VALUE_ATTRIBUTE = "value";
private static final String HASH_DATABASE_FILE_EXTENSON = "kdb";
private static final String ROOT_ELEMENT = "hash_sets"; //NON-NLS
private static final String SET_ELEMENT = "hash_set"; //NON-NLS
private static final String SET_NAME_ATTRIBUTE = "name"; //NON-NLS
private static final String SET_TYPE_ATTRIBUTE = "type"; //NON-NLS
private static final String SEARCH_DURING_INGEST_ATTRIBUTE = "use_for_ingest"; //NON-NLS
private static final String SEND_INGEST_MESSAGES_ATTRIBUTE = "show_inbox_messages"; //NON-NLS
private static final String PATH_ELEMENT = "hash_set_path"; //NON-NLS
private static final String LEGACY_PATH_NUMBER_ATTRIBUTE = "number"; //NON-NLS
private static final String CONFIG_FILE_NAME = "hashsets.xml"; //NON-NLS
private static final String XSD_FILE_NAME = "HashsetsSchema.xsd"; //NON-NLS
private static final String ENCODING = "UTF-8"; //NON-NLS
private static final String ALWAYS_CALCULATE_HASHES_ELEMENT = "hash_calculate"; //NON-NLS
private static final String VALUE_ATTRIBUTE = "value"; //NON-NLS
private static final String HASH_DATABASE_FILE_EXTENSON = "kdb"; //NON-NLS
private static HashDbManager instance = null;
private final String configFilePath = PlatformUtil.getUserConfigDirectory() + File.separator + CONFIG_FILE_NAME;
private List<HashDb> knownHashSets = new ArrayList<>();
@ -286,10 +286,10 @@ public class HashDbManager implements PropertyChangeListener {
// Update the collections used to ensure that hash set names are unique
// and the same database is not added to the configuration more than once.
hashSetNames.add(hashDb.getHashSetName());
if (!databasePath.equals("None")) {
if (!databasePath.equals("None")) { //NON-NLS
hashSetPaths.add(databasePath);
}
if (!indexPath.equals("None")) {
if (!indexPath.equals("None")) { //NON-NLS
hashSetPaths.add(indexPath);
}
@ -304,7 +304,7 @@ public class HashDbManager implements PropertyChangeListener {
try {
changeSupport.firePropertyChange(SetEvt.DB_ADDED.toString(), null, hashSetName);
} catch (Exception e) {
logger.log(Level.SEVERE, "HashDbManager listener threw 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"),
@ -326,11 +326,11 @@ public class HashDbManager implements PropertyChangeListener {
if (null != hashDb) {
try {
String indexPath = hashDb.getIndexPath();
if (!indexPath.equals("None")) {
if (!indexPath.equals("None")) { //NON-NLS
hashSetPaths.add(indexPath);
}
} catch (TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error getting index path of " + hashDb.getHashSetName() + " hash database after indexing", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error getting index path of " + hashDb.getHashSetName() + " hash database after indexing", ex); //NON-NLS
}
}
}
@ -377,19 +377,19 @@ public class HashDbManager implements PropertyChangeListener {
try {
hashSetPaths.remove(hashDb.getIndexPath());
} catch (TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error getting index path of " + hashDb.getHashSetName() + " hash database when removing the database", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error getting index path of " + hashDb.getHashSetName() + " hash database when removing the database", ex); //NON-NLS
}
try {
if (!hashDb.hasIndexOnly()) {
hashSetPaths.remove(hashDb.getDatabasePath());
}
} catch (TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error getting database path of " + hashDb.getHashSetName() + " hash database when removing the database", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error getting database path of " + hashDb.getHashSetName() + " hash database when removing the database", ex); //NON-NLS
}
try {
hashDb.close();
} catch (TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error closing " + hashDb.getHashSetName() + " hash database when removing the database", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error closing " + hashDb.getHashSetName() + " hash database when removing the database", ex); //NON-NLS
}
// Let any external listeners know that a set has been deleted
@ -397,7 +397,7 @@ public class HashDbManager implements PropertyChangeListener {
try {
changeSupport.firePropertyChange(SetEvt.DB_DELETED.toString(), null, hashSetName);
} catch (Exception e) {
logger.log(Level.SEVERE, "HashDbManager listener threw 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"),
@ -459,7 +459,7 @@ public class HashDbManager implements PropertyChangeListener {
updateableDbs.add(db);
}
} catch (TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error checking updateable status of " + db.getHashSetName() + " hash database", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error checking updateable status of " + db.getHashSetName() + " hash database", ex); //NON-NLS
}
}
return updateableDbs;
@ -511,7 +511,7 @@ public class HashDbManager implements PropertyChangeListener {
try {
database.close();
} catch (TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error closing " + database.getHashSetName() + " hash database", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error closing " + database.getHashSetName() + " hash database", ex); //NON-NLS
}
}
hashDatabases.clear();
@ -536,7 +536,7 @@ public class HashDbManager implements PropertyChangeListener {
success = XMLUtil.saveDoc(HashDbManager.class, configFilePath, ENCODING, doc);
} catch (ParserConfigurationException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error saving hash databases", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error saving hash databases", ex); //NON-NLS
}
return success;
}
@ -553,7 +553,7 @@ public class HashDbManager implements PropertyChangeListener {
path = db.getDatabasePath();
}
} catch (TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error getting path of hash database " + db.getHashSetName() + ", discarding from hash database configuration", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error getting path of hash database " + db.getHashSetName() + ", discarding from hash database configuration", ex); //NON-NLS
continue;
}
@ -586,7 +586,7 @@ public class HashDbManager implements PropertyChangeListener {
// Get the root element.
Element root = doc.getDocumentElement();
if (root == null) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error loading hash sets: invalid file format.");
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error loading hash sets: invalid file format."); //NON-NLS
return false;
}
@ -594,13 +594,13 @@ public class HashDbManager implements PropertyChangeListener {
NodeList setsNList = root.getElementsByTagName(SET_ELEMENT);
int numSets = setsNList.getLength();
if (numSets == 0) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, "No element hash_set exists.");
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, "No element hash_set exists."); //NON-NLS
}
// Create HashDb objects for each hash set element. Skip to the next hash database if the definition of
// a particular hash database is not well-formed.
String attributeErrorMessage = " attribute was not set for hash_set at index {0}, cannot make instance of HashDb class";
String elementErrorMessage = " element was not set for hash_set at index {0}, cannot make instance of HashDb class";
String attributeErrorMessage = " attribute was not set for hash_set at index {0}, cannot make instance of HashDb class"; //NON-NLS
String elementErrorMessage = " element was not set for hash_set at index {0}, cannot make instance of HashDb class"; //NON-NLS
for (int i = 0; i < numSets; ++i) {
Element setEl = (Element) setsNList.item(i);
@ -634,7 +634,7 @@ public class HashDbManager implements PropertyChangeListener {
}
// Handle legacy known files types.
if (knownFilesType.equals("NSRL")) {
if (knownFilesType.equals("NSRL")) { //NON-NLS
knownFilesType = HashDb.KnownFilesType.KNOWN.toString();
updatedSchema = true;
}
@ -679,7 +679,7 @@ public class HashDbManager implements PropertyChangeListener {
try {
addExistingHashDatabaseInternal(hashSetName, dbPath, seearchDuringIngestFlag, sendIngestMessagesFlag, HashDb.KnownFilesType.valueOf(knownFilesType));
} catch (HashDbManagerException | TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error opening hash database", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error opening hash database", ex); //NON-NLS
JOptionPane.showMessageDialog(null,
NbBundle.getMessage(this.getClass(),
"HashDbManager.unableToOpenHashDbMsg", dbPath),
@ -687,7 +687,7 @@ public class HashDbManager implements PropertyChangeListener {
JOptionPane.ERROR_MESSAGE);
}
} else {
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, "No valid path for hash_set at index {0}, cannot make instance of HashDb class", i);
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, "No valid path for hash_set at index {0}, cannot make instance of HashDb class", i); //NON-NLS
}
}
@ -698,12 +698,12 @@ public class HashDbManager implements PropertyChangeListener {
final String value = calcEl.getAttribute(VALUE_ATTRIBUTE);
alwaysCalculateHashes = Boolean.parseBoolean(value);
} else {
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, " element ");
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, " element "); //NON-NLS
alwaysCalculateHashes = true;
}
if (updatedSchema) {
String backupFilePath = configFilePath + ".v1_backup";
String backupFilePath = configFilePath + ".v1_backup"; //NON-NLS
String messageBoxTitle = NbBundle.getMessage(this.getClass(),
"HashDbManager.msgBoxTitle.confFileFmtChanged");
String baseMessage = NbBundle.getMessage(this.getClass(),
@ -717,7 +717,7 @@ public class HashDbManager implements PropertyChangeListener {
messageBoxTitle,
JOptionPane.INFORMATION_MESSAGE);
} catch (IOException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, "Failed to save backup of old format configuration file to " + backupFilePath, ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, "Failed to save backup of old format configuration file to " + backupFilePath, ex); //NON-NLS
JOptionPane.showMessageDialog(null, baseMessage, messageBoxTitle, JOptionPane.INFORMATION_MESSAGE);
}
@ -757,7 +757,7 @@ public class HashDbManager implements PropertyChangeListener {
JFileChooser fc = new JFileChooser();
fc.setDragEnabled(false);
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
String[] EXTENSION = new String[]{"txt", "idx", "hash", "Hash", "kdb"};
String[] EXTENSION = new String[]{"txt", "idx", "hash", "Hash", "kdb"}; //NON-NLS
FileNameExtensionFilter filter = new FileNameExtensionFilter(
NbBundle.getMessage(this.getClass(), "HashDbManager.fileNameExtensionFilter.title"), EXTENSION);
fc.setFileFilter(filter);
@ -767,7 +767,7 @@ public class HashDbManager implements PropertyChangeListener {
try {
filePath = f.getCanonicalPath();
} catch (IOException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, "Couldn't get selected file path", ex);
Logger.getLogger(HashDbManager.class.getName()).log(Level.WARNING, "Couldn't get selected file path", ex); //NON-NLS
}
}
return filePath;
@ -988,7 +988,7 @@ public class HashDbManager implements PropertyChangeListener {
try {
SleuthkitJNI.createLookupIndexForHashDatabase(hashDb.handle);
} catch (TskCoreException ex) {
Logger.getLogger(HashDb.class.getName()).log(Level.SEVERE, "Error indexing hash database", ex);
Logger.getLogger(HashDb.class.getName()).log(Level.SEVERE, "Error indexing hash database", ex); //NON-NLS
JOptionPane.showMessageDialog(null,
NbBundle.getMessage(this.getClass(),
"HashDbManager.dlgMsg.errorIndexingHashSet",
@ -1008,7 +1008,7 @@ public class HashDbManager implements PropertyChangeListener {
try {
get();
} catch (InterruptedException | ExecutionException ex) {
logger.log(Level.SEVERE, "Error creating index", ex);
logger.log(Level.SEVERE, "Error creating index", ex); //NON-NLS
MessageNotifyUtil.Notify.show(
NbBundle.getMessage(this.getClass(), "HashDbManager.errCreatingIndex.title"),
NbBundle.getMessage(this.getClass(), "HashDbManager.errCreatingIndex.msg", ex.getMessage()),
@ -1021,7 +1021,7 @@ public class HashDbManager implements PropertyChangeListener {
hashDb.propertyChangeSupport.firePropertyChange(HashDb.Event.INDEXING_DONE.toString(), null, hashDb);
hashDb.propertyChangeSupport.firePropertyChange(HashDbManager.SetEvt.DB_INDEXED.toString(), null, hashDb.getHashSetName());
} catch (Exception e) {
logger.log(Level.SEVERE, "HashDbManager listener threw 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"),

View File

@ -50,7 +50,7 @@ class HashDbSearchThread extends SwingWorker<Object,Void> {
@Override
protected Object doInBackground() throws Exception {
logger.log(Level.INFO, "Starting background processing for file search by MD5 hash.");
logger.log(Level.INFO, "Starting background processing for file search by MD5 hash."); //NON-NLS
// Setup progress bar
final String displayName = NbBundle.getMessage(this.getClass(), "HashDbSearchThread.name.searching");
@ -70,7 +70,7 @@ class HashDbSearchThread extends SwingWorker<Object,Void> {
// Do the querying
map = HashDbSearcher.findFilesBymd5(hashes, progress, this);
logger.log(Level.INFO, "Done background processing");
logger.log(Level.INFO, "Done background processing"); //NON-NLS
return null;
}
@ -80,15 +80,15 @@ class HashDbSearchThread extends SwingWorker<Object,Void> {
try {
super.get(); //block and get all exceptions thrown while doInBackground()
} catch (CancellationException ex) {
logger.log(Level.INFO, "File search by MD5 hash was canceled.");
logger.log(Level.INFO, "File search by MD5 hash was canceled."); //NON-NLS
} catch (InterruptedException ex) {
logger.log(Level.INFO, "File search by MD5 hash was interrupted.");
logger.log(Level.INFO, "File search by MD5 hash was interrupted."); //NON-NLS
} catch (Exception ex) {
logger.log(Level.SEVERE, "Fatal error during file search by MD5 hash.", ex);
logger.log(Level.SEVERE, "Fatal error during file search by MD5 hash.", ex); //NON-NLS
} finally {
progress.finish();
if (!this.isCancelled()) {
logger.log(Level.INFO, "File search by MD5 hash completed without cancellation.");
logger.log(Level.INFO, "File search by MD5 hash completed without cancellation."); //NON-NLS
// If its a right click action, we are given an FsContent which
// is the file right clicked, so we can remove that from the search
if(file!=null) {
@ -109,7 +109,7 @@ class HashDbSearchThread extends SwingWorker<Object,Void> {
HashDbSearchManager man = new HashDbSearchManager(map);
man.execute();
} else {
logger.log(Level.INFO, "File search by MD5 hash was canceled.");
logger.log(Level.INFO, "File search by MD5 hash was canceled."); //NON-NLS
}
}
}

View File

@ -168,7 +168,7 @@ public final class HashLookupModuleSettingsPanel extends IngestModuleIngestJobSe
try {
indexed = hashDb.hasIndex();
} catch (TskCoreException ex) {
Logger.getLogger(HashLookupModuleSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting indexed status info for hash set (name = " + hashDb.getHashSetName() + ")", ex);
Logger.getLogger(HashLookupModuleSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting indexed status info for hash set (name = " + hashDb.getHashSetName() + ")", ex); //NON-NLS
}
return indexed;
}

View File

@ -150,14 +150,14 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
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);
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 {
indexPathLabel.setText(shortenPath(db.getIndexPath()));
} catch (TskCoreException ex) {
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index path of " + db.getHashSetName() + " hash database", ex);
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index path of " + db.getHashSetName() + " hash database", ex); //NON-NLS
indexPathLabel.setText(ERROR_GETTING_PATH_TEXT);
}
@ -195,7 +195,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
indexButton.setEnabled(true);
}
} catch (TskCoreException ex) {
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index state of hash database", ex);
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index state of hash database", ex); //NON-NLS
hashDbIndexStatusLabel.setText(ERROR_GETTING_INDEX_STATUS_TEXT);
hashDbIndexStatusLabel.setForeground(Color.red);
indexButton.setText(NbBundle.getMessage(this.getClass(), "HashDbConfigPanel.indexButtonText.index"));
@ -246,7 +246,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
unindexed.add(hashSet);
}
} catch (TskCoreException ex) {
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index info for hash database", ex);
Logger.getLogger(HashLookupSettingsPanel.class.getName()).log(Level.SEVERE, "Error getting index info for hash database", ex); //NON-NLS
}
}
@ -393,7 +393,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
try {
return hashSets.get(rowIndex).hasIndex();
} catch (TskCoreException ex) {
Logger.getLogger(HashSetTableModel.class.getName()).log(Level.SEVERE, "Error getting index info for hash database", ex);
Logger.getLogger(HashSetTableModel.class.getName()).log(Level.SEVERE, "Error getting index info for hash database", ex); //NON-NLS
return false;
}
}
@ -483,13 +483,13 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jLabel6.text")); // NOI18N
jButton3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jButton3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N NON-NLS
org.openide.awt.Mnemonics.setLocalizedText(jButton3, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.jButton3.text")); // NOI18N
setMinimumSize(new java.awt.Dimension(700, 500));
setPreferredSize(new java.awt.Dimension(700, 500));
ingestWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/warning16.png"))); // NOI18N
ingestWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/warning16.png"))); // NOI18N NON-NLS
org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.ingestWarningLabel.text")); // NOI18N
hashSetTable.setModel(new javax.swing.table.DefaultTableModel(
@ -509,7 +509,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
});
jScrollPane1.setViewportView(hashSetTable);
deleteDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/delete16.png"))); // NOI18N
deleteDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/delete16.png"))); // NOI18N NON-NLS
org.openide.awt.Mnemonics.setLocalizedText(deleteDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.deleteDatabaseButton.text")); // NOI18N
deleteDatabaseButton.setMaximumSize(new java.awt.Dimension(140, 25));
deleteDatabaseButton.setMinimumSize(new java.awt.Dimension(140, 25));
@ -520,7 +520,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
}
});
importDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/import16.png"))); // NOI18N
importDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/import16.png"))); // NOI18N NON-NLS
org.openide.awt.Mnemonics.setLocalizedText(importDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.importDatabaseButton.text")); // NOI18N
importDatabaseButton.setMaximumSize(new java.awt.Dimension(140, 25));
importDatabaseButton.setMinimumSize(new java.awt.Dimension(140, 25));
@ -568,7 +568,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSetttingsPa
org.openide.awt.Mnemonics.setLocalizedText(optionsLabel, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.optionsLabel.text")); // NOI18N
createDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/new16.png"))); // NOI18N
createDatabaseButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/new16.png"))); // NOI18N NON-NLS
org.openide.awt.Mnemonics.setLocalizedText(createDatabaseButton, org.openide.util.NbBundle.getMessage(HashLookupSettingsPanel.class, "HashLookupSettingsPanel.createDatabaseButton.text")); // NOI18N
createDatabaseButton.setMaximumSize(new java.awt.Dimension(140, 25));
createDatabaseButton.setMinimumSize(new java.awt.Dimension(140, 25));

View File

@ -102,10 +102,10 @@ class ModalNoButtons extends javax.swing.JDialog implements PropertyChangeListen
GO_GET_COFFEE_LABEL.setDisplayedMnemonic('H');
org.openide.awt.Mnemonics.setLocalizedText(GO_GET_COFFEE_LABEL, org.openide.util.NbBundle.getMessage(ModalNoButtons.class, "ModalNoButtons.GO_GET_COFFEE_LABEL.text")); // NOI18N
CURRENTLYON_LABEL.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
CURRENTLYON_LABEL.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N NON-NLS
org.openide.awt.Mnemonics.setLocalizedText(CURRENTLYON_LABEL, org.openide.util.NbBundle.getMessage(ModalNoButtons.class, "ModalNoButtons.CURRENTLYON_LABEL.text")); // NOI18N
CURRENTDB_LABEL.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
CURRENTDB_LABEL.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N NON-NLS
org.openide.awt.Mnemonics.setLocalizedText(CURRENTDB_LABEL, org.openide.util.NbBundle.getMessage(ModalNoButtons.class, "ModalNoButtons.CURRENTDB_LABEL.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(CANCEL_BUTTON, org.openide.util.NbBundle.getMessage(ModalNoButtons.class, "ModalNoButtons.CANCEL_BUTTON.text")); // NOI18N