diff --git a/.gitignore b/.gitignore index feb9e958e7..d45aad857f 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,8 @@ genfiles.properties !/test/output/gold /test/output/gold/tmp /test/script/ScriptLog.txt +/test/script/__pycache__/ +/test/script/*.pyc /test/build/ /test/dist/ /test/nbproject/* diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java index b0be07d43c..f47d094110 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java @@ -57,21 +57,21 @@ public final class AddImageAction extends CallableSystemAction implements Presen // Keys into the WizardDescriptor properties that pass information between stages of the wizard // : // String: time zone that the image is from - static final String TIMEZONE_PROP = "timeZone"; + static final String TIMEZONE_PROP = "timeZone"; //NON-NLS // String[]: array of paths to each data source selected - static final String DATASOURCEPATH_PROP = "dataSrcPath"; + static final String DATASOURCEPATH_PROP = "dataSrcPath"; //NON-NLS // String data source type selected - static final String DATASOURCETYPE_PROP = "dataSrcType"; + static final String DATASOURCETYPE_PROP = "dataSrcType"; //NON-NLS // CleanupTask: task to clean up the database file if wizard errors/is cancelled after it is created - static final String IMAGECLEANUPTASK_PROP = "finalFileCleanup"; + static final String IMAGECLEANUPTASK_PROP = "finalFileCleanup"; //NON-NLS // int: the next availble id for a new image - static final String IMAGEID_PROP = "imageId"; + static final String IMAGEID_PROP = "imageId"; //NON-NLS // AddImageProcess: the next availble id for a new image - static final String PROCESS_PROP = "process"; + static final String PROCESS_PROP = "process"; //NON-NLS // boolean: whether or not to lookup files in the hashDB - static final String LOOKUPFILES_PROP = "lookupFiles"; + static final String LOOKUPFILES_PROP = "lookupFiles"; //NON-NLS // boolean: whether or not to skip processing orphan files on FAT filesystems - static final String NOFATORPHANS_PROP = "nofatorphans"; + static final String NOFATORPHANS_PROP = "nofatorphans"; //NON-NLS static final Logger logger = Logger.getLogger(AddImageAction.class.getName()); @@ -194,7 +194,7 @@ public final class AddImageAction extends CallableSystemAction implements Presen */ @Override public Component getToolbarPresenter() { - ImageIcon icon = new ImageIcon(getClass().getResource("btn_icon_add_image.png")); + ImageIcon icon = new ImageIcon(getClass().getResource("btn_icon_add_image.png")); //NON-NLS toolbarButton.setIcon(icon); toolbarButton.setText(this.getName()); return toolbarButton; @@ -261,7 +261,7 @@ public final class AddImageAction extends CallableSystemAction implements Presen cleanup(); } catch (Exception ex) { Logger logger = Logger.getLogger(this.getClass().getName()); - logger.log(Level.WARNING, "Error cleaning up from wizard.", ex); + logger.log(Level.WARNING, "Error cleaning up from wizard.", ex); //NON-NLS } finally { disable(); // cleanup tasks should only run once. } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index 7e27a21010..56fee3f494 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -154,12 +154,12 @@ import org.sleuthkit.datamodel.TskException; addImageProcess.run(new String[]{this.imagePath}); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Core errors occurred while running add image. ", ex); + logger.log(Level.SEVERE, "Core errors occurred while running add image. ", ex); //NON-NLS //critical core/system error and process needs to be interrupted hasCritError = true; errorList.add(ex.getMessage()); } catch (TskDataException ex) { - logger.log(Level.WARNING, "Data errors occurred while running add image. ", ex); + logger.log(Level.WARNING, "Data errors occurred while running add image. ", ex); //NON-NLS errorList.add(ex.getMessage()); } @@ -182,7 +182,7 @@ import org.sleuthkit.datamodel.TskException; try { imageId = addImageProcess.commit(); } catch (TskCoreException e) { - logger.log(Level.WARNING, "Errors occured while committing the image", e); + logger.log(Level.WARNING, "Errors occured while committing the image", e); //NON-NLS errorList.add(e.getMessage()); } finally { if (imageId != 0) { @@ -200,7 +200,7 @@ import org.sleuthkit.datamodel.TskException; newContents.add(newImage); } - logger.log(Level.INFO, "Image committed, imageId: {0}", imageId); + logger.log(Level.INFO, "Image committed, imageId: {0}", imageId); //NON-NLS logger.log(Level.INFO, PlatformUtil.getAllMemUsageInfo()); } } @@ -215,12 +215,12 @@ import org.sleuthkit.datamodel.TskException; dirFetcher.interrupt(); if (cancelRequested() || hasCritError) { - logger.log(Level.WARNING, "Critical errors or interruption in add image process. Image will not be committed."); + logger.log(Level.WARNING, "Critical errors or interruption in add image process. Image will not be committed."); //NON-NLS revert(); } if (!errorList.isEmpty()) { - logger.log(Level.INFO, "There were errors that occured in add image process"); + logger.log(Level.INFO, "There were errors that occured in add image process"); //NON-NLS } // When everything happens without an error: @@ -233,10 +233,10 @@ import org.sleuthkit.datamodel.TskException; } catch (Exception ex) { errorList.add(ex.getMessage()); // Log error/display warning - logger.log(Level.SEVERE, "Error adding image to case.", ex); + logger.log(Level.SEVERE, "Error adding image to case.", ex); //NON-NLS } } else { - logger.log(Level.SEVERE, "Missing image process object"); + logger.log(Level.SEVERE, "Missing image process object"); //NON-NLS } // Tell the progress monitor we're done @@ -245,8 +245,8 @@ import org.sleuthkit.datamodel.TskException; //handle unchecked exceptions post image add errorList.add(ex.getMessage()); - logger.log(Level.WARNING, "Unexpected errors occurred while running post add image cleanup. ", ex); - logger.log(Level.SEVERE, "Error adding image to case", ex); + logger.log(Level.WARNING, "Unexpected errors occurred while running post add image cleanup. ", ex); //NON-NLS + logger.log(Level.SEVERE, "Error adding image to case", ex); //NON-NLS } } @@ -288,7 +288,7 @@ import org.sleuthkit.datamodel.TskException; interrupt(); } catch (Exception ex) { - logger.log(Level.SEVERE, "Failed to interrupt the add image task..."); + logger.log(Level.SEVERE, "Failed to interrupt the add image task..."); //NON-NLS } } } @@ -299,7 +299,7 @@ import org.sleuthkit.datamodel.TskException; private void interrupt() throws Exception { try { - logger.log(Level.INFO, "interrupt() add image process"); + logger.log(Level.INFO, "interrupt() add image process"); //NON-NLS addImageProcess.stop(); //it might take time to truly stop processing and writing to db } catch (TskCoreException ex) { throw new Exception(NbBundle.getMessage(this.getClass(), "AddImageTask.interrupt.exception.msg"), ex); @@ -312,11 +312,11 @@ import org.sleuthkit.datamodel.TskException; private void revert() { if (!reverted) { - logger.log(Level.INFO, "Revert after add image process"); + logger.log(Level.INFO, "Revert after add image process"); //NON-NLS try { addImageProcess.revert(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Error reverting add image process", ex); + logger.log(Level.WARNING, "Error reverting add image process", ex); //NON-NLS } reverted = true; } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.java index afd5ec7281..5c2b52f602 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressVisual.java @@ -190,7 +190,7 @@ import org.openide.util.NbBundle; .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); - titleLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + titleLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(titleLabel, org.openide.util.NbBundle.getMessage(AddImageWizardAddingProgressVisual.class, "AddImageWizardAddingProgressVisual.titleLabel.text")); // NOI18N progressBar.setIndeterminate(true); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java index 9f595e92d3..7bbf664e99 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java @@ -48,8 +48,8 @@ class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Panel RAW_IMAGE_EXTS = Arrays.asList(new String[]{".img", ".dd", ".001", ".aa", ".raw", ".bin"}); + public static final List RAW_IMAGE_EXTS = Arrays.asList(new String[]{".img", ".dd", ".001", ".aa", ".raw", ".bin"}); //NON-NLS public static final String RAW_IMAGE_DESC = NbBundle.getMessage(GeneralFilter.class, "GeneralFilter.rawImageDesc.text"); - public static final List ENCASE_IMAGE_EXTS = Arrays.asList(new String[]{".e01"}); - public static final String ENCASE_IMAGE_DESC = NbBundle.getMessage(GeneralFilter.class, "GeneralFilter.encaseImageDesc.text"); + public static final List ENCASE_IMAGE_EXTS = Arrays.asList(new String[]{".e01"}); //NON-NLS + public static final String ENCASE_IMAGE_DESC = NbBundle.getMessage(GeneralFilter.class, + "GeneralFilter.encaseImageDesc.text"); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java index 1369745a57..2a215adb55 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/ImageFilePanel.java @@ -43,7 +43,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; */ public class ImageFilePanel extends JPanel implements DocumentListener { - private final String PROP_LASTIMAGE_PATH = "LBL_LastImage_PATH"; + private final String PROP_LASTIMAGE_PATH = "LBL_LastImage_PATH"; //NON-NLS private static final Logger logger = Logger.getLogger(ImageFilePanel.class.getName()); private PropertyChangeSupport pcs = null; private JFileChooser fc = new JFileChooser(); @@ -201,7 +201,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { pcs.firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.FOCUS_NEXT.toString(), false, true); } catch (Exception e) { - logger.log(Level.SEVERE, "ImageFilePanel listener threw exception", e); + logger.log(Level.SEVERE, "ImageFilePanel listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "ImageFilePanel.moduleErr"), NbBundle.getMessage(this.getClass(), "ImageFilePanel.moduleErr.msg"), MessageNotifyUtil.MessageType.ERROR); @@ -295,7 +295,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { int offset = zone.getRawOffset() / 1000; int hour = offset / 3600; int minutes = (offset % 3600) / 60; - String item = String.format("(GMT%+d:%02d) %s", hour, minutes, id); + String item = String.format("(GMT%+d:%02d) %s", hour, minutes, id); //NON-NLS /* * DateFormat dfm = new SimpleDateFormat("z"); @@ -313,7 +313,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { int thisOffset = thisTimeZone.getRawOffset() / 1000; int thisHour = thisOffset / 3600; int thisMinutes = (thisOffset % 3600) / 60; - String formatted = String.format("(GMT%+d:%02d) %s", thisHour, thisMinutes, thisTimeZone.getID()); + String formatted = String.format("(GMT%+d:%02d) %s", thisHour, thisMinutes, thisTimeZone.getID()); //NON-NLS // set the selected timezone timeZoneComboBox.setSelectedItem(formatted); @@ -331,7 +331,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { pcs.firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true); } catch (Exception ee) { - logger.log(Level.SEVERE, "ImageFilePanel listener threw exception", ee); + logger.log(Level.SEVERE, "ImageFilePanel listener threw exception", ee); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "ImageFilePanel.moduleErr"), NbBundle.getMessage(this.getClass(), "ImageFilePanel.moduleErr.msg"), MessageNotifyUtil.MessageType.ERROR); @@ -344,7 +344,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { pcs.firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true); } catch (Exception ee) { - logger.log(Level.SEVERE, "ImageFilePanel listener threw exception", ee); + logger.log(Level.SEVERE, "ImageFilePanel listener threw exception", ee); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "ImageFilePanel.moduleErr"), NbBundle.getMessage(this.getClass(), "ImageFilePanel.moduleErr.msg"), MessageNotifyUtil.MessageType.ERROR); @@ -358,7 +358,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener { pcs.firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true); } catch (Exception ee) { - logger.log(Level.SEVERE, "ImageFilePanel listener threw exception", ee); + logger.log(Level.SEVERE, "ImageFilePanel listener threw exception", ee); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "ImageFilePanel.moduleErr"), NbBundle.getMessage(this.getClass(), "ImageFilePanel.moduleErr.msg"), MessageNotifyUtil.MessageType.ERROR); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java index 3a5bcc8ab7..bc95b2f294 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalDiskPanel.java @@ -269,7 +269,7 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; int offset = zone.getRawOffset() / 1000; int hour = offset / 3600; int minutes = (offset % 3600) / 60; - String item = String.format("(GMT%+d:%02d) %s", hour, minutes, id); + String item = String.format("(GMT%+d:%02d) %s", hour, minutes, id); //NON-NLS /* * DateFormat dfm = new SimpleDateFormat("z"); @@ -287,7 +287,7 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; int thisOffset = thisTimeZone.getRawOffset() / 1000; int thisHour = thisOffset / 3600; int thisMinutes = (thisOffset % 3600) / 60; - String formatted = String.format("(GMT%+d:%02d) %s", thisHour, thisMinutes, thisTimeZone.getID()); + String formatted = String.format("(GMT%+d:%02d) %s", thisHour, thisMinutes, thisTimeZone.getID()); //NON-NLS // set the selected timezone timeZoneComboBox.setSelectedItem(formatted); @@ -337,7 +337,7 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; pcs.firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true); } catch (Exception e) { - logger.log(Level.SEVERE, "LocalDiskPanel listener threw exception", e); + logger.log(Level.SEVERE, "LocalDiskPanel listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "LocalDiskPanel.moduleErr"), NbBundle.getMessage(this.getClass(), "LocalDiskPanel.moduleErr.msg"), MessageNotifyUtil.MessageType.ERROR); @@ -439,11 +439,11 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; try { super.get(); //block and get all exceptions thrown while doInBackground() } catch (CancellationException ex) { - logger.log(Level.INFO, "Loading local disks was canceled, which should not be possible."); + logger.log(Level.INFO, "Loading local disks was canceled, which should not be possible."); //NON-NLS } catch (InterruptedException ex) { - logger.log(Level.INFO, "Loading local disks was interrupted."); + logger.log(Level.INFO, "Loading local disks was interrupted."); //NON-NLS } catch (Exception ex) { - logger.log(Level.SEVERE, "Fatal error when loading local disks", ex); + logger.log(Level.SEVERE, "Fatal error when loading local disks", ex); //NON-NLS } finally { if (!this.isCancelled()) { enableNext = false; @@ -460,7 +460,7 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; diskComboBox.setSelectedIndex(0); } } else { - logger.log(Level.INFO, "Loading local disks was canceled, which should not be possible."); + logger.log(Level.INFO, "Loading local disks was canceled, which should not be possible."); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java index c03c293c1a..256276809b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/LocalFilesPanel.java @@ -243,7 +243,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; pcs.firePropertyChange(DataSourceProcessor.DSP_PANEL_EVENT.UPDATE_UI.toString(), false, true); } catch (Exception e) { - logger.log(Level.SEVERE, "LocalFilesPanel listener threw exception", e); + logger.log(Level.SEVERE, "LocalFilesPanel listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "LocalFilesPanel.moduleErr"), NbBundle.getMessage(this.getClass(), "LocalFilesPanel.moduleErr.msg"), MessageNotifyUtil.MessageType.ERROR); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/MissingImageDialog.java b/Core/src/org/sleuthkit/autopsy/casemodule/MissingImageDialog.java index 4fa8224fc1..bcaa632245 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/MissingImageDialog.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/MissingImageDialog.java @@ -214,7 +214,7 @@ class MissingImageDialog extends javax.swing.JDialog { .addContainerGap(62, Short.MAX_VALUE)) ); - titleLabel.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N + titleLabel.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(titleLabel, org.openide.util.NbBundle.getMessage(MissingImageDialog.class, "MissingImageDialog.titleLabel.text")); // NOI18N titleSeparator.setForeground(new java.awt.Color(102, 102, 102)); @@ -256,7 +256,7 @@ class MissingImageDialog extends javax.swing.JDialog { //TODO handle local files db.setImagePaths(obj_id, Arrays.asList(new String[]{newPath})); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Error setting image paths", ex); + logger.log(Level.WARNING, "Error setting image paths", ex); //NON-NLS } this.dispose(); }//GEN-LAST:event_selectButtonActionPerformed diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java index d1faa81e7d..c23faecd1e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java @@ -95,7 +95,7 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener{ jLabel2 = new javax.swing.JLabel(); caseDirTextField = new javax.swing.JTextField(); - jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.jLabel1.text_1")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(caseNameLabel, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.caseNameLabel.text_1")); // NOI18N diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel2.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel2.java index d5180fdcce..02db0ba2f0 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel2.java @@ -71,7 +71,7 @@ import org.openide.util.NbBundle; examinerLabel.setText(org.openide.util.NbBundle.getMessage(NewCaseVisualPanel2.class, "NewCaseVisualPanel2.examinerLabel.text")); // NOI18N - optionalLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + optionalLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N NON-NLS optionalLabel.setText(org.openide.util.NbBundle.getMessage(NewCaseVisualPanel2.class, "NewCaseVisualPanel2.optionalLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index a5093c5230..6fded53a73 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -67,7 +67,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; Case.getCurrentCase().closeCase(); // close the current case newCaseAction(); // start the new case creation process } catch (Exception ex) { - Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); + Logger.getLogger(NewCaseWizardAction.class.getName()).log(Level.WARNING, "Error closing case.", ex); //NON-NLS } } } else { @@ -101,9 +101,9 @@ import org.sleuthkit.autopsy.coreutils.Logger; // if Cancel button is pressed if (isCancelled) { - String createdDirectory = (String) wizardDescriptor.getProperty("createdDirectory"); + String createdDirectory = (String) wizardDescriptor.getProperty("createdDirectory"); //NON-NLS if(createdDirectory != null) { - logger.log(Level.INFO, "Deleting a created case directory due to isCancelled set, dir: " + createdDirectory); + logger.log(Level.INFO, "Deleting a created case directory due to isCancelled set, dir: " + createdDirectory); //NON-NLS Case.deleteCaseDirectory(new File(createdDirectory)); } // if there's case opened, close the case diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java index 8bbc242059..1c0a934a2f 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java @@ -51,7 +51,7 @@ class NewCaseWizardPanel1 implements WizardDescriptor.ValidatingPanel 2) { - logger.log(Level.WARNING, "More than 2 (" + windowsCount + ") start up windows discovered, will use the first custom one"); + logger.log(Level.WARNING, "More than 2 (" + windowsCount + ") start up windows discovered, will use the first custom one"); //NON-NLS } else if (windowsCount == 1) { startupWindowToUse = startupWindows.iterator().next(); - logger.log(Level.INFO, "Will use the default startup window: " + startupWindowToUse.toString()); + logger.log(Level.INFO, "Will use the default startup window: " + startupWindowToUse.toString()); //NON-NLS } else { //pick the non default one Iterator it = startupWindows.iterator(); @@ -70,14 +70,14 @@ public class StartupWindowProvider implements StartupWindowInterface { StartupWindowInterface window = it.next(); if (!org.sleuthkit.autopsy.casemodule.StartupWindow.class.isInstance(window)) { startupWindowToUse = window; - logger.log(Level.INFO, "Will use the custom startup window: " + startupWindowToUse.toString()); + logger.log(Level.INFO, "Will use the custom startup window: " + startupWindowToUse.toString()); //NON-NLS break; } } if (startupWindowToUse == null) { - logger.log(Level.SEVERE, "Unexpected error, no custom startup window found, using the default"); + logger.log(Level.SEVERE, "Unexpected error, no custom startup window found, using the default"); //NON-NLS startupWindowToUse = new org.sleuthkit.autopsy.casemodule.StartupWindow(); } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java b/Core/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java index 7fc760463c..0776e34b42 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java @@ -48,32 +48,32 @@ import org.xml.sax.SAXException; */ class XMLCaseManagement implements CaseConfigFileInterface { - final static String XSDFILE = "CaseSchema.xsd"; - final static String TOP_ROOT_NAME = "AutopsyCase"; - final static String CASE_ROOT_NAME = "Case"; + final static String XSDFILE = "CaseSchema.xsd"; //NON-NLS + final static String TOP_ROOT_NAME = "AutopsyCase"; //NON-NLS + final static String CASE_ROOT_NAME = "Case"; //NON-NLS // general metadata about the case file - final static String NAME = "Name"; - final static String NUMBER = "Number"; - final static String EXAMINER = "Examiner"; - final static String CREATED_DATE_NAME = "CreatedDate"; - final static String MODIFIED_DATE_NAME = "ModifiedDate"; - final static String SCHEMA_VERSION_NAME = "SchemaVersion"; - final static String AUTOPSY_CRVERSION_NAME = "AutopsyCreatedVersion"; - final static String AUTOPSY_MVERSION_NAME = "AutopsySavedVersion"; + final static String NAME = "Name"; //NON-NLS + final static String NUMBER = "Number"; //NON-NLS + final static String EXAMINER = "Examiner"; //NON-NLS + final static String CREATED_DATE_NAME = "CreatedDate"; //NON-NLS + final static String MODIFIED_DATE_NAME = "ModifiedDate"; //NON-NLS + final static String SCHEMA_VERSION_NAME = "SchemaVersion"; //NON-NLS + final static String AUTOPSY_CRVERSION_NAME = "AutopsyCreatedVersion"; //NON-NLS + final static String AUTOPSY_MVERSION_NAME = "AutopsySavedVersion"; //NON-NLS // folders inside case directory - final static String LOG_FOLDER_NAME = "LogFolder"; - final static String LOG_FOLDER_RELPATH = "Log"; - final static String TEMP_FOLDER_NAME = "TempFolder"; - final static String TEMP_FOLDER_RELPATH = "Temp"; - final static String EXPORT_FOLDER_NAME = "ExportFolder"; - final static String EXPORT_FOLDER_RELPATH = "Export"; - final static String CACHE_FOLDER_NAME = "CacheFolder"; - final static String CACHE_FOLDER_RELPATH = "Cache"; + final static String LOG_FOLDER_NAME = "LogFolder"; //NON-NLS + final static String LOG_FOLDER_RELPATH = "Log"; //NON-NLS + final static String TEMP_FOLDER_NAME = "TempFolder"; //NON-NLS + final static String TEMP_FOLDER_RELPATH = "Temp"; //NON-NLS + final static String EXPORT_FOLDER_NAME = "ExportFolder"; //NON-NLS + final static String EXPORT_FOLDER_RELPATH = "Export"; //NON-NLS + final static String CACHE_FOLDER_NAME = "CacheFolder"; //NON-NLS + final static String CACHE_FOLDER_RELPATH = "Cache"; //NON-NLS // folders attribute - final static String RELATIVE_NAME = "Relative"; // relevant path info + final static String RELATIVE_NAME = "Relative"; // relevant path info NON-NLS // folder attr values - final static String RELATIVE_TRUE = "true"; // if it's a relative path - final static String RELATIVE_FALSE = "false"; // if it's not a relative path + final static String RELATIVE_TRUE = "true"; // if it's a relative path NON-NLS + final static String RELATIVE_FALSE = "false"; // if it's not a relative path NON-NLS // the document private Document doc; // general info @@ -504,22 +504,22 @@ import org.xml.sax.SAXException; Element exportElement = doc.createElement(EXPORT_FOLDER_NAME); // ... exportElement.appendChild(doc.createTextNode(EXPORT_FOLDER_RELPATH)); - exportElement.setAttribute(RELATIVE_NAME, "true"); + exportElement.setAttribute(RELATIVE_NAME, "true"); //NON-NLS caseElement.appendChild(exportElement); Element logElement = doc.createElement(LOG_FOLDER_NAME); // ... logElement.appendChild(doc.createTextNode(LOG_FOLDER_RELPATH)); - logElement.setAttribute(RELATIVE_NAME, "true"); + logElement.setAttribute(RELATIVE_NAME, "true"); //NON-NLS caseElement.appendChild(logElement); Element tempElement = doc.createElement(TEMP_FOLDER_NAME); // ... tempElement.appendChild(doc.createTextNode(TEMP_FOLDER_RELPATH)); - tempElement.setAttribute(RELATIVE_NAME, "true"); + tempElement.setAttribute(RELATIVE_NAME, "true"); //NON-NLS caseElement.appendChild(tempElement); Element cacheElement = doc.createElement(CACHE_FOLDER_NAME); // ... cacheElement.appendChild(doc.createTextNode(CACHE_FOLDER_RELPATH)); - cacheElement.setAttribute(RELATIVE_NAME, "true"); + cacheElement.setAttribute(RELATIVE_NAME, "true"); //NON-NLS caseElement.appendChild(cacheElement); // write more code if needed ... @@ -551,19 +551,19 @@ import org.xml.sax.SAXException; try { xformer = tfactory.newTransformer(); } catch (TransformerConfigurationException ex) { - logger.log(Level.SEVERE, "Could not setup tranformer and write case file"); + logger.log(Level.SEVERE, "Could not setup tranformer and write case file"); //NON-NLS throw new CaseActionException( NbBundle.getMessage(this.getClass(), "XMLCaseManagement.writeFile.exception.errWriteToFile.msg"), ex); } //Setup indenting to "pretty print" - xformer.setOutputProperty(OutputKeys.INDENT, "yes"); - xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); + xformer.setOutputProperty(OutputKeys.INDENT, "yes"); //NON-NLS + xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //NON-NLS try { xformer.transform(source, result); } catch (TransformerException ex) { - logger.log(Level.SEVERE, "Could not run tranformer and write case file"); + logger.log(Level.SEVERE, "Could not run tranformer and write case file"); //NON-NLS throw new CaseActionException( NbBundle.getMessage(this.getClass(), "XMLCaseManagement.writeFile.exception.errWriteToFile.msg"), ex); } @@ -579,7 +579,7 @@ import org.xml.sax.SAXException; bw.flush(); bw.close(); } catch (IOException ex) { - logger.log(Level.SEVERE, "Error writing to case file"); + logger.log(Level.SEVERE, "Error writing to case file"); //NON-NLS throw new CaseActionException("Error writing to case file", ex); } } @@ -620,7 +620,7 @@ import org.xml.sax.SAXException; doc.getDocumentElement().normalize(); if (!XMLUtil.xmlIsValid(doc, XMLCaseManagement.class, XSDFILE)) { - logger.log(Level.WARNING, "Could not validate against [" + XSDFILE + "], results may not accurate"); + logger.log(Level.WARNING, "Could not validate against [" + XSDFILE + "], results may not accurate"); //NON-NLS } Element rootEl = doc.getDocumentElement(); diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle.properties index 1f19d672ab..5242f90667 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle.properties @@ -13,4 +13,5 @@ FileManager.addLocalDirInt.exception.notReadable.msg=Attempted to add a local di FileManager.addLocalDirInt2.exception.closed.msg=Attempted to use FileManager after it was closed. TagsManager.addContentTag.exception.beginByteOffsetOOR.msg=beginByteOffset \= {0} out of content size range (0 - {1}) TagsManager.addContentTag.exception.endByteOffsetOOR.msg=endByteOffset \= {0} out of content size range (0 - {1}) -TagsManager.addContentTag.exception.endLTbegin.msg=endByteOffset < beginByteOffset \ No newline at end of file +TagsManager.addContentTag.exception.endLTbegin.msg=endByteOffset < beginByteOffset +TagsManager.predefTagNames.bookmark.text=Bookmark \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle_ja.properties index b715968f2b..5645e83cfe 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle_ja.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle_ja.properties @@ -13,4 +13,5 @@ FileManager.addLocalDirInt.exception.notReadable.msg=\u8AAD\u307F\u53D6\u308A\u3 FileManager.addLocalDirInt2.exception.closed.msg=FileManager\u3092\u9589\u3058\u305F\u5F8C\u306B\u4F7F\u7528\u3092\u8A66\u307F\u307E\u3057\u305F\u3002 TagsManager.addContentTag.exception.beginByteOffsetOOR.msg=beginByteOffset \= {0} \u30B3\u30F3\u30C6\u30F3\u30C4\u30B5\u30A4\u30BA\u7BC4\u56F2(0 - {1})\u306E\u5916\u3067\u3059 TagsManager.addContentTag.exception.endByteOffsetOOR.msg=endByteOffset \= {0} \u30B3\u30F3\u30C6\u30F3\u30C4\u30B5\u30A4\u30BA\u7BC4\u56F2(0 - {1})\u306E\u5916\u3067\u3059 -TagsManager.addContentTag.exception.endLTbegin.msg=endByteOffset < beginByteOffset \ No newline at end of file +TagsManager.addContentTag.exception.endLTbegin.msg=endByteOffset < beginByteOffset +TagsManager.predefTagNames.bookmark.text=\u30D6\u30C3\u30AF\u30DE\u30FC\u30AF \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java index a43498435c..2b1887adc5 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java @@ -73,7 +73,7 @@ public class FileManager implements Closeable { } } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error initializing FileManager and getting number of local file sets"); + logger.log(Level.SEVERE, "Error initializing FileManager and getting number of local file sets"); //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java index 0b49ed8c99..219234a84f 100755 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java @@ -42,8 +42,8 @@ import org.sleuthkit.datamodel.TskCoreException; * blackboard artifacts by users. */ public class TagsManager implements Closeable { - private static final String TAGS_SETTINGS_NAME = "Tags"; - private static final String TAG_NAMES_SETTING_KEY = "TagNames"; + private static final String TAGS_SETTINGS_NAME = "Tags"; //NON-NLS + private static final String TAG_NAMES_SETTING_KEY = "TagNames"; //NON-NLS private final SleuthkitCase tskCase; private final HashMap uniqueTagNames = new HashMap<>(); private boolean tagNamesInitialized = false; // @@@ This is part of a work around to be removed when database access on the EDT is correctly synchronized. @@ -415,7 +415,7 @@ public class TagsManager implements Closeable { } } catch (TskCoreException ex) { - Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to get tag types from the current case", ex); + Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to get tag types from the current case", ex); //NON-NLS } } @@ -435,7 +435,7 @@ public class TagsManager implements Closeable { uniqueTagNames.put(tagName.getDisplayName(), tagName); } catch (TskCoreException ex) { - Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to add saved tag name " + tagNameAttributes[0], ex); + Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to add saved tag name " + tagNameAttributes[0], ex); //NON-NLS } } } @@ -443,13 +443,14 @@ public class TagsManager implements Closeable { } private void getPredefinedTagNames() { - if (!uniqueTagNames.containsKey("Bookmark")) { + if (!uniqueTagNames.containsKey(NbBundle.getMessage(this.getClass(), "TagsManager.predefTagNames.bookmark.text"))) { try { - TagName tagName = tskCase.addTagName("Bookmark", "", TagName.HTML_COLOR.NONE); + TagName tagName = tskCase.addTagName( + NbBundle.getMessage(this.getClass(), "TagsManager.predefTagNames.bookmark.text"), "", TagName.HTML_COLOR.NONE); uniqueTagNames.put(tagName.getDisplayName(), tagName); } catch (TskCoreException ex) { - Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to add predefined 'Bookmark' tag name", ex); + Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to add predefined 'Bookmark' tag name", ex); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Metadata.java b/Core/src/org/sleuthkit/autopsy/contentviewers/Metadata.java index ab29df1d2b..5f4ed40e26 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Metadata.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Metadata.java @@ -100,23 +100,23 @@ public class Metadata extends javax.swing.JPanel implements DataContentViewer } private void setText(String str) { - jTextPane1.setText("" + str + ""); + jTextPane1.setText("" + str + ""); //NON-NLS } private void startTable(StringBuilder sb) { - sb.append(""); + sb.append("
"); //NON-NLS } private void endTable(StringBuilder sb) { - sb.append("
"); + sb.append(""); //NON-NLS } private void addRow(StringBuilder sb, String key, String value) { - sb.append(""); + sb.append(""); //NON-NLS sb.append(key); - sb.append(""); + sb.append(""); //NON-NLS sb.append(value); - sb.append(""); + sb.append(""); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/contentviewers/Utilities.java b/Core/src/org/sleuthkit/autopsy/contentviewers/Utilities.java index 152034d174..456471e22c 100755 --- a/Core/src/org/sleuthkit/autopsy/contentviewers/Utilities.java +++ b/Core/src/org/sleuthkit/autopsy/contentviewers/Utilities.java @@ -29,7 +29,7 @@ import javax.swing.text.html.StyleSheet; public class Utilities { public static void configureTextPaneAsHtml(JTextPane pane) { - pane.setContentType("text/html;charset=UTF-8"); + pane.setContentType("text/html;charset=UTF-8"); //NON-NLS HTMLEditorKit kit = new HTMLEditorKit(); pane.setEditorKit(kit); StyleSheet styleSheet = kit.getStyleSheet(); @@ -40,11 +40,11 @@ public class Utilities { * method that sets consistent styles for all viewers and takes font * size as an argument. */ - styleSheet.addRule("body {font-family:Arial;font-size:14pt;}"); - styleSheet.addRule("p {font-family:Arial;font-size:14pt;}"); - styleSheet.addRule("li {font-family:Arial;font-size:14pt;}"); - styleSheet.addRule("td {font-family:Arial;font-size:14pt;overflow:hidden;padding-right:5px;padding-left:5px;}"); - styleSheet.addRule("th {font-family:Arial;font-size:14pt;overflow:hidden;padding-right:5px;padding-left:5px;font-weight:bold;}"); - styleSheet.addRule("p {font-family:Arial;font-size:14pt;}"); + styleSheet.addRule("body {font-family:Arial;font-size:14pt;}"); //NON-NLS + styleSheet.addRule("p {font-family:Arial;font-size:14pt;}"); //NON-NLS + styleSheet.addRule("li {font-family:Arial;font-size:14pt;}"); //NON-NLS + styleSheet.addRule("td {font-family:Arial;font-size:14pt;overflow:hidden;padding-right:5px;padding-left:5px;}"); //NON-NLS + styleSheet.addRule("th {font-family:Arial;font-size:14pt;overflow:hidden;padding-right:5px;padding-left:5px;font-weight:bold;}"); //NON-NLS + styleSheet.addRule("p {font-family:Arial;font-size:14pt;}"); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/core/Installer.java b/Core/src/org/sleuthkit/autopsy/core/Installer.java index 66a132114b..025bbb9101 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/core/Installer.java @@ -61,31 +61,31 @@ public class Installer extends ModuleInstall { //Note: if shipping with a different CRT version, this will only print a warning //and try to use linker mechanism to find the correct versions of libs. //We should update this if we officially switch to a new version of CRT/compiler - System.loadLibrary("msvcr100"); - System.loadLibrary("msvcp100"); - logger.log(Level.INFO, "MS CRT libraries loaded"); + System.loadLibrary("msvcr100"); //NON-NLS + System.loadLibrary("msvcp100"); //NON-NLS + logger.log(Level.INFO, "MS CRT libraries loaded"); //NON-NLS } catch (UnsatisfiedLinkError e) { - logger.log(Level.SEVERE, "Error loading ms crt libraries, ", e); + logger.log(Level.SEVERE, "Error loading ms crt libraries, ", e); //NON-NLS } try { - System.loadLibrary("zlib"); - logger.log(Level.INFO, "ZLIB library loaded loaded"); + System.loadLibrary("zlib"); //NON-NLS + logger.log(Level.INFO, "ZLIB library loaded loaded"); //NON-NLS } catch (UnsatisfiedLinkError e) { - logger.log(Level.SEVERE, "Error loading ZLIB library, ", e); + logger.log(Level.SEVERE, "Error loading ZLIB library, ", e); //NON-NLS } try { - System.loadLibrary("libewf"); - logger.log(Level.INFO, "EWF library loaded"); + System.loadLibrary("libewf"); //NON-NLS + logger.log(Level.INFO, "EWF library loaded"); //NON-NLS } catch (UnsatisfiedLinkError e) { - logger.log(Level.SEVERE, "Error loading EWF library, ", e); + logger.log(Level.SEVERE, "Error loading EWF library, ", e); //NON-NLS } } } public Installer() { - logger.log(Level.INFO, "core installer created"); + logger.log(Level.INFO, "core installer created"); //NON-NLS javaFxInit = false; packageInstallers = new ArrayList(); @@ -132,12 +132,12 @@ public class Installer extends ModuleInstall { public void restored() { super.restored(); - logger.log(Level.INFO, "restored()"); + logger.log(Level.INFO, "restored()"); //NON-NLS initJavaFx(); for (ModuleInstall mi : packageInstallers) { - logger.log(Level.INFO, mi.getClass().getName() + " restored()"); + logger.log(Level.INFO, mi.getClass().getName() + " restored()"); //NON-NLS try { mi.restored(); } catch (Exception e) { @@ -151,9 +151,9 @@ public class Installer extends ModuleInstall { public void validate() throws IllegalStateException { super.validate(); - logger.log(Level.INFO, "validate()"); + logger.log(Level.INFO, "validate()"); //NON-NLS for (ModuleInstall mi : packageInstallers) { - logger.log(Level.INFO, mi.getClass().getName() + " validate()"); + logger.log(Level.INFO, mi.getClass().getName() + " validate()"); //NON-NLS try { mi.validate(); } catch (Exception e) { @@ -166,10 +166,10 @@ public class Installer extends ModuleInstall { public void uninstalled() { super.uninstalled(); - logger.log(Level.INFO, "uninstalled()"); + logger.log(Level.INFO, "uninstalled()"); //NON-NLS for (ModuleInstall mi : packageInstallers) { - logger.log(Level.INFO, mi.getClass().getName() + " uninstalled()"); + logger.log(Level.INFO, mi.getClass().getName() + " uninstalled()"); //NON-NLS try { mi.uninstalled(); } catch (Exception e) { @@ -185,7 +185,7 @@ public class Installer extends ModuleInstall { public void close() { super.close(); - logger.log(Level.INFO, "close()"); + logger.log(Level.INFO, "close()"); //NON-NLS //exit JavaFx plat if (javaFxInit) { @@ -193,7 +193,7 @@ public class Installer extends ModuleInstall { } for (ModuleInstall mi : packageInstallers) { - logger.log(Level.INFO, mi.getClass().getName() + " close()"); + logger.log(Level.INFO, mi.getClass().getName() + " close()"); //NON-NLS try { mi.close(); } catch (Exception e) { diff --git a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/BlackboardResultViewer.java b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/BlackboardResultViewer.java index ce6da4caef..b487e093d5 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/BlackboardResultViewer.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/BlackboardResultViewer.java @@ -30,7 +30,7 @@ import org.sleuthkit.datamodel.BlackboardArtifact; */ public interface BlackboardResultViewer { - public static final String FINISHED_DISPLAY_EVT = "FINISHED_DISPLAY_EVT"; + public static final String FINISHED_DISPLAY_EVT = "FINISHED_DISPLAY_EVT"; //NON-NLS /** diff --git a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/CoreComponentControl.java b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/CoreComponentControl.java index 43b3c63629..3f93665b11 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/CoreComponentControl.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/CoreComponentControl.java @@ -55,11 +55,11 @@ public class CoreComponentControl { Collection dataExplorers = Lookup.getDefault().lookupAll(DataExplorer.class); for (DataExplorer de : dataExplorers) { TopComponent explorerWin = de.getTopComponent(); - Mode m = WindowManager.getDefault().findMode("explorer"); + Mode m = WindowManager.getDefault().findMode("explorer"); //NON-NLS if (m != null) { m.dockInto(explorerWin); // redock into the explorer mode } else { - logger.log(Level.WARNING, "Could not find explorer mode and dock explorer window"); + logger.log(Level.WARNING, "Could not find explorer mode and dock explorer window"); //NON-NLS } explorerWin.open(); // open that top component } @@ -70,7 +70,7 @@ public class CoreComponentControl { if (m != null) { m.dockInto(contentWin); // redock into the output mode } else { - logger.log(Level.WARNING, "Could not find output mode and dock content window"); + logger.log(Level.WARNING, "Could not find output mode and dock content window"); //NON-NLS } contentWin.open(); // open that top component @@ -98,7 +98,7 @@ public class CoreComponentControl { for (TopComponent tc : mode.getTopComponents()) { tcName = tc.getName(); if (tcName == null) { - logger.log(Level.INFO, "tcName was null"); + logger.log(Level.INFO, "tcName was null"); //NON-NLS tcName = ""; } // switch requires constant strings, so converted to if/else. diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AboutWindowPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/AboutWindowPanel.java index d179e3ba5b..deecdb0b4f 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AboutWindowPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/AboutWindowPanel.java @@ -93,7 +93,7 @@ public class AboutWindowPanel extends JPanel implements HyperlinkListener { jScrollPane3.setBorder(null); copyright.setBorder(null); - copyright.setContentType("text/html"); // NOI18N + copyright.setContentType("text/html"); // NOI18N NON-NLS copyright.setEditable(false); copyright.setText(org.openide.util.NbBundle.getBundle(AboutWindowPanel.class).getString("LBL_Copyright")); // NOI18N copyright.addMouseListener(new java.awt.event.MouseAdapter() { @@ -103,7 +103,7 @@ public class AboutWindowPanel extends JPanel implements HyperlinkListener { }); jScrollPane3.setViewportView(copyright); - description.setContentType("text/html"); // NOI18N + description.setContentType("text/html"); // NOI18N NON-NLS description.setEditable(false); jScrollPane2.setViewportView(description); @@ -208,7 +208,7 @@ private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:eve private void showUrl() { if (url != null) { org.openide.awt.StatusDisplayer.getDefault().setStatusText( - NbBundle.getBundle(HTMLViewAction.class).getString("CTL_OpeningBrowser")); + NbBundle.getBundle(HTMLViewAction.class).getString("CTL_OpeningBrowser")); //NON-NLS HtmlBrowser.URLDisplayer.getDefault().showURL(url); } } @@ -219,25 +219,25 @@ private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:eve private static String getProductVersionValue() { return MessageFormat.format( - NbBundle.getBundle("org.netbeans.core.startup.Bundle").getString("currentVersion"), + NbBundle.getBundle("org.netbeans.core.startup.Bundle").getString("currentVersion"), //NON-NLS new Object[]{System.getProperty("netbeans.buildnumber")}); } private static String getOperatingSystemValue() { return NbBundle.getMessage(AboutWindowPanel.class, "Format_OperatingSystem_Value", - System.getProperty("os.name", + System.getProperty("os.name", //NON-NLS NbBundle.getMessage(AboutWindowPanel.class, "ProductInformationPanel.propertyUnknown.text")), - System.getProperty("os.version", + System.getProperty("os.version", //NON-NLS NbBundle.getMessage(AboutWindowPanel.class, "ProductInformationPanel.propertyUnknown.text")), - System.getProperty("os.arch", + System.getProperty("os.arch", //NON-NLS NbBundle.getMessage(AboutWindowPanel.class, "ProductInformationPanel.propertyUnknown.text"))); } private static String getJavaValue() { - return System.getProperty("java.version", + return System.getProperty("java.version", //NON-NLS NbBundle.getMessage(AboutWindowPanel.class, "ProductInformationPanel.propertyUnknown.text")); } @@ -245,10 +245,10 @@ private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:eve private static String getVMValue() { return NbBundle.getMessage(AboutWindowPanel.class, "ProductInformationPanel.getVMValue.text", - System.getProperty("java.vm.name", + System.getProperty("java.vm.name", //NON-NLS NbBundle.getMessage(AboutWindowPanel.class, "ProductInformationPanel.propertyUnknown.text")), - System.getProperty("java.vm.version", "")); + System.getProperty("java.vm.version", "")); //NON-NLS } private static String getSystemLocaleValue() { @@ -261,7 +261,7 @@ private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:eve } private static String getEncodingValue() { - return System.getProperty("file.encoding", + return System.getProperty("file.encoding", //NON-NLS NbBundle.getMessage(AboutWindowPanel.class, "ProductInformationPanel.propertyUnknown.text")); } @@ -283,7 +283,7 @@ private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:eve */ public void startVerboseLogging() { verboseLogging = true; - String logPath = PlatformUtil.getUserDirectory() + File.separator + "sleuthkit.txt"; + String logPath = PlatformUtil.getUserDirectory() + File.separator + "sleuthkit.txt"; //NON-NLS SleuthkitJNI.startVerboseLogging(logPath); } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AbstractDataResultViewer.java b/Core/src/org/sleuthkit/autopsy/corecomponents/AbstractDataResultViewer.java index ece4ce5565..782f38ec5e 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AbstractDataResultViewer.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/AbstractDataResultViewer.java @@ -111,7 +111,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; try { this.em.setSelectedNodes(selected); } catch (PropertyVetoException ex) { - logger.log(Level.WARNING, "Couldn't set selected nodes.", ex); + logger.log(Level.WARNING, "Couldn't set selected nodes.", ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentPanel.java index 6f1a061d52..f04a485a12 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentPanel.java @@ -132,7 +132,7 @@ import org.sleuthkit.datamodel.TskCoreException; try { path = content.getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Exception while calling Content.getUniquePath() for {0}", content); + logger.log(Level.SEVERE, "Exception while calling Content.getUniquePath() for {0}", content); //NON-NLS } setName(path); } else { @@ -164,7 +164,7 @@ import org.sleuthkit.datamodel.TskCoreException; // get the preference for the preferred viewer Preferences pref = NbPreferences.forModule(GeneralPanel.class); - boolean keepCurrentViewer = pref.getBoolean("keepPreferredViewer", false); + boolean keepCurrentViewer = pref.getBoolean("keepPreferredViewer", false); //NON-NLS int currTabIndex = jTabbedPane1.getSelectedIndex(); int totalTabs = jTabbedPane1.getTabCount(); diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java index 4091980ab2..a972c4bf0d 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java @@ -52,7 +52,7 @@ public final class DataContentTopComponent extends TopComponent implements DataC // contains a list of the undocked TCs private static ArrayList newWindowList = new ArrayList(); - private static final String PREFERRED_ID = "DataContentTopComponent"; + private static final String PREFERRED_ID = "DataContentTopComponent"; //NON-NLS private static final String DEFAULT_NAME = NbBundle.getMessage(DataContentTopComponent.class, "CTL_DataContentTopComponent"); private static final String TOOLTIP_TEXT = NbBundle.getMessage(DataContentTopComponent.class, "HINT_DataContentTopComponent"); @@ -67,7 +67,7 @@ public final class DataContentTopComponent extends TopComponent implements DataC add(dataContentPanel); putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.valueOf(isDefault)); // prevent option to close compoment in GUI - logger.log(Level.INFO, "Created DataContentTopComponent instance: " + this); + logger.log(Level.INFO, "Created DataContentTopComponent instance: " + this); //NON-NLS } /** @@ -119,15 +119,15 @@ public final class DataContentTopComponent extends TopComponent implements DataC public static synchronized DataContentTopComponent findInstance() { TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID); if (win == null) { - logger.warning("Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system."); + logger.warning("Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system."); //NON-NLS return getDefault(); } if (win instanceof DataContentTopComponent) { return (DataContentTopComponent) win; } logger.warning( - "There seem to be multiple components with the '" + PREFERRED_ID - + "' ID. That is a potential source of errors and unexpected behavior."); + "There seem to be multiple components with the '" + PREFERRED_ID //NON-NLS + + "' ID. That is a potential source of errors and unexpected behavior."); //NON-NLS return getDefault(); } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java index 4cc0e394a6..0805bd9e1c 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java @@ -106,7 +106,7 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat jPanel1.setPreferredSize(new java.awt.Dimension(622, 424)); outputViewPane.setEditable(false); - outputViewPane.setFont(new java.awt.Font("Courier New", 0, 11)); // NOI18N + outputViewPane.setFont(new java.awt.Font("Courier New", 0, 11)); // NOI18N NON-NLS outputViewPane.setPreferredSize(new java.awt.Dimension(700, 400)); jScrollPane1.setViewportView(outputViewPane); @@ -124,14 +124,14 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat pageLabel.setMinimumSize(new java.awt.Dimension(33, 14)); pageLabel.setPreferredSize(new java.awt.Dimension(33, 14)); - nextPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N + nextPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N NON-NLS nextPageButton.setText(org.openide.util.NbBundle.getMessage(DataContentViewerArtifact.class, "DataContentViewerArtifact.nextPageButton.text")); // NOI18N nextPageButton.setBorderPainted(false); nextPageButton.setContentAreaFilled(false); - nextPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N + nextPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N NON-NLS nextPageButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); nextPageButton.setPreferredSize(new java.awt.Dimension(23, 23)); - nextPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png"))); // NOI18N + nextPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png"))); // NOI18N NON-NLS nextPageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nextPageButtonActionPerformed(evt); @@ -143,14 +143,14 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat pageLabel2.setMinimumSize(new java.awt.Dimension(29, 14)); pageLabel2.setPreferredSize(new java.awt.Dimension(29, 14)); - prevPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N + prevPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N NON-NLS prevPageButton.setText(org.openide.util.NbBundle.getMessage(DataContentViewerArtifact.class, "DataContentViewerArtifact.prevPageButton.text")); // NOI18N prevPageButton.setBorderPainted(false); prevPageButton.setContentAreaFilled(false); - prevPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N + prevPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N NON-NLS prevPageButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); prevPageButton.setPreferredSize(new java.awt.Dimension(23, 23)); - prevPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png"))); // NOI18N + prevPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png"))); // NOI18N NON-NLS prevPageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { prevPageButtonActionPerformed(evt); @@ -325,7 +325,7 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat return content.getAllArtifactsCount() > 0; } catch (TskException ex) { - logger.log(Level.WARNING, "Couldn't get count of BlackboardArtifacts for content", ex); + logger.log(Level.WARNING, "Couldn't get count of BlackboardArtifacts for content", ex); //NON-NLS } } return false; @@ -450,7 +450,7 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat artifacts = content.getAllArtifacts(); } catch (TskException ex) { - logger.log(Level.WARNING, "Couldn't get artifacts", ex); + logger.log(Level.WARNING, "Couldn't get artifacts", ex); //NON-NLS return new ViewUpdate(getArtifactContentStrings().size(), currentPage, ERROR_TEXT); } @@ -493,7 +493,7 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Couldn't get associated artifact to display in Content Viewer.", ex); + logger.log(Level.WARNING, "Couldn't get associated artifact to display in Content Viewer.", ex); //NON-NLS } } @@ -530,7 +530,7 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat } } catch (InterruptedException | ExecutionException ex) { - logger.log(Level.WARNING, "Artifact display task unexpectedly interrupted or failed", ex); + logger.log(Level.WARNING, "Artifact display task unexpectedly interrupted or failed", ex); //NON-NLS } } } @@ -577,7 +577,7 @@ public class DataContentViewerArtifact extends javax.swing.JPanel implements Dat } } catch (InterruptedException | ExecutionException ex) { - logger.log(Level.WARNING, "Artifact display task unexpectedly interrupted or failed", ex); + logger.log(Level.WARNING, "Artifact display task unexpectedly interrupted or failed", ex); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java index fbf63346fb..b1d5d2bb2f 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java @@ -56,7 +56,7 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont initComponents(); customizeComponents(); this.resetComponent(); - logger.log(Level.INFO, "Created HexView instance: " + this); + logger.log(Level.INFO, "Created HexView instance: " + this); //NON-NLS } private void customizeComponents() { @@ -114,7 +114,7 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont jScrollPane1.setBackground(new java.awt.Color(255, 255, 255)); outputViewPane.setEditable(false); - outputViewPane.setFont(new java.awt.Font("Courier New", 0, 11)); // NOI18N + outputViewPane.setFont(new java.awt.Font("Courier New", 0, 11)); // NOI18N NON-NLS outputViewPane.setMinimumSize(new java.awt.Dimension(700, 20)); outputViewPane.setPreferredSize(new java.awt.Dimension(700, 400)); jScrollPane1.setViewportView(outputViewPane); @@ -133,28 +133,28 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont pageLabel.setMinimumSize(new java.awt.Dimension(33, 14)); pageLabel.setPreferredSize(new java.awt.Dimension(33, 14)); - prevPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N + prevPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N NON-NLS prevPageButton.setText(org.openide.util.NbBundle.getMessage(DataContentViewerHex.class, "DataContentViewerHex.prevPageButton.text")); // NOI18N prevPageButton.setBorderPainted(false); prevPageButton.setContentAreaFilled(false); - prevPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N + prevPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N NON-NLS prevPageButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); prevPageButton.setPreferredSize(new java.awt.Dimension(23, 23)); - prevPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png"))); // NOI18N + prevPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png"))); // NOI18N NON-NLS prevPageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { prevPageButtonActionPerformed(evt); } }); - nextPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N + nextPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N NON-NLS nextPageButton.setText(org.openide.util.NbBundle.getMessage(DataContentViewerHex.class, "DataContentViewerHex.nextPageButton.text")); // NOI18N nextPageButton.setBorderPainted(false); nextPageButton.setContentAreaFilled(false); - nextPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N + nextPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N NON-NLS nextPageButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); nextPageButton.setPreferredSize(new java.awt.Dimension(23, 23)); - nextPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png"))); // NOI18N + nextPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png"))); // NOI18N NON-NLS nextPageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nextPageButtonActionPerformed(evt); @@ -318,7 +318,7 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont } catch (TskException ex) { errorText = NbBundle.getMessage(this.getClass(), "DataContentViewerHex.setDataView.errorText", offset, offset + pageLength); - logger.log(Level.WARNING, "Error while trying to show the hex content.", ex); + logger.log(Level.WARNING, "Error while trying to show the hex content.", ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerMedia.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerMedia.java index d7a2c63814..02a9fa7ca6 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerMedia.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerMedia.java @@ -21,7 +21,9 @@ package org.sleuthkit.autopsy.corecomponents; import java.awt.CardLayout; import java.awt.Component; import java.awt.Dimension; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import java.util.logging.Level; import javax.imageio.ImageIO; @@ -33,6 +35,8 @@ import org.openide.util.lookup.ServiceProviders; import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer; import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.datamodel.AbstractFile; +import org.sleuthkit.datamodel.BlackboardAttribute; +import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData.TSK_FS_NAME_FLAG_ENUM; /** @@ -43,18 +47,19 @@ import org.sleuthkit.datamodel.TskData.TSK_FS_NAME_FLAG_ENUM; }) public class DataContentViewerMedia extends javax.swing.JPanel implements DataContentViewer { - private static final String[] AUDIO_EXTENSIONS = new String[]{".mp3", ".wav", ".wma"}; + private static final String[] AUDIO_EXTENSIONS = new String[]{".mp3", ".wav", ".wma"}; //NON-NLS private static final Logger logger = Logger.getLogger(DataContentViewerMedia.class.getName()); private AbstractFile lastFile; //UI private final MediaViewVideoPanel videoPanel; private final String[] videoExtensions; // get them from the panel private String[] imageExtensions; // use javafx supported + private final List supportedMimes; private final MediaViewImagePanel imagePanel; private boolean videoPanelInited; private boolean imagePanelInited; - private static final String IMAGE_VIEWER_LAYER = "IMAGE"; - private static final String VIDEO_VIEWER_LAYER = "VIDEO"; + private static final String IMAGE_VIEWER_LAYER = "IMAGE"; //NON-NLS + private static final String VIDEO_VIEWER_LAYER = "VIDEO"; //NON-NLS /** * Creates new form DataContentViewerVideo @@ -69,11 +74,11 @@ public class DataContentViewerMedia extends javax.swing.JPanel implements DataCo imagePanel = new MediaViewImagePanel(); videoPanelInited = videoPanel.isInited(); imagePanelInited = imagePanel.isInited(); - + videoExtensions = videoPanel.getExtensions(); - + supportedMimes = videoPanel.getMimeTypes(); customizeComponents(); - logger.log(Level.INFO, "Created MediaView instance: " + this); + logger.log(Level.INFO, "Created MediaView instance: " + this); //NON-NLS } private void customizeComponents() { @@ -131,7 +136,7 @@ public class DataContentViewerMedia extends javax.swing.JPanel implements DataCo lastFile = file; final Dimension dims = DataContentViewerMedia.this.getSize(); - logger.info("setting node on media viewer"); + logger.info("setting node on media viewer"); //NON-NLS if (imagePanelInited && containsExt(file.getName(), imageExtensions)) { imagePanel.showImageFx(file, dims); this.switchPanels(false); @@ -141,12 +146,13 @@ public class DataContentViewerMedia extends javax.swing.JPanel implements DataCo this.switchPanels(false); } else if (videoPanelInited - && (containsExt(file.getName(), videoExtensions) || containsExt(file.getName(), AUDIO_EXTENSIONS))) { + && containsMimeType(selectedNode,supportedMimes)&&(containsExt(file.getName(), videoExtensions) || containsExt(file.getName(), AUDIO_EXTENSIONS))) { videoPanel.setupVideo(file, dims); switchPanels(true); + } } catch (Exception e) { - logger.log(Level.SEVERE, "Exception while setting node", e); + logger.log(Level.SEVERE, "Exception while setting node", e); //NON-NLS } } @@ -218,8 +224,8 @@ public class DataContentViewerMedia extends javax.swing.JPanel implements DataCo } if (videoPanelInited && videoPanel.isInited()) { - if (containsExt(name, AUDIO_EXTENSIONS) - || (containsExt(name, videoExtensions))) { + if ((containsExt(name, AUDIO_EXTENSIONS) + || containsExt(name, videoExtensions))&& containsMimeType(node,supportedMimes)) { return true; } } @@ -254,4 +260,26 @@ public class DataContentViewerMedia extends javax.swing.JPanel implements DataCo } return Arrays.asList(exts).contains(ext); } + private static boolean containsMimeType(Node node, List mimeTypes) { + if (mimeTypes.isEmpty()) { + //this should return true for 32 bit autopsy with the gstreamer MimeTypes list being empty, + //since mimetype detection is for java fx only. For 64 bit java fx, the code continues for Mimetype detection. + return true; + } + AbstractFile file = node.getLookup().lookup(AbstractFile.class); + try { + ArrayList genInfoAttributes = file.getGenInfoAttributes(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_FILE_TYPE_SIG); + if (genInfoAttributes.isEmpty() == false) { + for (BlackboardAttribute batt : genInfoAttributes) { + if (mimeTypes.contains(batt.getValueString())) { + return true; + } + } + return false; + } + } catch (TskCoreException ex) { + return false; + } + return false; + } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java index 975be800e7..8771680c19 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java @@ -63,7 +63,7 @@ public class DataContentViewerString extends javax.swing.JPanel implements DataC initComponents(); customizeComponents(); this.resetComponent(); - logger.log(Level.INFO, "Created StringView instance: " + this); + logger.log(Level.INFO, "Created StringView instance: " + this); //NON-NLS } private void customizeComponents() { @@ -130,7 +130,7 @@ public class DataContentViewerString extends javax.swing.JPanel implements DataC jPanel1.setPreferredSize(new java.awt.Dimension(502, 424)); outputViewPane.setEditable(false); - outputViewPane.setFont(new java.awt.Font("Courier New", 0, 11)); // NOI18N + outputViewPane.setFont(new java.awt.Font("Courier New", 0, 11)); // NOI18N NON-NLS NON-NLS outputViewPane.setPreferredSize(new java.awt.Dimension(700, 400)); jScrollPane1.setViewportView(outputViewPane); @@ -148,14 +148,14 @@ public class DataContentViewerString extends javax.swing.JPanel implements DataC pageLabel.setMinimumSize(new java.awt.Dimension(33, 14)); pageLabel.setPreferredSize(new java.awt.Dimension(33, 14)); - nextPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N + nextPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N NON-NLS nextPageButton.setText(org.openide.util.NbBundle.getMessage(DataContentViewerString.class, "DataContentViewerString.nextPageButton.text")); // NOI18N nextPageButton.setBorderPainted(false); nextPageButton.setContentAreaFilled(false); - nextPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N + nextPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N NON-NLS nextPageButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); nextPageButton.setPreferredSize(new java.awt.Dimension(55, 23)); - nextPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png"))); // NOI18N + nextPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png"))); // NOI18N NON-NLS nextPageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { nextPageButtonActionPerformed(evt); @@ -167,14 +167,14 @@ public class DataContentViewerString extends javax.swing.JPanel implements DataC pageLabel2.setMinimumSize(new java.awt.Dimension(29, 14)); pageLabel2.setPreferredSize(new java.awt.Dimension(29, 14)); - prevPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N + prevPageButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N NON-NLS prevPageButton.setText(org.openide.util.NbBundle.getMessage(DataContentViewerString.class, "DataContentViewerString.prevPageButton.text")); // NOI18N prevPageButton.setBorderPainted(false); prevPageButton.setContentAreaFilled(false); - prevPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N + prevPageButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N NON-NLS prevPageButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); prevPageButton.setPreferredSize(new java.awt.Dimension(55, 23)); - prevPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png"))); // NOI18N + prevPageButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png"))); // NOI18N NON-NLS prevPageButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { prevPageButtonActionPerformed(evt); @@ -356,7 +356,7 @@ public class DataContentViewerString extends javax.swing.JPanel implements DataC text = NbBundle.getMessage(this.getClass(), "DataContentViewerString.setDataView.errorText", currentOffset, currentOffset + pageLength); - logger.log(Level.WARNING, "Error while trying to show the String content.", ex); + logger.log(Level.WARNING, "Error while trying to show the String content.", ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java index 9bd06d8718..0a897a61c2 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultPanel.java @@ -348,8 +348,8 @@ public class DataResultPanel extends javax.swing.JPanel implements DataResult, C @Override public synchronized void addPropertyChangeListener(PropertyChangeListener listener) { if (pcs == null) { - logger.log(Level.WARNING, "Could not add listener to DataResultPanel, " - + "listener support not fully initialized yet, listener: " + listener.toString() ); + logger.log(Level.WARNING, "Could not add listener to DataResultPanel, " //NON-NLS + + "listener support not fully initialized yet, listener: " + listener.toString() ); //NON-NLS } else { this.pcs.addPropertyChangeListener(listener); diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java index 971d9addfb..0f844dfa2d 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultTopComponent.java @@ -239,15 +239,15 @@ public class DataResultTopComponent extends TopComponent implements DataResult, //putClientProperty("TopComponentAllowDockAnywhere", Boolean.TRUE); Mode mode = WindowManager.getDefault().findMode(customModeName); if (mode != null) { - StringBuilder message = new StringBuilder("Found custom mode, setting: "); + StringBuilder message = new StringBuilder("Found custom mode, setting: "); //NON-NLS message.append(customModeName); logger.log(Level.INFO, message.toString()); mode.dockInto(this); } else { - StringBuilder message = new StringBuilder("Could not find mode: "); + StringBuilder message = new StringBuilder("Could not find mode: "); //NON-NLS message.append(customModeName); - message.append(", will dock into the default one"); + message.append(", will dock into the default one"); //NON-NLS logger.log(Level.WARNING, message.toString()); } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java index 394ebc2480..03b8b30369 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java @@ -320,15 +320,15 @@ public class DataResultViewerTable extends AbstractDataResultViewer { //First property column is sortable, but also sorted initially, so //initially this one will have the arrow icon: if (props.size() > 0) { - props.get(0).setValue("TreeColumnTTV", Boolean.TRUE); // Identifies special property representing first (tree) column. - props.get(0).setValue("SortingColumnTTV", Boolean.TRUE); // TreeTableView should be initially sorted by this property column. + props.get(0).setValue("TreeColumnTTV", Boolean.TRUE); // Identifies special property representing first (tree) column. NON-NLS + props.get(0).setValue("SortingColumnTTV", Boolean.TRUE); // TreeTableView should be initially sorted by this property column. NON-NLS } // The rest of the columns are sortable, but not initially sorted, // so initially will have no arrow icon: String[] propStrings = new String[props.size() * 2]; for (int i = 0; i < props.size(); i++) { - props.get(i).setValue("ComparableColumnTTV", Boolean.TRUE); + props.get(i).setValue("ComparableColumnTTV", Boolean.TRUE); //NON-NLS propStrings[2 * i] = props.get(i).getName(); propStrings[2 * i + 1] = props.get(i).getDisplayName(); } @@ -414,7 +414,7 @@ public class DataResultViewerTable extends AbstractDataResultViewer { try { rowValues[rowCount][j] = properties[j].getValue(); } catch (IllegalAccessException | InvocationTargetException ignore) { - rowValues[rowCount][j] = "n/a"; + rowValues[rowCount][j] = "n/a"; //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java index 5103601e02..232505319a 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java @@ -129,25 +129,25 @@ import org.sleuthkit.datamodel.TskCoreException; pagesLabel.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.pagesLabel.text")); // NOI18N - pagePrevButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N + pagePrevButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back.png"))); // NOI18N NON-NLS pagePrevButton.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.pagePrevButton.text")); // NOI18N - pagePrevButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N + pagePrevButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_disabled.png"))); // NOI18N NON-NLS pagePrevButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); pagePrevButton.setPreferredSize(new java.awt.Dimension(55, 23)); - pagePrevButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png"))); // NOI18N + pagePrevButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_back_hover.png"))); // NOI18N NON-NLS pagePrevButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pagePrevButtonActionPerformed(evt); } }); - pageNextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N + pageNextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward.png"))); // NOI18N NON-NLS pageNextButton.setText(org.openide.util.NbBundle.getMessage(DataResultViewerThumbnail.class, "DataResultViewerThumbnail.pageNextButton.text")); // NOI18N - pageNextButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N + pageNextButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_disabled.png"))); // NOI18N NON-NLS pageNextButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); pageNextButton.setMaximumSize(new java.awt.Dimension(27, 23)); pageNextButton.setMinimumSize(new java.awt.Dimension(27, 23)); - pageNextButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png"))); // NOI18N + pageNextButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/corecomponents/btn_step_forward_hover.png"))); // NOI18N NON-NLS pageNextButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { pageNextButtonActionPerformed(evt); @@ -446,7 +446,7 @@ import org.sleuthkit.datamodel.TskCoreException; ex.getMessage()), NotifyDescriptor.ERROR_MESSAGE); DialogDisplayer.getDefault().notify(d); - logger.log(Level.SEVERE, "Error making thumbnails: " + ex.getMessage()); + logger.log(Level.SEVERE, "Error making thumbnails: " + ex.getMessage()); //NON-NLS } // catch and ignore if we were cancelled catch (java.util.concurrent.CancellationException ex) { } @@ -581,7 +581,7 @@ import org.sleuthkit.datamodel.TskCoreException; filePathLabel.setToolTipText(uPath); } catch (TskCoreException e){ - logger.log(Level.WARNING, "Could not get unique path for content: {0}", af.getName()); + logger.log(Level.WARNING, "Could not get unique path for content: {0}", af.getName()); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/FXVideoPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/FXVideoPanel.java index 9038afe7b2..711994cb51 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/FXVideoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/FXVideoPanel.java @@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.corecomponents; import java.awt.Dimension; import java.io.IOException; import java.nio.file.Paths; +import java.util.Arrays; import java.util.List; import java.util.concurrent.CancellationException; import java.util.logging.Level; @@ -81,7 +82,9 @@ import org.sleuthkit.autopsy.core.Installer; }) public class FXVideoPanel extends MediaViewVideoPanel { - private static final String[] EXTENSIONS = new String[]{".mov", ".m4v", ".flv", ".mp4", ".mpg", ".mpeg"}; + private static final String[] EXTENSIONS = new String[]{".mov", ".m4v", ".flv", ".mp4", ".mpg", ".mpeg"}; //NON-NLS + static private final List supportedMimes = Arrays.asList("audio/x-aiff", "video/x-javafx", "video/x-flv", "application/vnd.apple.mpegurl", " audio/mpegurl", "audio/mpeg", "video/mp4","audio/x-m4a","video/x-m4v","audio/x-wav"); //NON-NLS + private static final Logger logger = Logger.getLogger(MediaViewVideoPanel.class.getName()); private boolean fxInited = false; // FX Components @@ -149,7 +152,7 @@ public class FXVideoPanel extends MediaViewVideoPanel { try { path = file.getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Cannot get unique path of video file"); + logger.log(Level.SEVERE, "Cannot get unique path of video file"); //NON-NLS } mediaPane.setInfoLabelText(path); mediaPane.setInfoLabelToolTipText(path); @@ -257,9 +260,9 @@ public class FXVideoPanel extends MediaViewVideoPanel { try { extractedBytes = ContentUtils.writeToFile(sFile, jFile, progress, this, true); } catch (IOException ex) { - logger.log(Level.WARNING, "Error buffering file", ex); + logger.log(Level.WARNING, "Error buffering file", ex); //NON-NLS } - logger.log(Level.INFO, "Done buffering: " + jFile.getName()); + logger.log(Level.INFO, "Done buffering: " + jFile.getName()); //NON-NLS success = true; return null; } @@ -270,15 +273,15 @@ public class FXVideoPanel extends MediaViewVideoPanel { try { super.get(); //block and get all exceptions thrown while doInBackground() } catch (CancellationException ex) { - logger.log(Level.INFO, "Media buffering was canceled."); + logger.log(Level.INFO, "Media buffering was canceled."); //NON-NLS } catch (InterruptedException ex) { - logger.log(Level.INFO, "Media buffering was interrupted."); + logger.log(Level.INFO, "Media buffering was interrupted."); //NON-NLS } catch (Exception ex) { - logger.log(Level.SEVERE, "Fatal error during media buffering.", ex); + logger.log(Level.SEVERE, "Fatal error during media buffering.", ex); //NON-NLS } finally { progress.finish(); if (!this.isCancelled()) { - logger.log(Level.INFO, "ExtractMedia in done: " + jFile.getName()); + logger.log(Level.INFO, "ExtractMedia in done: " + jFile.getName()); //NON-NLS try { Platform.runLater(new Runnable() { @Override @@ -287,7 +290,7 @@ public class FXVideoPanel extends MediaViewVideoPanel { } }); } catch(MediaException e) { - logger.log(Level.WARNING, "something went wrong with javafx", e); + logger.log(Level.WARNING, "something went wrong with javafx", e); //NON-NLS reset(); mediaPane.setInfoLabelText(e.getMessage()); return; @@ -323,7 +326,7 @@ public class FXVideoPanel extends MediaViewVideoPanel { private int totalHours; private int totalMinutes; private int totalSeconds; - private String durationFormat = "%02d:%02d:%02d/%02d:%02d:%02d "; + private String durationFormat = "%02d:%02d:%02d/%02d:%02d:%02d "; //NON-NLS /** The EventHandler for MediaPlayer.onReady(). **/ private final ReadyListener READY_LISTENER = new ReadyListener(); @@ -344,12 +347,12 @@ public class FXVideoPanel extends MediaViewVideoPanel { private static final String PAUSE_TEXT = "||"; - private static final String STOP_TEXT = "X"; + private static final String STOP_TEXT = "X"; //NON-NLS public MediaPane() { // Video Display mediaViewPane = new HBox(); - mediaViewPane.setStyle("-fx-background-color: black"); + mediaViewPane.setStyle("-fx-background-color: black"); //NON-NLS mediaViewPane.setAlignment(Pos.CENTER); mediaView = new MediaView(); mediaViewPane.getChildren().add(mediaView); @@ -378,7 +381,7 @@ public class FXVideoPanel extends MediaViewVideoPanel { mediaTools.getChildren().add(progressLabel); controlPanel.getChildren().add(mediaTools); - controlPanel.setStyle("-fx-background-color: white"); + controlPanel.setStyle("-fx-background-color: white"); //NON-NLS infoLabel = new Label(""); controlPanel.getChildren().add(infoLabel); setBottom(controlPanel); @@ -423,7 +426,7 @@ public class FXVideoPanel extends MediaViewVideoPanel { * @param text */ public void setInfoLabelText(final String text) { - logger.log(Level.INFO, "Setting Info Label Text: " + text); + logger.log(Level.INFO, "Setting Info Label Text: " + text); //NON-NLS Platform.runLater(new Runnable() { @Override public void run() { @@ -470,7 +473,7 @@ public class FXVideoPanel extends MediaViewVideoPanel { mediaPlayer.play(); break; default: - logger.log(Level.INFO, "MediaPlayer in unexpected state: " + status.toString()); + logger.log(Level.INFO, "MediaPlayer in unexpected state: " + status.toString()); //NON-NLS // If the MediaPlayer is in an unexpected state, stop playback. mediaPlayer.stop(); setInfoLabelText(NbBundle.getMessage(this.getClass(), @@ -798,4 +801,9 @@ public class FXVideoPanel extends MediaViewVideoPanel { public String[] getExtensions() { return EXTENSIONS; } + + @Override + public List getMimeTypes() { + return supportedMimes; + } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralOptionsPanelController.java b/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralOptionsPanelController.java index 9d0b592546..990576ea0c 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralOptionsPanelController.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralOptionsPanelController.java @@ -101,7 +101,7 @@ public final class GeneralOptionsPanelController extends OptionsPanelController try { pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); } catch (Exception e) { - logger.log(Level.SEVERE, "GeneralOptionsPanelController listener threw exception", e); + logger.log(Level.SEVERE, "GeneralOptionsPanelController listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show( NbBundle.getMessage(this.getClass(), "GeneralOptionsPanelController.moduleErr"), NbBundle.getMessage(this.getClass(), "GeneralOptionsPanelController.moduleErr.msg"), @@ -112,7 +112,7 @@ public final class GeneralOptionsPanelController extends OptionsPanelController try { pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); } catch (Exception e) { - logger.log(Level.SEVERE, "GeneralOptionsPanelController listener threw exception", e); + logger.log(Level.SEVERE, "GeneralOptionsPanelController listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show( NbBundle.getMessage(this.getClass(), "GeneralOptionsPanelController.moduleErr"), NbBundle.getMessage(this.getClass(), "GeneralOptionsPanelController.moduleErr.msg"), diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralPanel.java index 7016287017..ea334dae46 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/GeneralPanel.java @@ -25,10 +25,10 @@ import org.sleuthkit.autopsy.ingest.IngestManager; final class GeneralPanel extends javax.swing.JPanel { - private static final String KEEP_PREFERRED_VIEWER = "keepPreferredViewer"; - private static final String USE_LOCAL_TIME = "useLocalTime"; - private static final String DS_HIDE_KNOWN = "dataSourcesHideKnown"; // Default false - private static final String VIEWS_HIDE_KNOWN = "viewsHideKnown"; // Default true + private static final String KEEP_PREFERRED_VIEWER = "keepPreferredViewer"; //NON-NLS + private static final String USE_LOCAL_TIME = "useLocalTime"; //NON-NLS + private static final String DS_HIDE_KNOWN = "dataSourcesHideKnown"; // Default false NON-NLS + private static final String VIEWS_HIDE_KNOWN = "viewsHideKnown"; // Default true NON-NLS private final Preferences prefs = NbPreferences.forModule(this.getClass()); GeneralPanel(GeneralOptionsPanelController controller) { diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/GstVideoPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/GstVideoPanel.java index 2c7a089782..6201734fb6 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/GstVideoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/GstVideoPanel.java @@ -24,6 +24,7 @@ import java.awt.image.BufferedImage; import java.io.IOException; import java.nio.IntBuffer; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -71,7 +72,7 @@ import org.sleuthkit.datamodel.TskData; }) public class GstVideoPanel extends MediaViewVideoPanel { - private static final String[] EXTENSIONS = new String[]{".mov", ".m4v", ".flv", ".mp4", ".3gp", ".avi", ".mpg", ".mpeg", ".wmv"}; + private static final String[] EXTENSIONS = new String[]{".mov", ".m4v", ".flv", ".mp4", ".3gp", ".avi", ".mpg", ".mpeg", ".wmv"}; //NON-NLS private static final Logger logger = Logger.getLogger(GstVideoPanel.class.getName()); private boolean gstInited; @@ -88,7 +89,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { private final Object playbinLock = new Object(); // lock for synchronization of gstPlaybin2 player private AbstractFile currentFile; private Set badVideoFiles = Collections.synchronizedSet(new HashSet()); - + static private final List supportedMimes = Arrays.asList(); /** * Creates new form MediaViewVideoPanel */ @@ -143,12 +144,12 @@ public class GstVideoPanel extends MediaViewVideoPanel { if (gstPlaybin2 != null && !autoTracking) { State orig = gstPlaybin2.getState(); if (gstPlaybin2.pause() == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.pause() failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.pause() failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } if (gstPlaybin2.seek(ClockTime.fromMillis(time)) == false) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.seek() failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.seek() failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } @@ -161,19 +162,19 @@ public class GstVideoPanel extends MediaViewVideoPanel { private boolean initGst() { try { - logger.log(Level.INFO, "Initializing gstreamer for video/audio viewing"); + logger.log(Level.INFO, "Initializing gstreamer for video/audio viewing"); //NON-NLS Gst.init(); gstInited = true; } catch (GstException e) { gstInited = false; - logger.log(Level.SEVERE, "Error initializing gstreamer for audio/video viewing and frame extraction capabilities", e); + logger.log(Level.SEVERE, "Error initializing gstreamer for audio/video viewing and frame extraction capabilities", e); //NON-NLS MessageNotifyUtil.Notify.error( NbBundle.getMessage(this.getClass(), "GstVideoPanel.initGst.gstException.msg"), e.getMessage()); return false; } catch (UnsatisfiedLinkError | NoClassDefFoundError | Exception e) { gstInited = false; - logger.log(Level.SEVERE, "Error initializing gstreamer for audio/video viewing and extraction capabilities", e); + logger.log(Level.SEVERE, "Error initializing gstreamer for audio/video viewing and extraction capabilities", e); //NON-NLS MessageNotifyUtil.Notify.error( NbBundle.getMessage(this.getClass(), "GstVideoPanel.initGst.otherException.msg"), e.getMessage()); @@ -201,7 +202,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { try { path = file.getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Cannot get unique path of video file"); + logger.log(Level.SEVERE, "Cannot get unique path of video file"); //NON-NLS } infoLabel.setText(path); infoLabel.setToolTipText(path); @@ -215,7 +216,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { if (gstPlaybin2 != null) { gstPlaybin2.dispose(); } - gstPlaybin2 = new PlayBin2("VideoPlayer"); + gstPlaybin2 = new PlayBin2("VideoPlayer"); //NON-NLS gstPlaybin2.setVideoSink(gstVideoComponent.getElement()); videoPanel.removeAll(); @@ -229,7 +230,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { gstPlaybin2.setInputFile(ioFile); if (gstPlaybin2.setState(State.READY) == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.READY) failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.READY) failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); } } @@ -255,13 +256,13 @@ public class GstVideoPanel extends MediaViewVideoPanel { if (gstPlaybin2 != null) { if (gstPlaybin2.isPlaying()) { if (gstPlaybin2.stop() == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.stop() failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.stop() failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } } if (gstPlaybin2.setState(State.NULL) == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.NULL) failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.NULL) failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } @@ -324,8 +325,8 @@ public class GstVideoPanel extends MediaViewVideoPanel { } // set up a PlayBin2 object - RGBDataSink videoSink = new RGBDataSink("rgb", rgbListener); - PlayBin2 playbin = new PlayBin2("VideoFrameCapture"); + RGBDataSink videoSink = new RGBDataSink("rgb", rgbListener); //NON-NLS + PlayBin2 playbin = new PlayBin2("VideoFrameCapture"); //NON-NLS playbin.setInputFile(file); playbin.setVideoSink(videoSink); @@ -373,7 +374,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { //System.out.println("Seeking to " + timeStamp + "milliseconds."); if (!playbin.seek(timeStamp, unit)) { - logger.log(Level.INFO, "There was a problem seeking to " + timeStamp + " " + unit.name().toLowerCase()); + logger.log(Level.INFO, "There was a problem seeking to " + timeStamp + " " + unit.name().toLowerCase()); //NON-NLS } ret = playbin.play(); @@ -389,7 +390,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { try { lock.wait(FRAME_CAPTURE_TIMEOUT_MILLIS); } catch (InterruptedException e) { - logger.log(Level.INFO, "InterruptedException occurred while waiting for frame capture.", e); + logger.log(Level.INFO, "InterruptedException occurred while waiting for frame capture.", e); //NON-NLS } } Image image = rgbListener.getImage(); @@ -403,7 +404,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { } if (image == null) { - logger.log(Level.WARNING, "There was a problem while trying to capture a frame from file " + file.getName()); + logger.log(Level.WARNING, "There was a problem while trying to capture a frame from file " + file.getName()); //NON-NLS badVideoFiles.add(file.getName()); break; } @@ -533,27 +534,27 @@ public class GstVideoPanel extends MediaViewVideoPanel { State state = gstPlaybin2.getState(); if (state.equals(State.PLAYING)) { if (gstPlaybin2.pause() == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.pause() failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.pause() failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } pauseButton.setText("â–º"); // Is this call necessary considering we just called gstPlaybin2.pause()? if (gstPlaybin2.setState(State.PAUSED) == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.PAUSED) failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.PAUSED) failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } } else if (state.equals(State.PAUSED)) { if (gstPlaybin2.play() == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.play() failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.play() failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } pauseButton.setText("||"); // Is this call necessary considering we just called gstPlaybin2.play()? if (gstPlaybin2.setState(State.PLAYING) == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.PLAYING) failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.PLAYING) failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } @@ -576,7 +577,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { private class VideoProgressWorker extends SwingWorker { - private String durationFormat = "%02d:%02d:%02d/%02d:%02d:%02d "; + private String durationFormat = "%02d:%02d:%02d/%02d:%02d:%02d "; //NON-NLS private long millisElapsed = 0; private final long INTER_FRAME_PERIOD_MS = 20; private final long END_TIME_MARGIN_MS = 50; @@ -592,12 +593,12 @@ public class GstVideoPanel extends MediaViewVideoPanel { synchronized (playbinLock) { if (gstPlaybin2 != null) { if (gstPlaybin2.stop() == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.stop() failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.stop() failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); } // ready to be played again if (gstPlaybin2.setState(State.READY) == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.READY) failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.setState(State.READY) failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); } gstPlaybin2.getState(); //NEW @@ -675,7 +676,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { try { get(); } catch (InterruptedException | ExecutionException ex) { - logger.log(Level.WARNING, "Error updating video progress: " + ex.getMessage()); + logger.log(Level.WARNING, "Error updating video progress: " + ex.getMessage()); //NON-NLS infoLabel.setText(NbBundle.getMessage(this.getClass(), "GstVideoPanel.progress.infoLabel.updateErr", ex.getMessage())); } @@ -721,7 +722,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { try { extractedBytes = ContentUtils.writeToFile(sFile, jFile, progress, this, true); } catch (IOException ex) { - logger.log(Level.WARNING, "Error buffering file", ex); + logger.log(Level.WARNING, "Error buffering file", ex); //NON-NLS } success = true; return null; @@ -733,11 +734,11 @@ public class GstVideoPanel extends MediaViewVideoPanel { try { super.get(); //block and get all exceptions thrown while doInBackground() } catch (CancellationException ex) { - logger.log(Level.INFO, "Media buffering was canceled."); + logger.log(Level.INFO, "Media buffering was canceled."); //NON-NLS } catch (InterruptedException ex) { - logger.log(Level.INFO, "Media buffering was interrupted."); + logger.log(Level.INFO, "Media buffering was interrupted."); //NON-NLS } catch (Exception ex) { - logger.log(Level.SEVERE, "Fatal error during media buffering.", ex); + logger.log(Level.SEVERE, "Fatal error during media buffering.", ex); //NON-NLS } finally { progress.finish(); if (!this.isCancelled()) { @@ -755,12 +756,12 @@ public class GstVideoPanel extends MediaViewVideoPanel { synchronized (playbinLock) { // must play, then pause and get state to get duration. if (gstPlaybin2.play() == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.play() failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.play() failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } if (gstPlaybin2.pause() == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.pause() failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.pause() failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); return; } @@ -786,7 +787,7 @@ public class GstVideoPanel extends MediaViewVideoPanel { synchronized (playbinLock) { if (gstPlaybin2.play() == StateChangeReturn.FAILURE) { - logger.log(Level.WARNING, "Attempt to call PlayBin2.play() failed."); + logger.log(Level.WARNING, "Attempt to call PlayBin2.play() failed."); //NON-NLS infoLabel.setText(MEDIA_PLAYER_ERROR_STRING); } } @@ -802,4 +803,9 @@ public class GstVideoPanel extends MediaViewVideoPanel { public String[] getExtensions() { return EXTENSIONS; } + + @Override + public List getMimeTypes() { + return supportedMimes; + } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java index 005d47ffd4..97cdb0cafb 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Installer.java @@ -85,7 +85,7 @@ public class Installer extends ModuleInstall { //UIManager.put("nimbusBlueGrey", new Color()); //UIManager.put("control", new Color()); - if (System.getProperty("os.name").toLowerCase().contains("mac")) { + if (System.getProperty("os.name").toLowerCase().contains("mac")) { //NON-NLS setupMacOsXLAF(); } @@ -101,10 +101,10 @@ public class Installer extends ModuleInstall { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { - logger.log(Level.WARNING, "Unable to set theme. ", ex); + logger.log(Level.WARNING, "Unable to set theme. ", ex); //NON-NLS } - final String[] UI_MENU_ITEM_KEYS = new String[]{"MenuBarUI", + final String[] UI_MENU_ITEM_KEYS = new String[]{"MenuBarUI", //NON-NLS }; Map uiEntries = new TreeMap<>(); @@ -117,12 +117,12 @@ public class Installer extends ModuleInstall { //use Metal if available for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { + if ("Nimbus".equals(info.getName())) { //NON-NLS try { UIManager.setLookAndFeel(info.getClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { - logger.log(Level.WARNING, "Unable to set theme. ", ex); + logger.log(Level.WARNING, "Unable to set theme. ", ex); //NON-NLS } break; } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewImagePanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewImagePanel.java index 70505058bc..50d4461939 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewImagePanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewImagePanel.java @@ -150,7 +150,7 @@ import org.sleuthkit.datamodel.ReadContentInputStream; //original input stream BufferedImage bi = ImageIO.read(inputStream); if (bi == null) { - logger.log(Level.WARNING, "Could image reader not found for file: " + fileName); + logger.log(Level.WARNING, "Could image reader not found for file: " + fileName); //NON-NLS return; } //scale image using Scalr @@ -158,10 +158,10 @@ import org.sleuthkit.datamodel.ReadContentInputStream; //convert from awt imageto fx image fxImage = SwingFXUtils.toFXImage(biScaled, null); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not load image file into media view: " + fileName, ex); + logger.log(Level.WARNING, "Could not load image file into media view: " + fileName, ex); //NON-NLS return; } catch (OutOfMemoryError ex) { - logger.log(Level.WARNING, "Could not load image file into media view (too large): " + fileName, ex); + logger.log(Level.WARNING, "Could not load image file into media view (too large): " + fileName, ex); //NON-NLS MessageNotifyUtil.Notify.warn( NbBundle.getMessage(this.getClass(), "MediaViewImagePanel.imgFileTooLarge.msg", file.getName()), ex.getMessage()); @@ -170,12 +170,12 @@ import org.sleuthkit.datamodel.ReadContentInputStream; try { inputStream.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close input stream after loading image in media view: " + fileName, ex); + logger.log(Level.WARNING, "Could not close input stream after loading image in media view: " + fileName, ex); //NON-NLS } } if (fxImage == null || fxImage.isError()) { - logger.log(Level.WARNING, "Could not load image file into media view: " + fileName); + logger.log(Level.WARNING, "Could not load image file into media view: " + fileName); //NON-NLS return; } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewVideoPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewVideoPanel.java index 343b7fa672..ba1e070c12 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewVideoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MediaViewVideoPanel.java @@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.corecomponents; import java.awt.Dimension; import java.util.Arrays; +import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JPanel; @@ -34,10 +35,10 @@ public abstract class MediaViewVideoPanel extends JPanel implements FrameCapture private static final Logger logger = Logger.getLogger(MediaViewVideoPanel.class.getName()); // 64 bit architectures - private static final String[] ARCH64 = new String[]{"amd64", "x86_64"}; + private static final String[] ARCH64 = new String[]{"amd64", "x86_64"}; //NON-NLS NON-NLS // 32 bit architectures - private static final String[] ARCH32 = new String[]{"x86"}; + private static final String[] ARCH32 = new String[]{"x86"}; //NON-NLS /** * Factory Method to create a MediaViewVideoPanel. @@ -48,10 +49,10 @@ public abstract class MediaViewVideoPanel extends JPanel implements FrameCapture */ public static MediaViewVideoPanel createVideoPanel() { if (is64BitJVM()) { - logger.log(Level.INFO, "64 bit JVM detected. Creating JavaFX Video Player."); + logger.log(Level.INFO, "64 bit JVM detected. Creating JavaFX Video Player."); //NON-NLS return getFXImpl(); } else { - logger.log(Level.INFO, "32 bit JVM detected. Creating GStreamer Video Player."); + logger.log(Level.INFO, "32 bit JVM detected. Creating GStreamer Video Player."); //NON-NLS return getGstImpl(); } } @@ -108,4 +109,8 @@ public abstract class MediaViewVideoPanel extends JPanel implements FrameCapture * Return the extensions supported by this video panel. */ abstract public String[] getExtensions(); + /** + * Return the MimeTypes supported by this video panel. + */ + abstract public List getMimeTypes(); } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/ThumbnailViewChildren.java b/Core/src/org/sleuthkit/autopsy/corecomponents/ThumbnailViewChildren.java index d8131ccbc6..8487310b67 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/ThumbnailViewChildren.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/ThumbnailViewChildren.java @@ -167,7 +167,7 @@ class ThumbnailViewChildren extends Children.Keys { int to = from + showImages - 1; setDisplayName(from + "-" + to); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/AutopsyExceptionHandler.java b/Core/src/org/sleuthkit/autopsy/coreutils/AutopsyExceptionHandler.java index d94425b5de..e31768bd80 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/AutopsyExceptionHandler.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/AutopsyExceptionHandler.java @@ -90,7 +90,7 @@ public class AutopsyExceptionHandler extends Handler { } }); } - logger.log(Level.SEVERE, "Unexpected error: " + title + ", " + message ); + logger.log(Level.SEVERE, "Unexpected error: " + title + ", " + message ); //NON-NLS } else { // Throwable (unanticipated) error. Use built-in exception handler to offer details, stacktrace. nbErrorManager.publish(record); @@ -118,7 +118,7 @@ public class AutopsyExceptionHandler extends Handler { private String formatExplanation(LogRecord record) { final String logMessage = getFormatter().formatMessage(record); String explanation = record.getThrown().getMessage(); - String causeMessage = (explanation != null) ? "\nCaused by: " + explanation : ""; + String causeMessage = (explanation != null) ? "\nCaused by: " + explanation : ""; //NON-NLS return logMessage + causeMessage; } @@ -149,11 +149,11 @@ public class AutopsyExceptionHandler extends Handler { private static String getTitleForLevelValue(int levelValue) { if (levelValue >= SEVERE_VALUE) { - return "Error"; + return "Error"; //NON-NLS } else if (levelValue >= WARNING_VALUE) { - return "Warning"; + return "Warning"; //NON-NLS } else { - return "Message"; + return "Message"; //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/EscapeUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/EscapeUtil.java index fbf8ff4985..f66b5eb333 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/EscapeUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/EscapeUtil.java @@ -39,9 +39,9 @@ public class EscapeUtil { */ public static String decodeURL(String url) { try { - return URLDecoder.decode(url, "UTF-8"); + return URLDecoder.decode(url, "UTF-8"); //NON-NLS } catch (UnsupportedEncodingException ex) { - logger.log(Level.SEVERE, "Could not decode URL " + url, ex); + logger.log(Level.SEVERE, "Could not decode URL " + url, ex); //NON-NLS //should not happen return ""; } @@ -55,9 +55,9 @@ public class EscapeUtil { */ public static String encodeURL(String url) { try { - return URLEncoder.encode(url, "UTF-8"); + return URLEncoder.encode(url, "UTF-8"); //NON-NLS } catch (UnsupportedEncodingException ex) { - logger.log(Level.SEVERE, "Could not encode URL " + url, ex); + logger.log(Level.SEVERE, "Could not encode URL " + url, ex); //NON-NLS //should not happen return ""; } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java index e6122bd893..0850400b1f 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ExecUtil.java @@ -64,14 +64,14 @@ import org.sleuthkit.autopsy.coreutils.Logger; } final Runtime rt = Runtime.getRuntime(); - logger.log(Level.INFO, "Executing " + arrayCommandToLog.toString()); + logger.log(Level.INFO, "Executing " + arrayCommandToLog.toString()); //NON-NLS proc = rt.exec(arrayCommand); //stderr redirect - errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR"); + errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR"); //NON-NLS //stdout redirect - outputStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getInputStream(), "OUTPUT"); + outputStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getInputStream(), "OUTPUT"); //NON-NLS //start redurectors errorStringRedirect.start(); @@ -79,7 +79,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; //wait for process to complete and capture error core final int exitVal = proc.waitFor(); - logger.log(Level.INFO, aCommand + " exit value: " + exitVal); + logger.log(Level.INFO, aCommand + " exit value: " + exitVal); //NON-NLS errorStringRedirect.stopRun(); errorStringRedirect = null; @@ -119,12 +119,12 @@ import org.sleuthkit.autopsy.coreutils.Logger; } final Runtime rt = Runtime.getRuntime(); - logger.log(Level.INFO, "Executing " + arrayCommandToLog.toString()); + logger.log(Level.INFO, "Executing " + arrayCommandToLog.toString()); //NON-NLS proc = rt.exec(arrayCommand); //stderr redirect - errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR"); + errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR"); //NON-NLS //stdout redirect outputWriterRedirect = new ExecUtil.StreamToWriterRedirect(proc.getInputStream(), stdoutWriter); @@ -134,7 +134,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; //wait for process to complete and capture error core final int exitVal = proc.waitFor(); - logger.log(Level.INFO, aCommand + " exit value: " + exitVal); + logger.log(Level.INFO, aCommand + " exit value: " + exitVal); //NON-NLS //gc process with its streams //proc = null; @@ -144,7 +144,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; * Interrupt the running process and stop its stream redirect threads */ public synchronized void stop() { - logger.log(Level.INFO, "Stopping Execution of: " + command); + logger.log(Level.INFO, "Stopping Execution of: " + command); //NON-NLS if (errorStringRedirect != null) { errorStringRedirect.stopRun(); @@ -204,13 +204,13 @@ import org.sleuthkit.autopsy.coreutils.Logger; this.output.append(line).append(SEP); } } catch (final IOException ex) { - logger.log(Level.WARNING, "Error redirecting stream to string buffer", ex); + logger.log(Level.WARNING, "Error redirecting stream to string buffer", ex); //NON-NLS } finally { if (br != null) { try { br.close(); } catch (IOException ex) { - logger.log(Level.SEVERE, "Error closing stream reader", ex); + logger.log(Level.SEVERE, "Error closing stream reader", ex); //NON-NLS } } } @@ -275,7 +275,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; writer.append(line).append(SEP); } } catch (final IOException ex) { - logger.log(Level.SEVERE, "Error reading output and writing to file writer", ex); + logger.log(Level.SEVERE, "Error reading output and writing to file writer", ex); //NON-NLS } finally { try { if (doRun) { @@ -286,7 +286,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; } } catch (IOException ex) { - logger.log(Level.SEVERE, "Error flushing file writer", ex); + logger.log(Level.SEVERE, "Error flushing file writer", ex); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java index 2aa8ab7159..8e8481a580 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/FileUtil.java @@ -64,13 +64,13 @@ import org.openide.filesystems.FileObject; if (path.isFile()) { // If it's a file if (!path.delete()) { sucess = false; - logger.log(Level.WARNING, "Failed to delete file {0}", path.getPath()); + logger.log(Level.WARNING, "Failed to delete file {0}", path.getPath()); //NON-NLS } } else { // If it's a directory if (path.list().length == 0) { // If the dir is empty if (!path.delete()) { sucess = false; - logger.log(Level.WARNING, "Failed to delete the empty directory at {0}", path.getPath()); + logger.log(Level.WARNING, "Failed to delete the empty directory at {0}", path.getPath()); //NON-NLS } } else { String files[] = path.list(); @@ -81,11 +81,11 @@ import org.openide.filesystems.FileObject; if (path.list().length == 0) { // Delete the newly-empty dir if (!path.delete()) { sucess = false; - logger.log(Level.WARNING, "Failed to delete the empty directory at {0}", path.getPath()); + logger.log(Level.WARNING, "Failed to delete the empty directory at {0}", path.getPath()); //NON-NLS } } else { sucess = false; - logger.log(Level.WARNING, "Directory {0} did not recursivly delete sucessfully.", path.getPath()); + logger.log(Level.WARNING, "Directory {0} did not recursivly delete sucessfully.", path.getPath()); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java index 65d8362cbc..69f357bc20 100755 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ImageUtils.java @@ -53,7 +53,7 @@ public class ImageUtils { public static final int ICON_SIZE_MEDIUM = 100; public static final int ICON_SIZE_LARGE = 200; private static final Logger logger = Logger.getLogger(ImageUtils.class.getName()); - private static final Image DEFAULT_ICON = new ImageIcon("/org/sleuthkit/autopsy/images/file-icon.png").getImage(); + private static final Image DEFAULT_ICON = new ImageIcon("/org/sleuthkit/autopsy/images/file-icon.png").getImage(); //NON-NLS private static final List SUPP_EXTENSIONS = Arrays.asList(ImageIO.getReaderFileSuffixes()); private static final List SUPP_MIME_TYPES = Arrays.asList(ImageIO.getReaderMIMETypes()); /** @@ -90,7 +90,7 @@ public class ImageUtils { } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Error while getting file signature from blackboard.", ex); + logger.log(Level.WARNING, "Error while getting file signature from blackboard.", ex); //NON-NLS } final String extension = f.getNameExtension(); @@ -130,7 +130,7 @@ public class ImageUtils { icon = bicon; } } catch (IOException ex) { - logger.log(Level.WARNING, "Error while reading image.", ex); + logger.log(Level.WARNING, "Error while reading image.", ex); //NON-NLS icon = DEFAULT_ICON; } } else { // Make a new icon @@ -208,10 +208,10 @@ public class ImageUtils { if (f.exists()) { f.delete(); } - ImageIO.write((BufferedImage) icon, "png", getFile(content.getId())); + ImageIO.write((BufferedImage) icon, "png", getFile(content.getId())); //NON-NLS } } catch (IOException ex) { - logger.log(Level.WARNING, "Could not write cache thumbnail: " + content, ex); + logger.log(Level.WARNING, "Could not write cache thumbnail: " + content, ex); //NON-NLS } return icon; } @@ -226,24 +226,24 @@ public class ImageUtils { inputStream = new ReadContentInputStream(content); BufferedImage bi = ImageIO.read(inputStream); if (bi == null) { - logger.log(Level.WARNING, "No image reader for file: " + content.getName()); + logger.log(Level.WARNING, "No image reader for file: " + content.getName()); //NON-NLS return null; } BufferedImage biScaled = ScalrWrapper.resizeFast(bi, iconSize); return biScaled; } catch (OutOfMemoryError e) { - logger.log(Level.WARNING, "Could not scale image (too large): " + content.getName(), e); + logger.log(Level.WARNING, "Could not scale image (too large): " + content.getName(), e); //NON-NLS return null; } catch (Exception e) { - logger.log(Level.WARNING, "Could not scale image: " + content.getName(), e); + logger.log(Level.WARNING, "Could not scale image: " + content.getName(), e); //NON-NLS return null; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close input stream after resizing thumbnail: " + content.getName(), ex); + logger.log(Level.WARNING, "Could not close input stream after resizing thumbnail: " + content.getName(), ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/Installer.java b/Core/src/org/sleuthkit/autopsy/coreutils/Installer.java index b98660ae08..eee59f8eb2 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/Installer.java @@ -45,20 +45,20 @@ public class Installer extends ModuleInstall { @Override public void restored() { - autopsyLogger.log(Level.INFO, "Default charset: " + PlatformUtil.getDefaultPlatformCharset()); - autopsyLogger.log(Level.INFO, "Default file encoding: " + PlatformUtil.getDefaultPlatformFileEncoding()); + autopsyLogger.log(Level.INFO, "Default charset: " + PlatformUtil.getDefaultPlatformCharset()); //NON-NLS + autopsyLogger.log(Level.INFO, "Default file encoding: " + PlatformUtil.getDefaultPlatformFileEncoding()); //NON-NLS - autopsyLogger.log(Level.INFO, "Java runtime version: " + Version.getJavaRuntimeVersion()); + autopsyLogger.log(Level.INFO, "Java runtime version: " + Version.getJavaRuntimeVersion()); //NON-NLS - autopsyLogger.log(Level.INFO, "Netbeans Platform build: " + Version.getNetbeansBuild()); + autopsyLogger.log(Level.INFO, "Netbeans Platform build: " + Version.getNetbeansBuild()); //NON-NLS - autopsyLogger.log(Level.INFO, "Application name: " + Version.getName() - + ", version: " + Version.getVersion() + ", build: " + Version.getBuildType()); + autopsyLogger.log(Level.INFO, "Application name: " + Version.getName() //NON-NLS + + ", version: " + Version.getVersion() + ", build: " + Version.getBuildType()); //NON-NLS NON-NLS - autopsyLogger.log(Level.INFO, "os.name: " + System.getProperty("os.name")); - autopsyLogger.log(Level.INFO, "os.arch: " + System.getProperty("os.arch")); - autopsyLogger.log(Level.INFO, "PID: " + PlatformUtil.getPID()); - autopsyLogger.log(Level.INFO, "Process Virtual Memory Used: " + PlatformUtil.getProcessVirtualMemoryUsed()); + autopsyLogger.log(Level.INFO, "os.name: " + System.getProperty("os.name")); //NON-NLS + autopsyLogger.log(Level.INFO, "os.arch: " + System.getProperty("os.arch")); //NON-NLS + autopsyLogger.log(Level.INFO, "PID: " + PlatformUtil.getPID()); //NON-NLS + autopsyLogger.log(Level.INFO, "Process Virtual Memory Used: " + PlatformUtil.getProcessVirtualMemoryUsed()); //NON-NLS diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/JLnkParser.java b/Core/src/org/sleuthkit/autopsy/coreutils/JLnkParser.java index e0f7b341bc..e02ec720ff 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/JLnkParser.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/JLnkParser.java @@ -48,7 +48,7 @@ import org.sleuthkit.autopsy.coreutils.LnkEnums.NetworkProviderType; try { is.read(content); } catch (IOException ex) { - Logger.getLogger(JLnkParser.class.getName()).log(Level.WARNING, "Error reading input stream", ex); + Logger.getLogger(JLnkParser.class.getName()).log(Level.WARNING, "Error reading input stream", ex); //NON-NLS } } @@ -226,7 +226,7 @@ import org.sleuthkit.autopsy.coreutils.LnkEnums.NetworkProviderType; try { return new String(theString, "UTF-16LE"); } catch (UnsupportedEncodingException ex) { - logger.info("Shouldn't happen"); + logger.info("Shouldn't happen"); //NON-NLS return null; } } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/LocalDisk.java b/Core/src/org/sleuthkit/autopsy/coreutils/LocalDisk.java index c082250dea..518b4d1059 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/LocalDisk.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/LocalDisk.java @@ -47,11 +47,11 @@ public class LocalDisk { public String getReadableSize() { int unit = 1024; if (size < unit) { - return size + " B"; + return size + " B"; //NON-NLS } int exp = (int) (Math.log(size) / Math.log(unit)); - String pre = "KMGTPE".charAt(exp-1) + ""; - return String.format("%.1f %sB", size / Math.pow(unit, exp), pre); + String pre = "KMGTPE".charAt(exp-1) + ""; //NON-NLS + return String.format("%.1f %sB", size / Math.pow(unit, exp), pre); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/Logger.java b/Core/src/org/sleuthkit/autopsy/coreutils/Logger.java index 7c09da5f7a..b1b3e2402d 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/Logger.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/Logger.java @@ -56,16 +56,16 @@ public class Logger extends java.util.logging.Logger { /** * Main messages log file name */ - public static final String messagesLog = "autopsy.log"; + public static final String messagesLog = "autopsy.log"; //NON-NLS /** * Detailed exception trace log file name */ - public static final String tracesLog = "autopsy_traces.log"; + public static final String tracesLog = "autopsy_traces.log"; //NON-NLS /** * Action logger file name */ - public static final String actionsLog = "autopsy_actions.log"; + public static final String actionsLog = "autopsy_actions.log"; //NON-NLS /** * Static blocks to get around compile errors such as "variable might not @@ -82,7 +82,7 @@ public class Logger extends java.util.logging.Logger { f.setFormatter(new SimpleFormatter()); return f; } catch (IOException e) { - throw new RuntimeException("Error initializing traces logger", e); + throw new RuntimeException("Error initializing traces logger", e); //NON-NLS } } @@ -93,7 +93,7 @@ public class Logger extends java.util.logging.Logger { f.setFormatter(new SimpleFormatter()); return f; } catch (IOException e) { - throw new RuntimeException("Error initializing normal logger", e); + throw new RuntimeException("Error initializing normal logger", e); //NON-NLS } } @@ -102,13 +102,13 @@ public class Logger extends java.util.logging.Logger { FileHandler f = new FileHandler(LOG_DIR + actionsLog, LOG_SIZE, LOG_FILE_COUNT); f.setEncoding(LOG_ENCODING); f.setFormatter(new SimpleFormatter()); - java.util.logging.Logger _actionsLogger = java.util.logging.Logger.getLogger("Actions"); + java.util.logging.Logger _actionsLogger = java.util.logging.Logger.getLogger("Actions"); //NON-NLS _actionsLogger.setUseParentHandlers(false); _actionsLogger.addHandler(f); _actionsLogger.addHandler(console); return _actionsLogger; } catch (IOException e) { - throw new RuntimeException("Error initializing actions logger", e); + throw new RuntimeException("Error initializing actions logger", e); //NON-NLS } } @@ -133,7 +133,7 @@ public class Logger extends java.util.logging.Logger { * @param actionClass class where user triggered action occurs */ public static void noteAction(Class actionClass) { - actionsLogger.log(Level.INFO, "Action performed: {0}", actionClass.getName()); + actionsLogger.log(Level.INFO, "Action performed: {0}", actionClass.getName()); //NON-NLS } /** @@ -164,7 +164,7 @@ public class Logger extends java.util.logging.Logger { @Override public void log(Level level, String message, Throwable thrown) { - super.log(level, message + "\nException: " + thrown.toString()); + super.log(level, message + "\nException: " + thrown.toString()); //NON-NLS removeHandler(normal); super.log(level, message, thrown); addHandler(normal); diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/MessageNotifyUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/MessageNotifyUtil.java index cc4aeabb57..558167c2bb 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/MessageNotifyUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/MessageNotifyUtil.java @@ -49,9 +49,9 @@ public class MessageNotifyUtil { public enum MessageType { - INFO(NotifyDescriptor.INFORMATION_MESSAGE, "info-icon-16.png"), - ERROR(NotifyDescriptor.ERROR_MESSAGE, "error-icon-16.png"), - WARNING(NotifyDescriptor.WARNING_MESSAGE, "warning-icon-16.png"); + INFO(NotifyDescriptor.INFORMATION_MESSAGE, "info-icon-16.png"), //NON-NLS + ERROR(NotifyDescriptor.ERROR_MESSAGE, "error-icon-16.png"), //NON-NLS + WARNING(NotifyDescriptor.WARNING_MESSAGE, "warning-icon-16.png"); //NON-NLS private int notifyDescriptorType; private Icon icon; @@ -65,10 +65,10 @@ public class MessageNotifyUtil { } private static Icon loadIcon(String resourceName) { - Icon icon = ImageUtilities.loadImageIcon("org/sleuthkit/autopsy/images/" + resourceName, false); + Icon icon = ImageUtilities.loadImageIcon("org/sleuthkit/autopsy/images/" + resourceName, false); //NON-NLS if (icon == null) { Logger logger = Logger.getLogger(org.sleuthkit.autopsy.coreutils.MessageNotifyUtil.MessageType.class.getName()); - logger.log(Level.SEVERE, "Failed to load icon resource: " + resourceName + ". Using blank image."); + logger.log(Level.SEVERE, "Failed to load icon resource: " + resourceName + ". Using blank image."); //NON-NLS NON-NLS icon = new ImageIcon(); } return icon; diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/ModuleSettings.java b/Core/src/org/sleuthkit/autopsy/coreutils/ModuleSettings.java index e6d97afe0f..2f1b6eee22 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/ModuleSettings.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/ModuleSettings.java @@ -38,8 +38,8 @@ public class ModuleSettings { // The directory where the properties file is located private final static String moduleDirPath = PlatformUtil.getUserConfigDirectory(); - public static final String DEFAULT_CONTEXT = "GeneralContext"; - public static final String MAIN_SETTINGS = "Case"; + public static final String DEFAULT_CONTEXT = "GeneralContext"; //NON-NLS + public static final String MAIN_SETTINGS = "Case"; //NON-NLS /** the constructor */ private ModuleSettings() {} @@ -64,7 +64,7 @@ public class ModuleSettings { fos.close(); } catch(IOException e){ - Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Was not able to create a new properties file.", e); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Was not able to create a new properties file.", e); //NON-NLS return false; } return true; @@ -104,7 +104,7 @@ public class ModuleSettings { */ private static String getPropertyPath(String moduleName){ if(configExists(moduleName)){ - return moduleDirPath + File.separator + moduleName + ".properties"; + return moduleDirPath + File.separator + moduleName + ".properties"; //NON-NLS } return null; @@ -120,7 +120,7 @@ public class ModuleSettings { public static String getConfigSetting(String moduleName, String settingName) { if (!configExists(moduleName)) { makeConfigFile(moduleName); - Logger.getLogger(ModuleSettings.class.getName()).log(Level.INFO, "File did not exist. Created file [" + moduleName + ".properties]"); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.INFO, "File did not exist. Created file [" + moduleName + ".properties]"); //NON-NLS NON-NLS } try { @@ -128,7 +128,7 @@ public class ModuleSettings { return props.getProperty(settingName); } catch (IOException e) { - Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Could not read config file [" + moduleName + "]", e); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Could not read config file [" + moduleName + "]", e); //NON-NLS return null; } @@ -145,7 +145,7 @@ public class ModuleSettings { if (!configExists(moduleName)) { makeConfigFile(moduleName); - Logger.getLogger(ModuleSettings.class.getName()).log(Level.INFO, "File did not exist. Created file [" + moduleName + ".properties]"); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.INFO, "File did not exist. Created file [" + moduleName + ".properties]"); //NON-NLS NON-NLS } try { Properties props = fetchProperties(moduleName); @@ -159,7 +159,7 @@ public class ModuleSettings { return map; } catch (IOException e) { - Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Could not read config file [" + moduleName + "]", e); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Could not read config file [" + moduleName + "]", e); //NON-NLS return null; } } @@ -172,7 +172,7 @@ public class ModuleSettings { public static synchronized void setConfigSettings(String moduleName, Map settings) { if (!configExists(moduleName)) { makeConfigFile(moduleName); - Logger.getLogger(ModuleSettings.class.getName()).log(Level.INFO, "File did not exist. Created file [" + moduleName + ".properties]"); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.INFO, "File did not exist. Created file [" + moduleName + ".properties]"); //NON-NLS NON-NLS } try { Properties props = fetchProperties(moduleName); @@ -183,10 +183,10 @@ public class ModuleSettings { File path = new File(getPropertyPath(moduleName)); FileOutputStream fos = new FileOutputStream(path); - props.store(fos, "Changed config settings(batch)"); + props.store(fos, "Changed config settings(batch)"); //NON-NLS fos.close(); } catch (IOException e) { - Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Property file exists for [" + moduleName + "] at [" + getPropertyPath(moduleName) + "] but could not be loaded.", e); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Property file exists for [" + moduleName + "] at [" + getPropertyPath(moduleName) + "] but could not be loaded.", e); //NON-NLS NON-NLS NON-NLS } } @@ -199,7 +199,7 @@ public class ModuleSettings { public static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal) { if (!configExists(moduleName)) { makeConfigFile(moduleName); - Logger.getLogger(ModuleSettings.class.getName()).log(Level.INFO, "File did not exist. Created file [" + moduleName + ".properties]"); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.INFO, "File did not exist. Created file [" + moduleName + ".properties]"); //NON-NLS NON-NLS } try { @@ -209,10 +209,10 @@ public class ModuleSettings { File path = new File(getPropertyPath(moduleName)); FileOutputStream fos = new FileOutputStream(path); - props.store(fos, "Changed config settings(single)"); + props.store(fos, "Changed config settings(single)"); //NON-NLS fos.close(); } catch (IOException e) { - Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Property file exists for [" + moduleName + "] at [" + getPropertyPath(moduleName) + "] but could not be loaded.", e); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Property file exists for [" + moduleName + "] at [" + getPropertyPath(moduleName) + "] but could not be loaded.", e); //NON-NLS NON-NLS NON-NLS } } @@ -229,12 +229,12 @@ public class ModuleSettings { props.remove(key); File path = new File(getPropertyPath(moduleName)); FileOutputStream fos = new FileOutputStream(path); - props.store(fos, "Removed " + key); + props.store(fos, "Removed " + key); //NON-NLS fos.close(); } } catch(IOException e ){ - Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Could not remove property from file, file not found", e); + Logger.getLogger(ModuleSettings.class.getName()).log(Level.WARNING, "Could not remove property from file, file not found", e); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java index d3258e5885..79eeb78c3c 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java @@ -61,7 +61,7 @@ public class PlatformUtil { * @return absolute path string to the install root dir */ public static String getInstallPath() { - File coreFolder = InstalledFileLocator.getDefault().locate("core", PlatformUtil.class.getPackage().getName(), false); + File coreFolder = InstalledFileLocator.getDefault().locate("core", PlatformUtil.class.getPackage().getName(), false); //NON-NLS File rootPath = coreFolder.getParentFile().getParentFile(); return rootPath.getAbsolutePath(); } @@ -73,7 +73,7 @@ public class PlatformUtil { * not found */ public static String getInstallModulesPath() { - File coreFolder = InstalledFileLocator.getDefault().locate("core", PlatformUtil.class.getPackage().getName(), false); + File coreFolder = InstalledFileLocator.getDefault().locate("core", PlatformUtil.class.getPackage().getName(), false); //NON-NLS File rootPath = coreFolder.getParentFile(); String modulesPath = rootPath.getAbsolutePath() + File.separator + "modules"; @@ -122,10 +122,10 @@ public class PlatformUtil { NbBundle.getMessage(PlatformUtil.class, "PlatformUtil.jrePath.jreDir.msg", jrePath.getAbsolutePath())); - javaPath = jrePath.getAbsolutePath() + File.separator + "bin" + File.separator + "java"; + javaPath = jrePath.getAbsolutePath() + File.separator + "bin" + File.separator + "java"; //NON-NLS } else { //else use system installed java in PATH env variable - javaPath = "java"; + javaPath = "java"; //NON-NLS } @@ -172,7 +172,7 @@ public class PlatformUtil { * @return Get user config directory path string */ public static String getUserConfigDirectory() { - return Places.getUserDirectory() + File.separator + "config"; + return Places.getUserDirectory() + File.separator + "config"; //NON-NLS } /** @@ -182,7 +182,7 @@ public class PlatformUtil { */ public static String getLogDirectory() { return Places.getUserDirectory().getAbsolutePath() + File.separator - + "var" + File.separator + "log" + File.separator; + + "var" + File.separator + "log" + File.separator; //NON-NLS } public static String getDefaultPlatformFileEncoding() { @@ -247,7 +247,7 @@ public class PlatformUtil { * @return OS name string */ public static String getOSName() { - return System.getProperty("os.name", OS_NAME_UNKNOWN); + return System.getProperty("os.name", OS_NAME_UNKNOWN); //NON-NLS } /** @@ -256,7 +256,7 @@ public class PlatformUtil { * @return OS version string */ public static String getOSVersion() { - return System.getProperty("os.version", OS_VERSION_UNKNOWN); + return System.getProperty("os.version", OS_VERSION_UNKNOWN); //NON-NLS } /** @@ -265,7 +265,7 @@ public class PlatformUtil { * @return OS arch string */ public static String getOSArch() { - return System.getProperty("os.arch", OS_ARCH_UNKNOWN); + return System.getProperty("os.arch", OS_ARCH_UNKNOWN); //NON-NLS } /** @@ -274,7 +274,7 @@ public class PlatformUtil { * @return true if running on Windows OS */ public static boolean isWindowsOS() { - return PlatformUtil.getOSName().toLowerCase().contains("windows"); + return PlatformUtil.getOSName().toLowerCase().contains("windows"); //NON-NLS } /** @@ -304,10 +304,10 @@ public class PlatformUtil { int n = 0; int breakCount = 0; while (true) { - String path = "\\\\.\\PhysicalDrive" + n; + String path = "\\\\.\\PhysicalDrive" + n; //NON-NLS if (canReadDrive(path)) { try { - drives.add(new LocalDisk("Drive " + n, path, SleuthkitJNI.findDeviceSize(path))); + drives.add(new LocalDisk("Drive " + n, path, SleuthkitJNI.findDeviceSize(path))); //NON-NLS } catch (TskCoreException ex) { // Don't add the drive because we can't read the size } @@ -326,8 +326,8 @@ public class PlatformUtil { File[] files = dev.listFiles(); for (File f : files) { String name = f.getName(); - if ((name.contains("hd") || name.contains("sd")) && f.canRead() && name.length() == 3) { - String path = "/dev/" + name; + if ((name.contains("hd") || name.contains("sd")) && f.canRead() && name.length() == 3) { //NON-NLS + String path = "/dev/" + name; //NON-NLS if (canReadDrive(path)) { try { drives.add(new LocalDisk(path, path, SleuthkitJNI.findDeviceSize(path))); @@ -369,8 +369,8 @@ public class PlatformUtil { File[] files = dev.listFiles(); for (File f : files) { String name = f.getName(); - if ((name.contains("hd") || name.contains("sd")) && f.canRead() && name.length() == 4) { - String path = "/dev/" + name; + if ((name.contains("hd") || name.contains("sd")) && f.canRead() && name.length() == 4) { //NON-NLS + String path = "/dev/" + name; //NON-NLS if (canReadDrive(path)) { drives.add(new LocalDisk(path, path, f.getTotalSpace())); } @@ -451,7 +451,7 @@ public class PlatformUtil { */ public static synchronized long getJavaPID(String sigarSubQuery) { long jpid = -1; - final String sigarQuery = "State.Name.sw=java," + sigarSubQuery; + final String sigarQuery = "State.Name.sw=java," + sigarSubQuery; //NON-NLS try { if (sigar == null) { sigar = org.sleuthkit.autopsy.corelibs.SigarLoader.getSigar(); @@ -482,7 +482,7 @@ public class PlatformUtil { */ public static synchronized long[] getJavaPIDs(String sigarSubQuery) { long[] jpids = null; - final String sigarQuery = "State.Name.sw=java," + sigarSubQuery; + final String sigarQuery = "State.Name.sw=java," + sigarSubQuery; //NON-NLS try { if (sigar == null) { sigar = org.sleuthkit.autopsy.corelibs.SigarLoader.getSigar(); diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/StringExtract.java b/Core/src/org/sleuthkit/autopsy/coreutils/StringExtract.java index 5179859211..3f096a8ed7 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/StringExtract.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/StringExtract.java @@ -686,18 +686,18 @@ public class StringExtract { LATIN_1 { @Override public String toString() { - return "Latin - Basic"; + return "Latin - Basic"; //NON-NLS } @Override public String getLanguages() { - return "English"; + return "English"; //NON-NLS } }, GREEK { @Override public String toString() { - return "Greek"; + return "Greek"; //NON-NLS } @Override @@ -708,18 +708,18 @@ public class StringExtract { CYRILLIC { @Override public String toString() { - return "Cyrillic"; + return "Cyrillic"; //NON-NLS } @Override public String getLanguages() { - return "Russian, Bulgarian, Serbian, Moldovan"; + return "Russian, Bulgarian, Serbian, Moldovan"; //NON-NLS } }, ARMENIAN { @Override public String toString() { - return "Armenian"; + return "Armenian"; //NON-NLS } @Override @@ -730,7 +730,7 @@ public class StringExtract { HEBREW { @Override public String toString() { - return "Hebrew"; + return "Hebrew"; //NON-NLS } @Override @@ -741,7 +741,7 @@ public class StringExtract { ARABIC { @Override public String toString() { - return "Arabic"; + return "Arabic"; //NON-NLS } @Override @@ -770,7 +770,7 @@ public class StringExtract { BENGALI { @Override public String toString() { - return "Bengali"; + return "Bengali"; //NON-NLS } @Override @@ -829,7 +829,7 @@ public class StringExtract { THAI { @Override public String toString() { - return "Thai"; + return "Thai"; //NON-NLS } @Override @@ -840,7 +840,7 @@ public class StringExtract { LAO { @Override public String toString() { - return "Laotian"; + return "Laotian"; //NON-NLS } @Override @@ -851,7 +851,7 @@ public class StringExtract { TIBETAN { @Override public String toString() { - return "Tibetian"; + return "Tibetian"; //NON-NLS } @Override @@ -868,7 +868,7 @@ public class StringExtract { GEORGIAN { @Override public String toString() { - return "Georgian"; + return "Georgian"; //NON-NLS } @Override @@ -879,18 +879,18 @@ public class StringExtract { HANGUL { @Override public String toString() { - return "Hangul"; + return "Hangul"; //NON-NLS } @Override public String getLanguages() { - return "Korean"; + return "Korean"; //NON-NLS } }, ETHIOPIC { @Override public String toString() { - return "Ethiopic"; + return "Ethiopic"; //NON-NLS } @Override @@ -925,18 +925,18 @@ public class StringExtract { KHMER { @Override public String toString() { - return "Khmer"; + return "Khmer"; //NON-NLS } @Override public String getLanguages() { - return "Cambodian"; + return "Cambodian"; //NON-NLS } }, MONGOLIAN { @Override public String toString() { - return "Mongolian"; + return "Mongolian"; //NON-NLS } @Override @@ -947,23 +947,23 @@ public class StringExtract { HIRAGANA { @Override public String toString() { - return "Hiragana"; + return "Hiragana"; //NON-NLS } @Override public String getLanguages() { - return "Japanese"; + return "Japanese"; //NON-NLS } }, KATAKANA { @Override public String toString() { - return "Katakana"; + return "Katakana"; //NON-NLS } @Override public String getLanguages() { - return "Japanese"; + return "Japanese"; //NON-NLS } }, BOPOMOFO { @@ -975,12 +975,12 @@ public class StringExtract { HAN { @Override public String toString() { - return "Han"; + return "Han"; //NON-NLS } @Override public String getLanguages() { - return "Chinese, Japanese, Korean"; + return "Chinese, Japanese, Korean"; //NON-NLS } }, YI { @@ -1172,17 +1172,17 @@ public class StringExtract { LATIN_2 { @Override public String toString() { - return "Latin - Extended"; + return "Latin - Extended"; //NON-NLS } @Override public String getLanguages() { - return "European"; + return "European"; //NON-NLS } } }; private static final SCRIPT[] SCRIPT_VALUES = SCRIPT.values(); - private static final String PROPERTY_FILE = "StringExtract.properties"; + private static final String PROPERTY_FILE = "StringExtract.properties"; //NON-NLS /** * table has an entry for every possible 2-byte value */ @@ -1268,7 +1268,7 @@ public class StringExtract { int toks = st.countTokens(); //logger.log(Level.INFO, "TABLE TOKS: " + toks); if (toks != UNICODE_TABLE_SIZE) { - logger.log(Level.WARNING, "Unicode table corrupt, expecting: " + UNICODE_TABLE_SIZE, ", have: " + toks); + logger.log(Level.WARNING, "Unicode table corrupt, expecting: " + UNICODE_TABLE_SIZE, ", have: " + toks); //NON-NLS return false; } @@ -1279,10 +1279,10 @@ public class StringExtract { unicodeTable[tableIndex++] = code; } - logger.log(Level.INFO, "initialized, unicode table loaded"); + logger.log(Level.INFO, "initialized, unicode table loaded"); //NON-NLS } catch (IOException ex) { - logger.log(Level.WARNING, "Could not load" + PROPERTY_FILE); + logger.log(Level.WARNING, "Could not load" + PROPERTY_FILE); //NON-NLS return false; } diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/TestLogger.java b/Core/src/org/sleuthkit/autopsy/coreutils/TestLogger.java index e03ff9d05a..7e7a191a4f 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/TestLogger.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/TestLogger.java @@ -35,7 +35,7 @@ import java.util.logging.Level; @Override public void actionPerformed(ActionEvent e) { - logger.log(Level.WARNING, "Testing log!", new Exception(new Exception(new Exception(new Exception("original reason with asdfasdfasdfasdfasd fasdfasdfasdf sdfasdfasdfa asdfasdf asdfa sdfas ", new Exception("more original reason")))))); + logger.log(Level.WARNING, "Testing log!", new Exception(new Exception(new Exception(new Exception("original reason with asdfasdfasdfasdfasd fasdfasdfasdf sdfasdfasdfa asdfasdf asdfa sdfas ", new Exception("more original reason")))))); //NON-NLS //throw new RuntimeException("othe"); //logger.log(Level.WARNING, "Testing log!"); diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/Version.java b/Core/src/org/sleuthkit/autopsy/coreutils/Version.java index 6ccbd1c134..9b086585d8 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/Version.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/Version.java @@ -44,7 +44,7 @@ public class Version { versionProperties = new Properties(); try { - InputStream inputStream = Version.class.getResourceAsStream("Version.properties"); + InputStream inputStream = Version.class.getResourceAsStream("Version.properties"); //NON-NLS versionProperties.load(inputStream); } catch (IOException e) { versionProperties = null; diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/XMLUtil.java b/Core/src/org/sleuthkit/autopsy/coreutils/XMLUtil.java index ed401bc5c3..5b87e0ce42 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/XMLUtil.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/XMLUtil.java @@ -81,12 +81,12 @@ public class XMLUtil { return true; } catch(SAXException e){ - Logger.getLogger(clazz.getName()).log(Level.WARNING, "Unable to validate XML file.", e); + Logger.getLogger(clazz.getName()).log(Level.WARNING, "Unable to validate XML file.", e); //NON-NLS return false; } } catch(IOException e){ - Logger.getLogger(clazz.getName()).log(Level.WARNING, "Unable to load XML file [" + xmlfile.toString() + "] of type ["+schemaFile+"]", e); + Logger.getLogger(clazz.getName()).log(Level.WARNING, "Unable to load XML file [" + xmlfile.toString() + "] of type ["+schemaFile+"]", e); //NON-NLS return false; } } @@ -128,18 +128,18 @@ public class XMLUtil { ret = builder.parse( new FileInputStream(xmlPath)); } catch (ParserConfigurationException e) { - Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file: can't initialize parser.", e); + Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file: can't initialize parser.", e); //NON-NLS } catch (SAXException e) { - Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file: can't parse XML.", e); + Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file: can't parse XML.", e); //NON-NLS } catch (IOException e) { //error reading file - Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file: can't read file.", e); + Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file: can't read file.", e); //NON-NLS } if (!XMLUtil.xmlIsValid(ret, clazz, xsdPath)) { - Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file: could not validate against [" + xsdPath + "], results may not be accurate"); + Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error loading XML file: could not validate against [" + xsdPath + "], results may not be accurate"); //NON-NLS } return ret; @@ -156,14 +156,14 @@ public class XMLUtil { */ public static boolean saveDoc(Class clazz, String xmlPath, String encoding, final Document doc) { TransformerFactory xf = TransformerFactory.newInstance(); - xf.setAttribute("indent-number", new Integer(1)); + xf.setAttribute("indent-number", new Integer(1)); //NON-NLS boolean success = false; try { Transformer xformer = xf.newTransformer(); - xformer.setOutputProperty(OutputKeys.METHOD, "xml"); - xformer.setOutputProperty(OutputKeys.INDENT, "yes"); + xformer.setOutputProperty(OutputKeys.METHOD, "xml"); //NON-NLS + xformer.setOutputProperty(OutputKeys.INDENT, "yes"); //NON-NLS xformer.setOutputProperty(OutputKeys.ENCODING, encoding); - xformer.setOutputProperty(OutputKeys.STANDALONE, "yes"); + xformer.setOutputProperty(OutputKeys.STANDALONE, "yes"); //NON-NLS xformer.setOutputProperty(OutputKeys.VERSION, "1.0"); File file = new File(xmlPath); FileOutputStream stream = new FileOutputStream(file); @@ -174,15 +174,15 @@ public class XMLUtil { success = true; } catch (UnsupportedEncodingException e) { - Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Should not happen", e); + Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Should not happen", e); //NON-NLS } catch (TransformerConfigurationException e) { - Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error writing XML file", e); + Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error writing XML file", e); //NON-NLS } catch (TransformerException e) { - Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error writing XML file", e); + Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error writing XML file", e); //NON-NLS } catch (FileNotFoundException e) { - Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error writing XML file: cannot write to file: " + xmlPath, e); + Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error writing XML file: cannot write to file: " + xmlPath, e); //NON-NLS } catch (IOException e) { - Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error writing XML file: cannot write to file: " + xmlPath, e); + Logger.getLogger(clazz.getName()).log(Level.SEVERE, "Error writing XML file: cannot write to file: " + xmlPath, e); //NON-NLS } return success; } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java index d9abf2f79b..7c8b6cb289 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractAbstractFileNode.java @@ -189,7 +189,7 @@ public abstract class AbstractAbstractFileNode extends A try { path = content.getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Except while calling Content.getUniquePath() on {0}", content); + logger.log(Level.SEVERE, "Except while calling Content.getUniquePath() on {0}", content); //NON-NLS } map.put(AbstractFilePropertyType.NAME.toString(), AbstractAbstractFileNode.getContentDisplayName(content)); @@ -252,23 +252,23 @@ public abstract class AbstractAbstractFileNode extends A // } // } - String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " - + "FROM blackboard_attributes,blackboard_artifacts WHERE " - + "attribute_type_id=" + setNameId - + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" - + " AND blackboard_artifacts.artifact_type_id=" + artId - + " AND blackboard_artifacts.obj_id=" + objId; + String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " //NON-NLS + + "FROM blackboard_attributes,blackboard_artifacts WHERE " //NON-NLS + + "attribute_type_id=" + setNameId //NON-NLS + + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" //NON-NLS + + " AND blackboard_artifacts.artifact_type_id=" + artId //NON-NLS + + " AND blackboard_artifacts.obj_id=" + objId; //NON-NLS rs = skCase.runQuery(query); int i = 0; while (rs.next()) { if (i++ > 0) { strList += ", "; } - strList += rs.getString("value_text"); + strList += rs.getString("value_text"); //NON-NLS } } catch (SQLException ex) { - logger.log(Level.WARNING, "SQL Exception occurred: ", ex); + logger.log(Level.WARNING, "SQL Exception occurred: ", ex); //NON-NLS } // catch (TskCoreException ex) { // logger.log(Level.WARNING, "TskCore Exception occurred: ", ex); @@ -278,7 +278,7 @@ public abstract class AbstractAbstractFileNode extends A try { skCase.closeRunQuery(rs); } catch (SQLException ex) { - logger.log(Level.WARNING, "Error closing result set after getting hashset hits", ex); + logger.log(Level.WARNING, "Error closing result set after getting hashset hits", ex); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java index 94d853c749..aa51479cfc 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractContentNode.java @@ -52,7 +52,7 @@ public abstract class AbstractContentNode extends ContentNode super(new ContentChildren(content), Lookups.singleton(content)); this.content = content; //super.setName(ContentUtils.getSystemName(content)); - super.setName("content_" + Long.toString(content.getId())); + super.setName("content_" + Long.toString(content.getId())); //NON-NLS } /** @@ -87,7 +87,7 @@ public abstract class AbstractContentNode extends ContentNode try { hasChildren = content.hasChildren(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error checking if the node has children, for content: " + content, ex); + logger.log(Level.SEVERE, "Error checking if the node has children, for content: " + content, ex); //NON-NLS } } @@ -107,7 +107,7 @@ public abstract class AbstractContentNode extends ContentNode try { childrenIds = content.getChildrenIds(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting children ids, for content: " + content, ex); + logger.log(Level.SEVERE, "Error getting children ids, for content: " + content, ex); //NON-NLS } } @@ -127,7 +127,7 @@ public abstract class AbstractContentNode extends ContentNode try { children = content.getChildren(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting children, for content: " + content, ex); + logger.log(Level.SEVERE, "Error getting children, for content: " + content, ex); //NON-NLS } } @@ -150,7 +150,7 @@ public abstract class AbstractContentNode extends ContentNode try { childrenCount = content.getChildrenCount(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error checking node content children count, for content: " + content, ex); + logger.log(Level.SEVERE, "Error checking node content children count, for content: " + content, ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractFsContentNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractFsContentNode.java index a93680cd79..3b086a0d1f 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/AbstractFsContentNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/AbstractFsContentNode.java @@ -36,7 +36,7 @@ public abstract class AbstractFsContentNode extends Abst private boolean directoryBrowseMode; - public static final String HIDE_PARENT = "hide_parent"; + public static final String HIDE_PARENT = "hide_parent"; //NON-NLS AbstractFsContentNode(T fsContent) { this(fsContent, true); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactStringContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactStringContent.java index 088d18588b..0cf4d6dc46 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactStringContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactStringContent.java @@ -54,29 +54,29 @@ public class ArtifactStringContent implements StringContent { if (stringContent.isEmpty()) { try { StringBuilder buffer = new StringBuilder(); - buffer.append("\n"); - buffer.append("\n"); + buffer.append("\n"); //NON-NLS + buffer.append("\n"); //NON-NLS // artifact name header - buffer.append("

"); + buffer.append("

"); //NON-NLS buffer.append(wrapped.getDisplayName()); - buffer.append("

\n"); + buffer.append("\n"); //NON-NLS // start table for attributes - buffer.append(""); - buffer.append(""); - buffer.append("\n"); + buffer.append("
"); //NON-NLS + buffer.append(""); //NON-NLS + buffer.append("\n"); //NON-NLS // cycle through each attribute and display in a row in the table. for (BlackboardAttribute attr : wrapped.getAttributes()) { // name column - buffer.append(""); + buffer.append(""); //NON-NLS // value column - buffer.append(""); - buffer.append("\n"); + buffer.append(""); //NON-NLS + buffer.append("\n"); //NON-NLS } final Content content = getAssociatedContent(wrapped); @@ -131,22 +131,22 @@ public class ArtifactStringContent implements StringContent { try { path = content.getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Exception while calling Content.getUniquePath() on {0} : {1}", new Object[]{content, ex.getLocalizedMessage()}); + logger.log(Level.SEVERE, "Exception while calling Content.getUniquePath() on {0} : {1}", new Object[]{content, ex.getLocalizedMessage()}); //NON-NLS } //add file path - buffer.append(""); - buffer.append(""); //NON-NLS + buffer.append(""); - buffer.append(""); //NON-NLS + buffer.append(""); - buffer.append("\n"); + buffer.append(""); //NON-NLS + buffer.append("\n"); //NON-NLS - buffer.append("
"); + buffer.append("
"); //NON-NLS buffer.append(attr.getAttributeTypeDisplayName()); - buffer.append(""); + buffer.append(""); //NON-NLS if (attr.getAttributeTypeID() == ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID() || attr.getAttributeTypeID() == ATTRIBUTE_TYPE.TSK_DATETIME_ACCESSED.getTypeID() || attr.getAttributeTypeID() == ATTRIBUTE_TYPE.TSK_DATETIME_CREATED.getTypeID() @@ -96,10 +96,10 @@ public class ArtifactStringContent implements StringContent { switch (attr.getValueType()) { case STRING: String str = attr.getValueString(); - str = str.replaceAll(" ", " "); - str = str.replaceAll("<", "<"); - str = str.replaceAll(">", ">"); - str = str.replaceAll("(\r\n|\n)", "
"); + str = str.replaceAll(" ", " "); //NON-NLS + str = str.replaceAll("<", "<"); //NON-NLS + str = str.replaceAll(">", ">"); //NON-NLS + str = str.replaceAll("(\r\n|\n)", "
"); //NON-NLS buffer.append(str); break; case INTEGER: @@ -121,8 +121,8 @@ public class ArtifactStringContent implements StringContent { buffer.append(attr.getContext()); buffer.append(")"); } - buffer.append("
"); + buffer.append("
"); //NON-NLS buffer.append(NbBundle.getMessage(this.getClass(), "ArtifactStringContent.getStr.srcFilePath.text")); - buffer.append(""); + buffer.append(""); //NON-NLS buffer.append(path); - buffer.append("
"); - buffer.append("\n"); + buffer.append(""); //NON-NLS + buffer.append("\n"); //NON-NLS stringContent = buffer.toString(); } catch (TskException ex) { @@ -161,7 +161,7 @@ public class ArtifactStringContent implements StringContent { try { return artifact.getSleuthkitCase().getContentById(artifact.getObjectID()); } catch (TskException ex) { - logger.log(Level.WARNING, "Getting file failed", ex); + logger.log(Level.WARNING, "Getting file failed", ex); //NON-NLS } throw new IllegalArgumentException(NbBundle.getMessage(ArtifactStringContent.class, "ArtifactStringContent.exception.msg")); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeChildren.java b/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeChildren.java index e5f81d1844..a1c3182978 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeChildren.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeChildren.java @@ -49,7 +49,7 @@ class ArtifactTypeChildren extends ChildFactory{ list.addAll(arts); } catch (TskException ex) { Logger.getLogger(ArtifactTypeChildren.class.getName()) - .log(Level.SEVERE, "Couldn't get blackboard artifacts from database", ex); + .log(Level.SEVERE, "Couldn't get blackboard artifacts from database", ex); //NON-NLS } return true; } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeNode.java index 960e0d6bd0..5df1fc1474 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeNode.java @@ -49,11 +49,11 @@ public class ArtifactTypeNode extends DisplayableItemNode { this.childCount = skCase.getBlackboardArtifactsTypeCount(type.getTypeID()); } catch (TskException ex) { Logger.getLogger(ArtifactTypeNode.class.getName()) - .log(Level.WARNING, "Error getting child count", ex); + .log(Level.WARNING, "Error getting child count", ex); //NON-NLS } super.setDisplayName(type.getDisplayName() + " (" + childCount + ")"); this.type = type; - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/" + getIcon(type)); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/" + getIcon(type)); //NON-NLS } @@ -88,49 +88,49 @@ public class ArtifactTypeNode extends DisplayableItemNode { private String getIcon(BlackboardArtifact.ARTIFACT_TYPE type) { switch (type) { case TSK_WEB_BOOKMARK: - return "bookmarks.png"; + return "bookmarks.png"; //NON-NLS case TSK_WEB_COOKIE: - return "cookies.png"; + return "cookies.png"; //NON-NLS case TSK_WEB_HISTORY: - return "history.png"; + return "history.png"; //NON-NLS case TSK_WEB_DOWNLOAD: - return "downloads.png"; + return "downloads.png"; //NON-NLS case TSK_INSTALLED_PROG: - return "programs.png"; + return "programs.png"; //NON-NLS case TSK_RECENT_OBJECT: - return "recent_docs.png"; + return "recent_docs.png"; //NON-NLS case TSK_DEVICE_ATTACHED: - return "usb_devices.png"; + return "usb_devices.png"; //NON-NLS case TSK_WEB_SEARCH_QUERY: - return "searchquery.png"; + return "searchquery.png"; //NON-NLS case TSK_METADATA_EXIF: - return "camera-icon-16.png"; + return "camera-icon-16.png"; //NON-NLS case TSK_CONTACT: - return "contact.png"; + return "contact.png"; //NON-NLS case TSK_MESSAGE: - return "message.png"; + return "message.png"; //NON-NLS case TSK_CALLLOG: - return "calllog.png"; + return "calllog.png"; //NON-NLS case TSK_CALENDAR_ENTRY: - return "calendar.png"; + return "calendar.png"; //NON-NLS case TSK_SPEED_DIAL_ENTRY: - return "speeddialentry.png"; + return "speeddialentry.png"; //NON-NLS case TSK_BLUETOOTH_PAIRING: - return "bluetooth.png"; + return "bluetooth.png"; //NON-NLS case TSK_GPS_BOOKMARK: - return "gpsfav.png"; + return "gpsfav.png"; //NON-NLS case TSK_GPS_LAST_KNOWN_LOCATION: - return "gps-lastlocation.png"; + return "gps-lastlocation.png"; //NON-NLS case TSK_GPS_SEARCH: - return "gps-search.png"; + return "gps-search.png"; //NON-NLS case TSK_SERVICE_ACCOUNT: - return "account-icon-16.png"; + return "account-icon-16.png"; //NON-NLS case TSK_ENCRYPTION_DETECTED: - return "encrypted-file.png"; + return "encrypted-file.png"; //NON-NLS case TSK_EXT_MISMATCH_DETECTED: - return "mismatch-16.png"; + return "mismatch-16.png"; //NON-NLS } - return "artifact-icon.png"; + return "artifact-icon.png"; //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java index c03cfae66e..9cebc3a51c 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java @@ -93,7 +93,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { this.associated = this.getLookup().lookup(Content.class); this.setName(Long.toString(artifact.getArtifactID())); this.setDisplayName(associated.getName()); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/" + getIcon(BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID()))); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/" + getIcon(BlackboardArtifact.ARTIFACT_TYPE.fromID(artifact.getArtifactTypeID()))); //NON-NLS } @@ -154,7 +154,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { } } if (actualMimeType.isEmpty()) { - logger.log(Level.WARNING, "Could not find expected TSK_FILE_TYPE_SIG attribute."); + logger.log(Level.WARNING, "Could not find expected TSK_FILE_TYPE_SIG attribute."); //NON-NLS } else { ss.put(new NodeProperty<>( NbBundle.getMessage(this.getClass(), "BlackboardArtifactNode.createSheet.mimeType.name"), @@ -163,7 +163,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { actualMimeType)); } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Error while searching for TSK_FILE_TYPE_SIG attribute: ", ex); + logger.log(Level.WARNING, "Error while searching for TSK_FILE_TYPE_SIG attribute: ", ex); //NON-NLS } } @@ -172,7 +172,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { try { sourcePath = associated.getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get unique path from: {0}", associated.getName()); + logger.log(Level.WARNING, "Failed to get unique path from: {0}", associated.getName()); //NON-NLS } if (sourcePath.isEmpty() == false) { @@ -192,7 +192,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { dataSource = getRootParentName(); } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get image name from {0}", associated.getName()); + logger.log(Level.WARNING, "Failed to get image name from {0}", associated.getName()); //NON-NLS } if (dataSource.isEmpty() == false) { @@ -215,7 +215,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { parentName = parent.getName(); } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get parent name from {0}", associated.getName()); + logger.log(Level.WARNING, "Failed to get parent name from {0}", associated.getName()); //NON-NLS return ""; } return parentName; @@ -285,7 +285,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { } } } catch (TskException ex) { - logger.log(Level.SEVERE, "Getting attributes failed", ex); + logger.log(Level.SEVERE, "Getting attributes failed", ex); //NON-NLS } } @@ -313,7 +313,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { try { return artifact.getSleuthkitCase().getContentById(artifact.getObjectID()); } catch (TskException ex) { - logger.log(Level.WARNING, "Getting file failed", ex); + logger.log(Level.WARNING, "Getting file failed", ex); //NON-NLS } throw new IllegalArgumentException( NbBundle.getMessage(BlackboardArtifactNode.class, "BlackboardArtifactNode.getAssocCont.exception.msg")); @@ -348,7 +348,7 @@ public class BlackboardArtifactNode extends DisplayableItemNode { return highlightFactory.createInstance(content, keyword, isRegexp, origQuery); } } catch (TskException ex) { - logger.log(Level.WARNING, "Failed to retrieve Blackboard Attributes", ex); + logger.log(Level.WARNING, "Failed to retrieve Blackboard Attributes", ex); //NON-NLS } return null; } @@ -357,54 +357,54 @@ public class BlackboardArtifactNode extends DisplayableItemNode { private String getIcon(BlackboardArtifact.ARTIFACT_TYPE type) { switch (type) { case TSK_WEB_BOOKMARK: - return "bookmarks.png"; + return "bookmarks.png"; //NON-NLS case TSK_WEB_COOKIE: - return "cookies.png"; + return "cookies.png"; //NON-NLS case TSK_WEB_HISTORY: - return "history.png"; + return "history.png"; //NON-NLS case TSK_WEB_DOWNLOAD: - return "downloads.png"; + return "downloads.png"; //NON-NLS case TSK_INSTALLED_PROG: - return "programs.png"; + return "programs.png"; //NON-NLS case TSK_RECENT_OBJECT: - return "recent_docs.png"; + return "recent_docs.png"; //NON-NLS case TSK_DEVICE_ATTACHED: - return "usb_devices.png"; + return "usb_devices.png"; //NON-NLS case TSK_WEB_SEARCH_QUERY: - return "searchquery.png"; + return "searchquery.png"; //NON-NLS case TSK_TAG_FILE: - return "blue-tag-icon-16.png"; + return "blue-tag-icon-16.png"; //NON-NLS case TSK_TAG_ARTIFACT: - return "green-tag-icon-16.png"; + return "green-tag-icon-16.png"; //NON-NLS case TSK_METADATA_EXIF: - return "camera-icon-16.png"; + return "camera-icon-16.png"; //NON-NLS case TSK_CONTACT: - return "contact.png"; + return "contact.png"; //NON-NLS case TSK_MESSAGE: - return "message.png"; + return "message.png"; //NON-NLS case TSK_CALLLOG: - return "calllog.png"; + return "calllog.png"; //NON-NLS case TSK_CALENDAR_ENTRY: - return "calendar.png"; + return "calendar.png"; //NON-NLS case TSK_SPEED_DIAL_ENTRY: - return "speeddialentry.png"; + return "speeddialentry.png"; //NON-NLS case TSK_BLUETOOTH_PAIRING: - return "bluetooth.png"; + return "bluetooth.png"; //NON-NLS case TSK_GPS_BOOKMARK: - return "gpsfav.png"; + return "gpsfav.png"; //NON-NLS case TSK_GPS_LAST_KNOWN_LOCATION: - return "gps-lastlocation.png"; + return "gps-lastlocation.png"; //NON-NLS case TSK_GPS_SEARCH: - return "gps-search.png"; + return "gps-search.png"; //NON-NLS case TSK_SERVICE_ACCOUNT: - return "account-icon-16.png"; + return "account-icon-16.png"; //NON-NLS case TSK_ENCRYPTION_DETECTED: - return "encrypted-file.png"; + return "encrypted-file.png"; //NON-NLS case TSK_EXT_MISMATCH_DETECTED: - return "mismatch-16.png"; + return "mismatch-16.png"; //NON-NLS } - return "artifact-icon.png"; + return "artifact-icon.png"; //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java index e390c90550..fe531c6c49 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactTagNode.java @@ -39,7 +39,7 @@ import org.sleuthkit.datamodel.TskCoreException; */ public class BlackboardArtifactTagNode extends DisplayableItemNode { - private static final String ICON_PATH = "org/sleuthkit/autopsy/images/green-tag-icon-16.png"; + private static final String ICON_PATH = "org/sleuthkit/autopsy/images/green-tag-icon-16.png"; //NON-NLS private final BlackboardArtifactTag tag; public BlackboardArtifactTagNode(BlackboardArtifactTag tag) { @@ -68,7 +68,7 @@ public class BlackboardArtifactTagNode extends DisplayableItemNode { try { contentPath = tag.getContent().getUniquePath(); } catch (TskCoreException ex) { - Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + tag.getContent().getId() + ")", ex); + Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + tag.getContent().getId() + ")", ex); //NON-NLS contentPath = NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.unavail.text"); } properties.put(new NodeProperty<>( diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentHierarchyVisitor.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentHierarchyVisitor.java index f6ebcc78c9..ac5c9adf6d 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentHierarchyVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentHierarchyVisitor.java @@ -57,7 +57,7 @@ import org.sleuthkit.datamodel.VolumeSystem; try { children = parent.getChildren(); } catch (TskException ex) { - logger.log(Level.WARNING, "Error getting Content children.", ex); + logger.log(Level.WARNING, "Error getting Content children.", ex); //NON-NLS children = Collections.emptyList(); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentIdHierarchyVisitor.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentIdHierarchyVisitor.java index dbce27c925..9a62c60c8f 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentIdHierarchyVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentIdHierarchyVisitor.java @@ -57,7 +57,7 @@ import org.sleuthkit.datamodel.VolumeSystem; try { children = parent.getChildren(); } catch (TskException ex) { - logger.log(Level.WARNING, "Error getting Content children.", ex); + logger.log(Level.WARNING, "Error getting Content children.", ex); //NON-NLS children = Collections.emptyList(); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java index 47a9bc8dfd..64db7f086f 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagNode.java @@ -38,7 +38,7 @@ import org.sleuthkit.datamodel.TskCoreException; */ class ContentTagNode extends DisplayableItemNode { - private static final String ICON_PATH = "org/sleuthkit/autopsy/images/blue-tag-icon-16.png"; + private static final String ICON_PATH = "org/sleuthkit/autopsy/images/blue-tag-icon-16.png"; //NON-NLS private final ContentTag tag; public ContentTagNode(ContentTag tag) { @@ -66,7 +66,7 @@ class ContentTagNode extends DisplayableItemNode { try { contentPath = tag.getContent().getUniquePath(); } catch (TskCoreException ex) { - Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + tag.getContent().getId() + ")", ex); + Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + tag.getContent().getId() + ")", ex); //NON-NLS contentPath = NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.unavail.path"); } properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.filePath.name"), diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagTypeNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagTypeNode.java index f96719a501..661365827c 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagTypeNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentTagTypeNode.java @@ -40,7 +40,7 @@ import org.sleuthkit.datamodel.TskCoreException; public class ContentTagTypeNode extends DisplayableItemNode { private static final String DISPLAY_NAME = NbBundle.getMessage(ContentTagTypeNode.class, "ContentTagTypeNode.displayName.text"); - private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; + private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; //NON-NLS public ContentTagTypeNode(TagName tagName) { super(Children.create(new ContentTagNodeFactory(tagName), true), Lookups.singleton(tagName.getDisplayName() + " " + DISPLAY_NAME)); @@ -49,7 +49,7 @@ public class ContentTagTypeNode extends DisplayableItemNode { try { tagsCount = Case.getCurrentCase().getServices().getTagsManager().getContentTagsCountByTagName(tagName); } catch (TskCoreException ex) { - Logger.getLogger(ContentTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get content tags count for " + tagName.getDisplayName() + " tag name", ex); + Logger.getLogger(ContentTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get content tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS } super.setName(DISPLAY_NAME); @@ -98,7 +98,7 @@ public class ContentTagTypeNode extends DisplayableItemNode { try { keys.addAll(Case.getCurrentCase().getServices().getTagsManager().getContentTagsByTagName(tagName)); } catch (TskCoreException ex) { - Logger.getLogger(ContentTagTypeNode.ContentTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); + Logger.getLogger(ContentTagTypeNode.ContentTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } return true; } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java b/Core/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java index ee771c4ea8..8310d430ed 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java @@ -75,7 +75,7 @@ public final class ContentUtils { } public static String getStringTimeISO8601(long epochSeconds, TimeZone tzone) { - String time = "0000-00-00T00:00:00Z"; + String time = "0000-00-00T00:00:00Z"; //NON-NLS if (epochSeconds != 0) { dateFormatterISO8601.setTimeZone(tzone); time = dateFormatterISO8601.format(new java.util.Date(epochSeconds * 1000)); @@ -259,7 +259,7 @@ public final class ContentUtils { ContentUtils.writeToFile(f, dest, progress, worker, source); } catch (IOException ex) { logger.log(Level.SEVERE, - "Trouble extracting file to " + dest.getAbsolutePath(), + "Trouble extracting file to " + dest.getAbsolutePath(), //NON-NLS ex); } return null; @@ -271,7 +271,7 @@ public final class ContentUtils { ContentUtils.writeToFile(f, dest, progress, worker, source); } catch (IOException ex) { logger.log(Level.SEVERE, - "Trouble extracting unallocated content file to " + dest.getAbsolutePath(), + "Trouble extracting unallocated content file to " + dest.getAbsolutePath(), //NON-NLS ex); } return null; @@ -283,7 +283,7 @@ public final class ContentUtils { ContentUtils.writeToFile(df, dest, progress, worker, source); } catch (IOException ex) { logger.log(Level.SEVERE, - "Error extracting derived file to " + dest.getAbsolutePath(), + "Error extracting derived file to " + dest.getAbsolutePath(), //NON-NLS ex); } return null; @@ -295,7 +295,7 @@ public final class ContentUtils { ContentUtils.writeToFile(lf, dest, progress, worker, source); } catch (IOException ex) { logger.log(Level.SEVERE, - "Error extracting local file to " + dest.getAbsolutePath(), + "Error extracting local file to " + dest.getAbsolutePath(), //NON-NLS ex); } return null; @@ -349,7 +349,7 @@ public final class ContentUtils { } } catch (TskException ex) { logger.log(Level.SEVERE, - "Trouble fetching children to extract.", ex); + "Trouble fetching children to extract.", ex); //NON-NLS } return null; diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DataConversion.java b/Core/src/org/sleuthkit/autopsy/datamodel/DataConversion.java index 5c7ff971f5..5fc1f45a64 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DataConversion.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DataConversion.java @@ -27,7 +27,7 @@ import java.util.Formatter; */ public class DataConversion { - final private static char[] hexArray = "0123456789ABCDEF".toCharArray(); + final private static char[] hexArray = "0123456789ABCDEF".toCharArray(); //NON-NLS /** * Return the hex-dump layout of the passed in byte array. @@ -67,7 +67,7 @@ public class DataConversion { // print the offset column //outputStringBuilder.append("0x"); - outputStringBuilder.append(String.format("0x%08x: ", arrayOffset + curOffset)); + outputStringBuilder.append(String.format("0x%08x: ", arrayOffset + curOffset)); //NON-NLS //outputStringBuilder.append(": "); // print the hex columns diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java index 4ef002365f..4d0ed1feb4 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DataSourcesNode.java @@ -36,7 +36,7 @@ public class DataSourcesNode extends DisplayableItemNode { super(new RootContentChildren(images), Lookups.singleton(NAME)); setName(NAME); setDisplayName(NAME); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/image.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/image.png"); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java index 580858aa44..80d28d96a0 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DeletedContent.java @@ -53,10 +53,10 @@ public class DeletedContent implements AutopsyVisitableItem { public enum DeletedContentFilter implements AutopsyVisitableItem { FS_DELETED_FILTER(0, - "FS_DELETED_FILTER", + "FS_DELETED_FILTER", //NON-NLS NbBundle.getMessage(DeletedContent.class, "DeletedContent.fsDelFilter.text")), ALL_DELETED_FILTER(1, - "ALL_DELETED_FILTER", + "ALL_DELETED_FILTER", //NON-NLS NbBundle.getMessage(DeletedContent.class, "DeletedContent.allDelFilter.text")); private int id; private String name; @@ -111,7 +111,7 @@ public class DeletedContent implements AutopsyVisitableItem { super.setName(NAME); super.setDisplayName(NAME); this.skCase = skCase; - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png"); //NON-NLS } @Override @@ -173,7 +173,7 @@ public class DeletedContent implements AutopsyVisitableItem { String tooltip = filter.getDisplayName(); this.setShortDescription(tooltip); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png"); //NON-NLS //get count of children without preloading all children nodes final long count = new DeletedContentChildren(filter, skCase).calculateItems(); @@ -245,21 +245,21 @@ public class DeletedContent implements AutopsyVisitableItem { String query = ""; switch (filter) { case FS_DELETED_FILTER: - query = "dir_flags = " + TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC.getValue() - + " AND meta_flags != " + TskData.TSK_FS_META_FLAG_ENUM.ORPHAN.getValue() - + " AND type = " + TskData.TSK_DB_FILES_TYPE_ENUM.FS.getFileType(); + query = "dir_flags = " + TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC.getValue() //NON-NLS + + " AND meta_flags != " + TskData.TSK_FS_META_FLAG_ENUM.ORPHAN.getValue() //NON-NLS + + " AND type = " + TskData.TSK_DB_FILES_TYPE_ENUM.FS.getFileType(); //NON-NLS break; case ALL_DELETED_FILTER: query = " ( " + "( " - + "(dir_flags = " + TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC.getValue() - + " OR " - + "meta_flags = " + TskData.TSK_FS_META_FLAG_ENUM.ORPHAN.getValue() + + "(dir_flags = " + TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC.getValue() //NON-NLS + + " OR " //NON-NLS + + "meta_flags = " + TskData.TSK_FS_META_FLAG_ENUM.ORPHAN.getValue() //NON-NLS + ")" - + " AND type = " + TskData.TSK_DB_FILES_TYPE_ENUM.FS.getFileType() + + " AND type = " + TskData.TSK_DB_FILES_TYPE_ENUM.FS.getFileType() //NON-NLS + " )" - + " OR type = " + TskData.TSK_DB_FILES_TYPE_ENUM.CARVED.getFileType() + + " OR type = " + TskData.TSK_DB_FILES_TYPE_ENUM.CARVED.getFileType() //NON-NLS + " )"; //+ " AND type != " + TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS.getFileType() //+ " AND type != " + TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS.getFileType() @@ -270,11 +270,11 @@ public class DeletedContent implements AutopsyVisitableItem { break; default: - logger.log(Level.SEVERE, "Unsupported filter type to get deleted content: {0}", filter); + logger.log(Level.SEVERE, "Unsupported filter type to get deleted content: {0}", filter); //NON-NLS } - query += " LIMIT " + MAX_OBJECTS; + query += " LIMIT " + MAX_OBJECTS; //NON-NLS return query; } @@ -285,7 +285,7 @@ public class DeletedContent implements AutopsyVisitableItem { try { ret = skCase.findAllFilesWhere(query); } catch (TskCoreException e) { - logger.log(Level.SEVERE, "Error getting files for the deleted content view using: " + query, e); + logger.log(Level.SEVERE, "Error getting files for the deleted content view using: " + query, e); //NON-NLS } return ret; @@ -301,7 +301,7 @@ public class DeletedContent implements AutopsyVisitableItem { try { return skCase.countFilesWhere(makeQuery()); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting deleted files search view count", ex); + logger.log(Level.SEVERE, "Error getting deleted files search view count", ex); //NON-NLS return 0; } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java index ced9942d07..c4d5aed86b 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/DirectoryNode.java @@ -56,9 +56,9 @@ public class DirectoryNode extends AbstractFsContentNode { private void setIcon(AbstractFile dir) { // set name, display name, and icon if (dir.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC)) { - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-deleted.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-deleted.png"); //NON-NLS } else { - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java index aed1c7ed77..7e0d8801f4 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java @@ -67,15 +67,15 @@ public class EmailExtracted implements AutopsyVisitableItem { try { int artId = BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG.getTypeID(); int pathAttrId = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PATH.getTypeID(); - String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " - + "FROM blackboard_attributes,blackboard_artifacts WHERE " - + "attribute_type_id=" + pathAttrId - + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" - + " AND blackboard_artifacts.artifact_type_id=" + artId; + String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " //NON-NLS + + "FROM blackboard_attributes,blackboard_artifacts WHERE " //NON-NLS + + "attribute_type_id=" + pathAttrId //NON-NLS + + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" //NON-NLS + + " AND blackboard_artifacts.artifact_type_id=" + artId; //NON-NLS ResultSet rs = skCase.runQuery(query); while (rs.next()) { - final String path = rs.getString("value_text"); - final long artifactId = rs.getLong("artifact_id"); + final String path = rs.getString("value_text"); //NON-NLS + final long artifactId = rs.getLong("artifact_id"); //NON-NLS final Map parsedPath = parsePath(path); final String account = parsedPath.get(MAIL_ACCOUNT); final String folder = parsedPath.get(MAIL_FOLDER); @@ -95,7 +95,7 @@ public class EmailExtracted implements AutopsyVisitableItem { skCase.closeRunQuery(rs); } catch (SQLException ex) { - logger.log(Level.WARNING, "Cannot initialize email extraction", ex); + logger.log(Level.WARNING, "Cannot initialize email extraction", ex); //NON-NLS } } @@ -103,7 +103,7 @@ public class EmailExtracted implements AutopsyVisitableItem { Map parsed = new HashMap<>(); String[] split = path.split(MAIL_PATH_SEPARATOR); if (split.length < 4) { - logger.log(Level.WARNING, "Unexpected number of tokens when parsing email PATH: {0}, will use defaults", split.length); + logger.log(Level.WARNING, "Unexpected number of tokens when parsing email PATH: {0}, will use defaults", split.length); //NON-NLS parsed.put(MAIL_ACCOUNT, NbBundle.getMessage(EmailExtracted.class, "EmailExtracted.defaultAcct.text")); parsed.put(MAIL_FOLDER, NbBundle.getMessage(EmailExtracted.class, "EmailExtracted.defaultFolder.text")); return parsed; @@ -128,7 +128,7 @@ public class EmailExtracted implements AutopsyVisitableItem { super(Children.create(new EmailExtractedRootChildrenFlat(), true), Lookups.singleton(DISPLAY_NAME)); super.setName(LABEL_NAME); super.setDisplayName(DISPLAY_NAME); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/mail-icon-16.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/mail-icon-16.png"); //NON-NLS initArtifacts(); } @@ -182,7 +182,7 @@ public class EmailExtracted implements AutopsyVisitableItem { //TODO: bulk artifact gettings tempList.add(skCase.getBlackboardArtifact(l)); } catch (TskException ex) { - logger.log(Level.WARNING, "Error creating mail messages nodes", ex); + logger.log(Level.WARNING, "Error creating mail messages nodes", ex); //NON-NLS } } } @@ -208,7 +208,7 @@ public class EmailExtracted implements AutopsyVisitableItem { super(Children.create(new EmailExtractedRootChildren(), true), Lookups.singleton(DISPLAY_NAME)); super.setName(LABEL_NAME); super.setDisplayName(DISPLAY_NAME); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/mail-icon-16.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/mail-icon-16.png"); //NON-NLS initArtifacts(); } @@ -267,7 +267,7 @@ public class EmailExtracted implements AutopsyVisitableItem { super(Children.create(new EmailExtractedAccountChildrenNode(children), true), Lookups.singleton(name)); super.setName(name); super.setDisplayName(name + " (" + children.size() + ")"); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/account-icon-16.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/account-icon-16.png"); //NON-NLS } @Override @@ -332,7 +332,7 @@ public class EmailExtracted implements AutopsyVisitableItem { super(Children.create(new EmailExtractedFolderChildrenNode(children), true), Lookups.singleton(name)); super.setName(name); super.setDisplayName(name + " (" + children.size() + ")"); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-16.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/folder-icon-16.png"); //NON-NLS } @Override @@ -383,7 +383,7 @@ public class EmailExtracted implements AutopsyVisitableItem { //TODO: bulk artifact gettings tempList.add(skCase.getBlackboardArtifact(l)); } catch (TskException ex) { - logger.log(Level.WARNING, "Error creating mail messages nodes", ex); + logger.log(Level.WARNING, "Error creating mail messages nodes", ex); //NON-NLS } } list.addAll(tempList); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContentChildren.java b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContentChildren.java index 10ded0f291..9d48f7fb70 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContentChildren.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContentChildren.java @@ -71,7 +71,7 @@ class ExtractedContentChildren extends ChildFactory { // set name, display name, and icon if (file.isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM.UNALLOC)) { if (file.getType().equals(TSK_DB_FILES_TYPE_ENUM.CARVED)) { - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/carved-file-icon-16.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/carved-file-icon-16.png"); //NON-NLS } else { - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png"); //NON-NLS } } else { this.setIconBaseWithExtension(getIconForFileType(file)); @@ -112,66 +112,66 @@ public class FileNode extends AbstractFsContentNode { String name = file.getName(); int dotIndex = name.lastIndexOf("."); if (dotIndex == -1) { - return "org/sleuthkit/autopsy/images/file-icon.png"; + return "org/sleuthkit/autopsy/images/file-icon.png"; //NON-NLS } String ext = name.substring(dotIndex).toLowerCase(); // Images for (String s : FileTypeExtensions.getImageExtensions()) { if (ext.equals(s)) { - return "org/sleuthkit/autopsy/images/image-file.png"; + return "org/sleuthkit/autopsy/images/image-file.png"; //NON-NLS } } // Videos for (String s : FileTypeExtensions.getVideoExtensions()) { if (ext.equals(s)) { - return "org/sleuthkit/autopsy/images/video-file.png"; + return "org/sleuthkit/autopsy/images/video-file.png"; //NON-NLS } } // Audio Files for (String s : FileTypeExtensions.getAudioExtensions()) { if (ext.equals(s)) { - return "org/sleuthkit/autopsy/images/audio-file.png"; + return "org/sleuthkit/autopsy/images/audio-file.png"; //NON-NLS } } // Documents for (String s : FileTypeExtensions.getDocumentExtensions()) { if (ext.equals(s)) { - return "org/sleuthkit/autopsy/images/doc-file.png"; + return "org/sleuthkit/autopsy/images/doc-file.png"; //NON-NLS } } // Executables / System Files for (String s : FileTypeExtensions.getExecutableExtensions()) { if (ext.equals(s)) { - return "org/sleuthkit/autopsy/images/exe-file.png"; + return "org/sleuthkit/autopsy/images/exe-file.png"; //NON-NLS } } // Text Files for (String s : FileTypeExtensions.getTextExtensions()) { if (ext.equals(s)) { - return "org/sleuthkit/autopsy/images/text-file.png"; + return "org/sleuthkit/autopsy/images/text-file.png"; //NON-NLS } } // Web Files for (String s : FileTypeExtensions.getWebExtensions()) { if (ext.equals(s)) { - return "org/sleuthkit/autopsy/images/web-file.png"; + return "org/sleuthkit/autopsy/images/web-file.png"; //NON-NLS } } // PDFs for (String s : FileTypeExtensions.getPDFExtensions()) { if (ext.equals(s)) { - return "org/sleuthkit/autopsy/images/pdf-file.png"; + return "org/sleuthkit/autopsy/images/pdf-file.png"; //NON-NLS } } // Archives for (String s : FileTypeExtensions.getArchiveExtensions()) { if (ext.equals(s)) { - return "org/sleuthkit/autopsy/images/archive-file.png"; + return "org/sleuthkit/autopsy/images/archive-file.png"; //NON-NLS } } // Else return the default - return "org/sleuthkit/autopsy/images/file-icon.png"; + return "org/sleuthkit/autopsy/images/file-icon.png"; //NON-NLS } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java index 8bf1d606a4..035c4fb72a 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileSize.java @@ -53,9 +53,9 @@ public class FileSize implements AutopsyVisitableItem { public enum FileSizeFilter implements AutopsyVisitableItem { - SIZE_50_200(0, "SIZE_50_200", "50 - 200MB"), - SIZE_200_1000(1, "SIZE_200_1GB", "200MB - 1GB"), - SIZE_1000_(2, "SIZE_1000+", "1GB+"); + SIZE_50_200(0, "SIZE_50_200", "50 - 200MB"), //NON-NLS + SIZE_200_1000(1, "SIZE_200_1GB", "200MB - 1GB"), //NON-NLS + SIZE_1000_(2, "SIZE_1000+", "1GB+"); //NON-NLS private int id; private String name; private String displayName; @@ -106,7 +106,7 @@ public class FileSize implements AutopsyVisitableItem { super(Children.create(new FileSizeRootChildren(skCase), true), Lookups.singleton(NAME)); super.setName(NAME); super.setDisplayName(NAME); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-size-16.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-size-16.png"); //NON-NLS } @Override @@ -168,7 +168,7 @@ public class FileSize implements AutopsyVisitableItem { String tooltip = filter.getDisplayName(); this.setShortDescription(tooltip); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-size-16.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-size-16.png"); //NON-NLS //get count of children without preloading all children nodes final long count = new FileSizeChildren(filter, skCase).calculateItems(); @@ -229,22 +229,22 @@ public class FileSize implements AutopsyVisitableItem { String query; switch (filter) { case SIZE_50_200: - query = "(size >= 50000000 AND size < 200000000)"; + query = "(size >= 50000000 AND size < 200000000)"; //NON-NLS break; case SIZE_200_1000: - query = "(size >= 200000000 AND size < 1000000000)"; + query = "(size >= 200000000 AND size < 1000000000)"; //NON-NLS break; case SIZE_1000_: - query = "(size >= 1000000000)"; + query = "(size >= 1000000000)"; //NON-NLS break; default: - logger.log(Level.SEVERE, "Unsupported filter type to get files by size: {0}", filter); + logger.log(Level.SEVERE, "Unsupported filter type to get files by size: {0}", filter); //NON-NLS return null; } // ignore unalloc block files - query = query + " AND (type != " + TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS.getFileType() + ")"; + query = query + " AND (type != " + TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS.getFileType() + ")"; //NON-NLS return query; } @@ -260,7 +260,7 @@ public class FileSize implements AutopsyVisitableItem { try { ret = skCase.findAllFilesWhere(query); } catch (TskCoreException e) { - logger.log(Level.SEVERE, "Error getting files for the file size view using: " + query, e); + logger.log(Level.SEVERE, "Error getting files for the file size view using: " + query, e); //NON-NLS } return ret; @@ -276,7 +276,7 @@ public class FileSize implements AutopsyVisitableItem { try { return skCase.countFilesWhere(makeQuery()); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting files by size search view count", ex); + logger.log(Level.SEVERE, "Error getting files by size search view count", ex); //NON-NLS return 0; } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeChildren.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeChildren.java index 4628c6f607..281e6593eb 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeChildren.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeChildren.java @@ -61,10 +61,10 @@ class FileTypeChildren extends ChildFactory { } private String createQuery(){ - String query = "(dir_type = " + TskData.TSK_FS_NAME_TYPE_ENUM.REG.getValue() + ")" - + " AND (known IS NULL OR known != " + TskData.FileKnown.KNOWN.getFileKnownValue() + ") AND (0"; + String query = "(dir_type = " + TskData.TSK_FS_NAME_TYPE_ENUM.REG.getValue() + ")" //NON-NLS + + " AND (known IS NULL OR known != " + TskData.FileKnown.KNOWN.getFileKnownValue() + ") AND (0"; //NON-NLS for(String s : filter.getFilter()){ - query += " OR name LIKE '%" + s + "'"; + query += " OR name LIKE '%" + s + "'"; //NON-NLS } query += ')'; // query += " LIMIT " + MAX_OBJECTS; @@ -77,7 +77,7 @@ class FileTypeChildren extends ChildFactory { try { list = skCase.findAllFilesWhere(createQuery()); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Couldn't get search results", ex); + logger.log(Level.SEVERE, "Couldn't get search results", ex); //NON-NLS } return list; @@ -92,7 +92,7 @@ class FileTypeChildren extends ChildFactory { try { return skCase.countFilesWhere(createQuery()); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting file search view count", ex); + logger.log(Level.SEVERE, "Error getting file search view count", ex); //NON-NLS return 0; } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeExtensionFilters.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeExtensionFilters.java index aa98f52fd4..882ce8cc4b 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeExtensionFilters.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeExtensionFilters.java @@ -33,24 +33,24 @@ import org.sleuthkit.datamodel.SleuthkitCase; // root node filters public enum RootFilter implements AutopsyVisitableItem,SearchFilterInterface { - TSK_IMAGE_FILTER(0, "TSK_IMAGE_FILTER", + TSK_IMAGE_FILTER(0, "TSK_IMAGE_FILTER", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskImgFilter.text"), FileTypeExtensions.getImageExtensions()), - TSK_VIDEO_FILTER(1, "TSK_VIDEO_FILTER", + TSK_VIDEO_FILTER(1, "TSK_VIDEO_FILTER", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskVideoFilter.text"), FileTypeExtensions.getVideoExtensions()), - TSK_AUDIO_FILTER(2, "TSK_AUDIO_FILTER", + TSK_AUDIO_FILTER(2, "TSK_AUDIO_FILTER", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskAudioFilter.text"), FileTypeExtensions.getAudioExtensions()), - TSK_ARCHIVE_FILTER(3, "TSK_ARCHIVE_FILTER", + TSK_ARCHIVE_FILTER(3, "TSK_ARCHIVE_FILTER", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskArchiveFilter.text"), FileTypeExtensions.getArchiveExtensions()), - TSK_DOCUMENT_FILTER(3, "TSK_DOCUMENT_FILTER", + TSK_DOCUMENT_FILTER(3, "TSK_DOCUMENT_FILTER", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskDocumentFilter.text"), - Arrays.asList(".doc", ".docx", ".pdf", ".xls", ".rtf", ".txt")), - TSK_EXECUTABLE_FILTER(3, "TSK_EXECUTABLE_FILTER", + Arrays.asList(".doc", ".docx", ".pdf", ".xls", ".rtf", ".txt")), //NON-NLS + TSK_EXECUTABLE_FILTER(3, "TSK_EXECUTABLE_FILTER", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.tskExecFilter.text"), - Arrays.asList(".exe", ".dll", ".bat", ".cmd", ".com")); + Arrays.asList(".exe", ".dll", ".bat", ".cmd", ".com")); //NON-NLS private int id; private String name; @@ -92,21 +92,21 @@ import org.sleuthkit.datamodel.SleuthkitCase; // document sub-node filters public enum DocumentFilter implements AutopsyVisitableItem,SearchFilterInterface { - AUT_DOC_HTML(0, "AUT_DOC_HTML", + AUT_DOC_HTML(0, "AUT_DOC_HTML", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autDocHtmlFilter.text"), - Arrays.asList(".htm", ".html")), - AUT_DOC_OFFICE(1, "AUT_DOC_OFFICE", + Arrays.asList(".htm", ".html")), //NON-NLS + AUT_DOC_OFFICE(1, "AUT_DOC_OFFICE", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autDocOfficeFilter.text"), - Arrays.asList(".doc", ".docx", ".odt", ".xls", ".xlsx", ".ppt", ".pptx")), - AUT_DOC_PDF(2, "AUT_DOC_PDF", + Arrays.asList(".doc", ".docx", ".odt", ".xls", ".xlsx", ".ppt", ".pptx")), //NON-NLS + AUT_DOC_PDF(2, "AUT_DOC_PDF", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autoDocPdfFilter.text"), - Arrays.asList(".pdf")), - AUT_DOC_TXT(3, "AUT_DOC_TXT", + Arrays.asList(".pdf")), //NON-NLS + AUT_DOC_TXT(3, "AUT_DOC_TXT", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autDocTxtFilter.text"), - Arrays.asList(".txt")), - AUT_DOC_RTF(4, "AUT_DOC_RTF", + Arrays.asList(".txt")), //NON-NLS + AUT_DOC_RTF(4, "AUT_DOC_RTF", //NON-NLS NbBundle.getMessage(FileTypeExtensionFilters.class, "FileTypeExtensionFilters.autDocRtfFilter.text"), - Arrays.asList(".rtf")); + Arrays.asList(".rtf")); //NON-NLS private int id; private String name; @@ -149,11 +149,11 @@ import org.sleuthkit.datamodel.SleuthkitCase; // executable sub-node filters public enum ExecutableFilter implements AutopsyVisitableItem,SearchFilterInterface { - ExecutableFilter_EXE(0, "ExecutableFilter_EXE", ".exe", Arrays.asList(".exe")), - ExecutableFilter_DLL(1, "ExecutableFilter_DLL", ".dll", Arrays.asList(".dll")), - ExecutableFilter_BAT(2, "ExecutableFilter_BAT", ".bat", Arrays.asList(".bat")), - ExecutableFilter_CMD(3, "ExecutableFilter_CMD", ".cmd", Arrays.asList(".cmd")), - ExecutableFilter_COM(4, "ExecutableFilter_COM", ".com", Arrays.asList(".com")); + ExecutableFilter_EXE(0, "ExecutableFilter_EXE", ".exe", Arrays.asList(".exe")), //NON-NLS + ExecutableFilter_DLL(1, "ExecutableFilter_DLL", ".dll", Arrays.asList(".dll")), //NON-NLS + ExecutableFilter_BAT(2, "ExecutableFilter_BAT", ".bat", Arrays.asList(".bat")), //NON-NLS + ExecutableFilter_CMD(3, "ExecutableFilter_CMD", ".cmd", Arrays.asList(".cmd")), //NON-NLS + ExecutableFilter_COM(4, "ExecutableFilter_COM", ".com", Arrays.asList(".com")); //NON-NLS private int id; private String name; diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeExtensions.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeExtensions.java index 0b067a4678..1d5790178a 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeExtensions.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeExtensions.java @@ -26,17 +26,17 @@ import java.util.List; * and 'getters' to obtain them. */ public class FileTypeExtensions { - private final static List IMAGE_EXTENSIONS = Arrays.asList(".jpg", ".jpeg", ".png", ".psd", ".nef", ".tiff", ".bmp"); - private final static List VIDEO_EXTENSIONS = Arrays.asList(".aaf", ".3gp", ".asf", ".avi", ".m1v", ".m2v", - ".m4v", ".mp4", ".mov", ".mpeg", ".mpg", ".mpe", ".mp4", ".rm", ".wmv", ".mpv", ".flv", ".swf"); - private final static List AUDIO_EXTENSIONS = Arrays.asList(".aiff", ".aif", ".flac", ".wav", ".m4a", ".ape", - ".wma", ".mp2", ".mp1", ".mp3", ".aac", ".mp4", ".m4p", ".m1a", ".m2a", ".m4r", ".mpa", ".m3u", ".mid", ".midi", ".ogg"); - private final static List DOCUMENT_EXTENSIONS = Arrays.asList(".doc", ".docx", ".odt", ".xls", ".xlsx", ".ppt", ".pptx"); - private final static List EXECUTABLE_EXTENSIONS = Arrays.asList(".exe", ".msi", ".cmd", ".com", ".bat", ".reg", ".scr", ".dll", ".ini"); - private final static List TEXT_EXTENSIONS = Arrays.asList(".txt", ".rtf", ".log", ".text", ".xml"); - private final static List WEB_EXTENSIONS = Arrays.asList(".html", ".htm", ".css", ".js", ".php", ".aspx"); - private final static List PDF_EXTENSIONS = Arrays.asList(".pdf"); - private final static List ARCHIVE_EXTENSIONS = Arrays.asList(".zip", ".rar", ".7zip", ".7z", ".arj", ".tar", ".gzip", ".bzip", ".bzip2", ".cab", ".jar", ".cpio", ".ar", ".gz", ".tgz"); + private final static List IMAGE_EXTENSIONS = Arrays.asList(".jpg", ".jpeg", ".png", ".psd", ".nef", ".tiff", ".bmp"); //NON-NLS + private final static List VIDEO_EXTENSIONS = Arrays.asList(".aaf", ".3gp", ".asf", ".avi", ".m1v", ".m2v", //NON-NLS + ".m4v", ".mp4", ".mov", ".mpeg", ".mpg", ".mpe", ".mp4", ".rm", ".wmv", ".mpv", ".flv", ".swf"); //NON-NLS + private final static List AUDIO_EXTENSIONS = Arrays.asList(".aiff", ".aif", ".flac", ".wav", ".m4a", ".ape", //NON-NLS + ".wma", ".mp2", ".mp1", ".mp3", ".aac", ".mp4", ".m4p", ".m1a", ".m2a", ".m4r", ".mpa", ".m3u", ".mid", ".midi", ".ogg"); //NON-NLS + private final static List DOCUMENT_EXTENSIONS = Arrays.asList(".doc", ".docx", ".odt", ".xls", ".xlsx", ".ppt", ".pptx"); //NON-NLS + private final static List EXECUTABLE_EXTENSIONS = Arrays.asList(".exe", ".msi", ".cmd", ".com", ".bat", ".reg", ".scr", ".dll", ".ini"); //NON-NLS + private final static List TEXT_EXTENSIONS = Arrays.asList(".txt", ".rtf", ".log", ".text", ".xml"); //NON-NLS + private final static List WEB_EXTENSIONS = Arrays.asList(".html", ".htm", ".css", ".js", ".php", ".aspx"); //NON-NLS + private final static List PDF_EXTENSIONS = Arrays.asList(".pdf"); //NON-NLS + private final static List ARCHIVE_EXTENSIONS = Arrays.asList(".zip", ".rar", ".7zip", ".7z", ".arj", ".tar", ".gzip", ".bzip", ".bzip2", ".cab", ".jar", ".cpio", ".ar", ".gz", ".tgz"); //NON-NLS public static List getImageExtensions() { return IMAGE_EXTENSIONS; diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java index 53575f67e3..f213a43bce 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypeNode.java @@ -45,7 +45,7 @@ public class FileTypeNode extends DisplayableItemNode { //final long count = getChildren().getNodesCount(true); super.setDisplayName(filter.getDisplayName() + " (" + count + ")"); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-filter-icon.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-filter-icon.png"); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java index 83e3d69717..da7694a4f2 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/FileTypesNode.java @@ -48,7 +48,7 @@ public class FileTypesNode extends DisplayableItemNode { super.setName(filter.getName()); super.setDisplayName(filter.getDisplayName()); } - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file_types.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file_types.png"); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java index 78d337d0c3..e2970c3993 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java @@ -62,15 +62,15 @@ public class HashsetHits implements AutopsyVisitableItem { try { int setNameId = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID(); int artId = BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID(); - String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " - + "FROM blackboard_attributes,blackboard_artifacts WHERE " - + "attribute_type_id=" + setNameId - + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" - + " AND blackboard_artifacts.artifact_type_id=" + artId; + String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " //NON-NLS + + "FROM blackboard_attributes,blackboard_artifacts WHERE " //NON-NLS + + "attribute_type_id=" + setNameId //NON-NLS + + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" //NON-NLS + + " AND blackboard_artifacts.artifact_type_id=" + artId; //NON-NLS rs = skCase.runQuery(query); while (rs.next()) { - String value = rs.getString("value_text"); - long artifactId = rs.getLong("artifact_id"); + String value = rs.getString("value_text"); //NON-NLS + long artifactId = rs.getLong("artifact_id"); //NON-NLS if (!hashSetHitsMap.containsKey(value)) { hashSetHitsMap.put(value, new HashSet()); } @@ -79,13 +79,13 @@ public class HashsetHits implements AutopsyVisitableItem { } } catch (SQLException ex) { - logger.log(Level.WARNING, "SQL Exception occurred: ", ex); + logger.log(Level.WARNING, "SQL Exception occurred: ", ex); //NON-NLS } finally { if (rs != null) { try { skCase.closeRunQuery(rs); } catch (SQLException ex) { - logger.log(Level.WARNING, "Error closing result set after getting hashset hits", ex); + logger.log(Level.WARNING, "Error closing result set after getting hashset hits", ex); //NON-NLS } } } @@ -105,7 +105,7 @@ public class HashsetHits implements AutopsyVisitableItem { super(Children.create(new HashsetHitsRootChildren(), true), Lookups.singleton(DISPLAY_NAME)); super.setName(HASHSET_HITS); super.setDisplayName(DISPLAY_NAME); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/hashset_hits.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/hashset_hits.png"); //NON-NLS initArtifacts(); } @@ -157,7 +157,7 @@ public class HashsetHits implements AutopsyVisitableItem { super(Children.create(new HashsetHitsSetChildren(children), true), Lookups.singleton(name)); super.setName(name); super.setDisplayName(name + " (" + children.size() + ")"); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/hashset_hits.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/hashset_hits.png"); //NON-NLS } @Override @@ -204,7 +204,7 @@ public class HashsetHits implements AutopsyVisitableItem { //TODO: bulk artifact gettings list.add(skCase.getBlackboardArtifact(l)); } catch (TskException ex) { - logger.log(Level.WARNING, "TSK Exception occurred", ex); + logger.log(Level.WARNING, "TSK Exception occurred", ex); //NON-NLS } } return true; diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java index 6ca6224d76..babc47cde8 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ImageNode.java @@ -54,7 +54,7 @@ public class ImageNode extends AbstractContentNode { // set name, display name, and icon String imgName = nameForImage(img); this.setDisplayName(imgName); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/hard-drive-icon.jpg"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/hard-drive-icon.jpg"); //NON-NLS } /** diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/Installer.java b/Core/src/org/sleuthkit/autopsy/datamodel/Installer.java index a9fa9c2a48..a1b3199446 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/Installer.java @@ -68,11 +68,11 @@ public class Installer extends ModuleInstall { } else if (skVersion.length() == 0) { throw new Exception(NbBundle.getMessage(this.getClass(), "Installer.exception.taskVerStringBang.msg")); } else { - logger.log(Level.CONFIG, "Sleuth Kit Version: {0}", skVersion); + logger.log(Level.CONFIG, "Sleuth Kit Version: {0}", skVersion); //NON-NLS } } catch (Exception e) { - logger.log(Level.SEVERE, "Error calling Sleuth Kit library (test call failed)", e); + logger.log(Level.SEVERE, "Error calling Sleuth Kit library (test call failed)", e); //NON-NLS // Normal error box log handler won't be loaded yet, so show error here. diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java index 5e762bfa4e..f084188ef7 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/InterestingHits.java @@ -70,29 +70,29 @@ public class InterestingHits implements AutopsyVisitableItem { try { int setNameId = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID(); int artId = artType.getTypeID(); - String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " - + "FROM blackboard_attributes,blackboard_artifacts WHERE " - + "attribute_type_id=" + setNameId - + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" - + " AND blackboard_artifacts.artifact_type_id=" + artId; + String query = "SELECT value_text,blackboard_attributes.artifact_id,attribute_type_id " //NON-NLS + + "FROM blackboard_attributes,blackboard_artifacts WHERE " //NON-NLS + + "attribute_type_id=" + setNameId //NON-NLS + + " AND blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id" //NON-NLS + + " AND blackboard_artifacts.artifact_type_id=" + artId; //NON-NLS rs = skCase.runQuery(query); while (rs.next()) { - String value = rs.getString("value_text"); - long artifactId = rs.getLong("artifact_id"); + String value = rs.getString("value_text"); //NON-NLS + long artifactId = rs.getLong("artifact_id"); //NON-NLS if (!interestingItemsMap.containsKey(value)) { interestingItemsMap.put(value, new HashSet()); } interestingItemsMap.get(value).add(artifactId); } } catch (SQLException ex) { - logger.log(Level.WARNING, "SQL Exception occurred: ", ex); + logger.log(Level.WARNING, "SQL Exception occurred: ", ex); //NON-NLS } finally { if (rs != null) { try { skCase.closeRunQuery(rs); } catch (SQLException ex) { - logger.log(Level.WARNING, "Error closing result set after getting artifacts", ex); + logger.log(Level.WARNING, "Error closing result set after getting artifacts", ex); //NON-NLS } } } @@ -112,7 +112,7 @@ public class InterestingHits implements AutopsyVisitableItem { super(Children.create(new InterestingHitsRootChildren(), true), Lookups.singleton(DISPLAY_NAME)); super.setName(INTERESTING_ITEMS); super.setDisplayName(DISPLAY_NAME); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/interesting_item.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/interesting_item.png"); //NON-NLS initArtifacts(); } @@ -164,7 +164,7 @@ public class InterestingHits implements AutopsyVisitableItem { super(Children.create(new InterestingHitsSetChildren(children), true), Lookups.singleton(name)); super.setName(name); super.setDisplayName(name + " (" + children.size() + ")"); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/interesting_item.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/interesting_item.png"); //NON-NLS } @Override @@ -210,7 +210,7 @@ public class InterestingHits implements AutopsyVisitableItem { try { list.add(skCase.getBlackboardArtifact(l)); } catch (TskException ex) { - logger.log(Level.WARNING, "TSK Exception occurred", ex); + logger.log(Level.WARNING, "TSK Exception occurred", ex); //NON-NLS } } return true; diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/KeyValueNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/KeyValueNode.java index 648d27e161..a04f7a0b51 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/KeyValueNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/KeyValueNode.java @@ -58,7 +58,7 @@ public class KeyValueNode extends AbstractNode { if (af != null) { // set name, display name, and icon if (af.isDir()) { - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); //NON-NLS } else { this.setIconBaseWithExtension(FileNode.getIconForFileType(af)); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java index 8045af52ad..e031fe4fc7 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java @@ -118,18 +118,18 @@ public class KeywordHits implements AutopsyVisitableItem { int wordId = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID(); int regexId = BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP.getTypeID(); int artId = BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID(); - String query = "SELECT blackboard_attributes.value_text,blackboard_attributes.artifact_id," - + "blackboard_attributes.attribute_type_id FROM blackboard_attributes,blackboard_artifacts WHERE " - + "(blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id AND " - + "blackboard_artifacts.artifact_type_id=" + artId - + ") AND (attribute_type_id=" + setId + " OR " - + "attribute_type_id=" + wordId + " OR " - + "attribute_type_id=" + regexId + ")"; + String query = "SELECT blackboard_attributes.value_text,blackboard_attributes.artifact_id," //NON-NLS + + "blackboard_attributes.attribute_type_id FROM blackboard_attributes,blackboard_artifacts WHERE " //NON-NLS + + "(blackboard_attributes.artifact_id=blackboard_artifacts.artifact_id AND " //NON-NLS + + "blackboard_artifacts.artifact_type_id=" + artId //NON-NLS + + ") AND (attribute_type_id=" + setId + " OR " //NON-NLS + + "attribute_type_id=" + wordId + " OR " //NON-NLS + + "attribute_type_id=" + regexId + ")"; //NON-NLS rs = skCase.runQuery(query); while (rs.next()) { - String value = rs.getString("value_text"); - long artifactId = rs.getLong("artifact_id"); - long typeId = rs.getLong("attribute_type_id"); + String value = rs.getString("value_text"); //NON-NLS + long artifactId = rs.getLong("artifact_id"); //NON-NLS + long typeId = rs.getLong("attribute_type_id"); //NON-NLS if (!artifacts.containsKey(artifactId)) { artifacts.put(artifactId, new LinkedHashMap()); } @@ -140,13 +140,13 @@ public class KeywordHits implements AutopsyVisitableItem { } } catch (SQLException ex) { - logger.log(Level.WARNING, "SQL Exception occurred: ", ex); + logger.log(Level.WARNING, "SQL Exception occurred: ", ex); //NON-NLS } finally { if (rs != null) { try { skCase.closeRunQuery(rs); } catch (SQLException ex) { - logger.log(Level.WARNING, "Error closing result set after getting keyword hits", ex); + logger.log(Level.WARNING, "Error closing result set after getting keyword hits", ex); //NON-NLS } } } @@ -163,7 +163,7 @@ public class KeywordHits implements AutopsyVisitableItem { super(Children.create(new KeywordHitsRootChildren(), true), Lookups.singleton(KEYWORD_HITS)); super.setName(NAME); super.setDisplayName(KEYWORD_HITS); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/keyword_hits.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/keyword_hits.png"); //NON-NLS initArtifacts(); initMaps(); } @@ -223,7 +223,7 @@ public class KeywordHits implements AutopsyVisitableItem { totalDescendants += grandChildren.size(); } super.setDisplayName(name + " (" + totalDescendants + ")"); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/keyword_hits.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/keyword_hits.png"); //NON-NLS this.name = name; this.children = children; } @@ -291,7 +291,7 @@ public class KeywordHits implements AutopsyVisitableItem { super(Children.create(new KeywordHitsKeywordChildren(children), true), Lookups.singleton(name)); super.setName(name); super.setDisplayName(name + " (" + children.size() + ")"); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/keyword_hits.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/keyword_hits.png"); //NON-NLS this.children = children; } @@ -345,7 +345,7 @@ public class KeywordHits implements AutopsyVisitableItem { //TODO: bulk artifact gettings tempList.add(skCase.getBlackboardArtifact(l)); } catch (TskException ex) { - logger.log(Level.WARNING, "TSK Exception occurred", ex); + logger.log(Level.WARNING, "TSK Exception occurred", ex); //NON-NLS } } list.addAll(tempList); @@ -359,7 +359,7 @@ public class KeywordHits implements AutopsyVisitableItem { try { file = artifact.getSleuthkitCase().getAbstractFileById(artifact.getObjectID()); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "TskCoreException while constructing BlackboardArtifact Node from KeywordHitsKeywordChildren"); + logger.log(Level.SEVERE, "TskCoreException while constructing BlackboardArtifact Node from KeywordHitsKeywordChildren"); //NON-NLS return n; } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/KnownFileFilterNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/KnownFileFilterNode.java index ce37222728..8201fdd73d 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/KnownFileFilterNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/KnownFileFilterNode.java @@ -40,8 +40,8 @@ import org.sleuthkit.datamodel.TskData; public class KnownFileFilterNode extends FilterNode { /** Preference key values. */ - private static final String DS_HIDE_KNOWN = "dataSourcesHideKnown"; // Default false - private static final String VIEWS_HIDE_KNOWN = "viewsHideKnown"; // Default true + private static final String DS_HIDE_KNOWN = "dataSourcesHideKnown"; // Default false NON-NLS + private static final String VIEWS_HIDE_KNOWN = "viewsHideKnown"; // Default true NON-NLS /** True if Nodes selected from the Views Node should filter Known Files. */ private static boolean filterFromViews = true; @@ -128,7 +128,7 @@ public class KnownFileFilterNode extends FilterNode { } private void addPreferenceListener() { - Preferences prefs = NbPreferences.root().node("/org/sleuthkit/autopsy/core"); + Preferences prefs = NbPreferences.root().node("/org/sleuthkit/autopsy/core"); //NON-NLS // Initialize with values stored in preferences filterFromViews = prefs.getBoolean(VIEWS_HIDE_KNOWN, filterFromViews); filterFromDataSources = prefs.getBoolean(DS_HIDE_KNOWN, filterFromDataSources); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java index 30f59d9abf..1063af8032 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/LayoutFileNode.java @@ -58,9 +58,9 @@ public class LayoutFileNode extends AbstractAbstractFileNode { this.setDisplayName(nameForLayoutFile(lf)); if (lf.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.CARVED)) { - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/carved-file-icon-16.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/carved-file-icon-16.png"); //NON-NLS } else { - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/file-icon-deleted.png"); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java index 7e6cffbff1..f45439857d 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/LocalFileNode.java @@ -48,7 +48,7 @@ public class LocalFileNode extends AbstractAbstractFileNode { // set name, display name, and icon if (af.isDir()) { - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/Folder-icon.png"); //NON-NLS } else { this.setIconBaseWithExtension(FileNode.getIconForFileType(af)); } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/NodeProperty.java b/Core/src/org/sleuthkit/autopsy/datamodel/NodeProperty.java index 96682fcdb4..f6268acf46 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/NodeProperty.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/NodeProperty.java @@ -32,7 +32,7 @@ public class NodeProperty extends PropertySupport.ReadOnly { @SuppressWarnings("unchecked") public NodeProperty(String name, String displayName, String desc, T value) { super(name, (Class) value.getClass(), displayName, desc); - setValue("suppressCustomEditor", Boolean.TRUE); // remove the "..." (editing) button + setValue("suppressCustomEditor", Boolean.TRUE); // remove the "..." (editing) button NON-NLS this.value = value; } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFiles.java b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFiles.java index 75168f8b21..328bd71f0c 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFiles.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFiles.java @@ -29,19 +29,19 @@ import org.sleuthkit.datamodel.SleuthkitCase; SleuthkitCase skCase; public enum RecentFilesFilter implements AutopsyVisitableItem { - AUT_0DAY_FILTER(0, "AUT_0DAY_FILTER", + AUT_0DAY_FILTER(0, "AUT_0DAY_FILTER", //NON-NLS NbBundle.getMessage(RecentFiles.class, "RecentFiles.aut0DayFilter.displayName.text"), 0), - AUT_1DAY_FILTER(0, "AUT_1DAY_FILTER", + AUT_1DAY_FILTER(0, "AUT_1DAY_FILTER", //NON-NLS NbBundle.getMessage(RecentFiles.class, "RecentFiles.aut1dayFilter.displayName.text"), 1), - AUT_2DAY_FILTER(0, "AUT_2DAY_FILTER", + AUT_2DAY_FILTER(0, "AUT_2DAY_FILTER", //NON-NLS NbBundle.getMessage(RecentFiles.class, "RecentFiles.aut2dayFilter.displayName.text"), 2), - AUT_3DAY_FILTER(0, "AUT_3DAY_FILTER", + AUT_3DAY_FILTER(0, "AUT_3DAY_FILTER", //NON-NLS NbBundle.getMessage(RecentFiles.class, "RecentFiles.aut3dayFilter.displayName.text"), 3), - AUT_4DAY_FILTER(0, "AUT_4DAY_FILTER", + AUT_4DAY_FILTER(0, "AUT_4DAY_FILTER", //NON-NLS NbBundle.getMessage(RecentFiles.class, "RecentFiles.aut4dayFilter.displayName.text"), 4), - AUT_5DAY_FILTER(0, "AUT_5DAY_FILTER", + AUT_5DAY_FILTER(0, "AUT_5DAY_FILTER", //NON-NLS NbBundle.getMessage(RecentFiles.class, "RecentFiles.aut5dayFilter.displayName.text"), 5), - AUT_6DAY_FILTER(0, "AUT_6DAY_FILTER", + AUT_6DAY_FILTER(0, "AUT_6DAY_FILTER", //NON-NLS NbBundle.getMessage(RecentFiles.class, "RecentFiles.aut6dayFilter.displayName.text"), 6); private int id; diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesChildren.java b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesChildren.java index b2247873df..ae07221d04 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesChildren.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesChildren.java @@ -62,11 +62,11 @@ import org.sleuthkit.datamodel.SleuthkitCase; } private long getLastTime() { - String query = createMaxQuery("crtime"); + String query = createMaxQuery("crtime"); //NON-NLS long maxcr = runTimeQuery(query); - query = createMaxQuery("ctime"); + query = createMaxQuery("ctime"); //NON-NLS long maxc = runTimeQuery(query); - query = createMaxQuery("mtime"); + query = createMaxQuery("mtime"); //NON-NLS long maxm = runTimeQuery(query); //query = createMaxQuery("atime"); //long maxa = runTimeQuery(query); @@ -76,7 +76,7 @@ import org.sleuthkit.datamodel.SleuthkitCase; //TODO add a generic query to SleuthkitCase private String createMaxQuery(String attr) { - return "SELECT MAX(" + attr + ") from tsk_files WHERE " + attr + " < " + System.currentTimeMillis() / 1000; + return "SELECT MAX(" + attr + ") from tsk_files WHERE " + attr + " < " + System.currentTimeMillis() / 1000; //NON-NLS } @SuppressWarnings("deprecation") @@ -87,13 +87,13 @@ import org.sleuthkit.datamodel.SleuthkitCase; rs = skCase.runQuery(query); result = rs.getLong(1); } catch (SQLException ex) { - logger.log(Level.WARNING, "Couldn't get recent files results", ex); + logger.log(Level.WARNING, "Couldn't get recent files results", ex); //NON-NLS } finally { if (rs != null) { try { skCase.closeRunQuery(rs); } catch (SQLException ex) { - logger.log(Level.WARNING, "Error closing result set after getting recent files results", ex); + logger.log(Level.WARNING, "Error closing result set after getting recent files results", ex); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterChildren.java b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterChildren.java index 636f1f82e8..f51a3c26fd 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterChildren.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterChildren.java @@ -67,16 +67,16 @@ import org.sleuthkit.datamodel.TskData; private String createQuery() { Calendar prevDayQuery = (Calendar) prevDay.clone(); - String query = "(dir_type = " + TskData.TSK_FS_NAME_TYPE_ENUM.REG.getValue() + ")" - + " AND (known IS NULL OR known != 1) AND ("; + String query = "(dir_type = " + TskData.TSK_FS_NAME_TYPE_ENUM.REG.getValue() + ")" //NON-NLS + + " AND (known IS NULL OR known != 1) AND ("; //NON-NLS long lowerLimit = prevDayQuery.getTimeInMillis() / 1000; prevDayQuery.add(Calendar.DATE, 1); prevDayQuery.add(Calendar.MILLISECOND, -1); long upperLimit = prevDayQuery.getTimeInMillis() / 1000; - query += "(crtime BETWEEN " + lowerLimit + " AND " + upperLimit + ") OR "; - query += "(ctime BETWEEN " + lowerLimit + " AND " + upperLimit + ") OR "; + query += "(crtime BETWEEN " + lowerLimit + " AND " + upperLimit + ") OR "; //NON-NLS + query += "(ctime BETWEEN " + lowerLimit + " AND " + upperLimit + ") OR "; //NON-NLS //query += "(atime BETWEEN " + lowerLimit + " AND " + upperLimit + ") OR "; - query += "(mtime BETWEEN " + lowerLimit + " AND " + upperLimit + "))"; + query += "(mtime BETWEEN " + lowerLimit + " AND " + upperLimit + "))"; //NON-NLS //query += " LIMIT " + MAX_OBJECTS; return query; } @@ -90,7 +90,7 @@ import org.sleuthkit.datamodel.TskData; } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Couldn't get search results", ex); + logger.log(Level.WARNING, "Couldn't get search results", ex); //NON-NLS } return ret; @@ -104,7 +104,7 @@ import org.sleuthkit.datamodel.TskData; try { return skCase.countFilesWhere(createQuery()); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting recent files search view count", ex); + logger.log(Level.SEVERE, "Error getting recent files search view count", ex); //NON-NLS return 0; } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java index bb234a7e45..45a1defe9c 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java @@ -48,7 +48,7 @@ public class RecentFilesFilterNode extends DisplayableItemNode { + prevDay.get(Calendar.DATE) + ", " + prevDay.get(Calendar.YEAR); this.setShortDescription(tooltip); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/recent_files.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/recent_files.png"); //NON-NLS //get count of children without preloading all children nodes final long count = new RecentFilesFilterChildren(filter, skCase, lastDay).calculateItems(); diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java index c593a25c0f..619af4a1cd 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/RecentFilesNode.java @@ -37,7 +37,7 @@ public class RecentFilesNode extends DisplayableItemNode { super.setName(NAME); super.setDisplayName(NAME); this.skCase = skCase; - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/recent_files.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/recent_files.png"); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java index f1fd416af4..832d7c7b09 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ResultsNode.java @@ -40,7 +40,7 @@ public class ResultsNode extends DisplayableItemNode { new TagsNodeKey())), Lookups.singleton(NAME)); setName(NAME); setDisplayName(NAME); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/results.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/results.png"); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/TagNameNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/TagNameNode.java index de55d5545e..1ccf5a8465 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/TagNameNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/TagNameNode.java @@ -39,8 +39,8 @@ import org.sleuthkit.datamodel.TskCoreException; */ public class TagNameNode extends DisplayableItemNode { - private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; - private static final String BOOKMARK_TAG_ICON_PATH = "org/sleuthkit/autopsy/images/star-bookmark-icon-16.png"; + private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; //NON-NLS + private static final String BOOKMARK_TAG_ICON_PATH = "org/sleuthkit/autopsy/images/star-bookmark-icon-16.png"; //NON-NLS private final TagName tagName; private static final String CONTENT_TAG_TYPE_NODE_KEY = NbBundle.getMessage(TagNameNode.class, "TagNameNode.contentTagTypeNodeKey.text"); @@ -57,7 +57,7 @@ public class TagNameNode extends DisplayableItemNode { tagsCount = Case.getCurrentCase().getServices().getTagsManager().getContentTagsCountByTagName(tagName); tagsCount += Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsCountByTagName(tagName); } catch (TskCoreException ex) { - Logger.getLogger(TagNameNode.class.getName()).log(Level.SEVERE, "Failed to get tags count for " + tagName.getDisplayName() + " tag name", ex); + Logger.getLogger(TagNameNode.class.getName()).log(Level.SEVERE, "Failed to get tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS } super.setName(tagName.getDisplayName()); @@ -130,7 +130,7 @@ public class TagNameNode extends DisplayableItemNode { } else if (BLACKBOARD_ARTIFACT_TAG_TYPE_NODE_KEY.equals(key)) { return new BlackboardArtifactTagTypeNode(tagName); } else { - Logger.getLogger(TagNameNode.class.getName()).log(Level.SEVERE, "{0} not a recognized key", key); + Logger.getLogger(TagNameNode.class.getName()).log(Level.SEVERE, "{0} not a recognized key", key); //NON-NLS return null; } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/TagsNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/TagsNode.java index 087f2e16b3..81b5c53c8b 100755 --- a/Core/src/org/sleuthkit/autopsy/datamodel/TagsNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/TagsNode.java @@ -40,7 +40,7 @@ import org.sleuthkit.datamodel.TskCoreException; class TagsNode extends DisplayableItemNode { private static final String DISPLAY_NAME = NbBundle.getMessage(TagsNode.class, "TagsNode.displayName.text"); - private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; + private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; //NON-NLS public TagsNode() { super(Children.create(new TagNameNodeFactory(), true), Lookups.singleton(DISPLAY_NAME)); @@ -83,7 +83,7 @@ class TagsNode extends DisplayableItemNode { try { keys.addAll(Case.getCurrentCase().getServices().getTagsManager().getTagNamesInUse()); } catch (TskCoreException ex) { - Logger.getLogger(TagNameNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); + Logger.getLogger(TagNameNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } return true; } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java index 76b1011568..7431cf247f 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ViewsNode.java @@ -42,7 +42,7 @@ public class ViewsNode extends DisplayableItemNode { Lookups.singleton(NAME)); setName(NAME); setDisplayName(NAME); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/views.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/views.png"); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java index f80041cf79..d1be8ca2fd 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/VirtualDirectoryNode.java @@ -39,7 +39,7 @@ public class VirtualDirectoryNode extends AbstractAbstractFileNode { * @return short name for the Volume */ static String nameForVolume(Volume vol) { - return "vol" + Long.toString(vol.getAddr()); + return "vol" + Long.toString(vol.getAddr()); //NON-NLS } /** @@ -58,7 +58,7 @@ public class VolumeNode extends AbstractContentNode { String tempVolName = volName + " (" + vol.getDescription() + ": " + vol.getStart() + "-" + end + ")"; this.setDisplayName(tempVolName); - this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/vol-icon.png"); + this.setIconBaseWithExtension("org/sleuthkit/autopsy/images/vol-icon.png"); //NON-NLS } /** diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/BlackboardArtifactTagTypeNode.java b/Core/src/org/sleuthkit/autopsy/directorytree/BlackboardArtifactTagTypeNode.java index a1dbb18794..efc7cadca9 100755 --- a/Core/src/org/sleuthkit/autopsy/directorytree/BlackboardArtifactTagTypeNode.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/BlackboardArtifactTagTypeNode.java @@ -45,7 +45,7 @@ import org.sleuthkit.datamodel.TskCoreException; public class BlackboardArtifactTagTypeNode extends DisplayableItemNode { private static final String DISPLAY_NAME = NbBundle.getMessage(BlackboardArtifactTagTypeNode.class, "BlackboardArtifactTagTypeNode.displayName.text"); - private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; + private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; //NON-NLS public BlackboardArtifactTagTypeNode(TagName tagName) { super(Children.create(new BlackboardArtifactTagNodeFactory(tagName), true), Lookups.singleton(tagName.getDisplayName() + " " + DISPLAY_NAME)); @@ -55,7 +55,7 @@ public class BlackboardArtifactTagTypeNode extends DisplayableItemNode { tagsCount = Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsCountByTagName(tagName); } catch (TskCoreException ex) { - Logger.getLogger(BlackboardArtifactTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get blackboard artifact tags count for " + tagName.getDisplayName() + " tag name", ex); + Logger.getLogger(BlackboardArtifactTagTypeNode.class.getName()).log(Level.SEVERE, "Failed to get blackboard artifact tags count for " + tagName.getDisplayName() + " tag name", ex); //NON-NLS } super.setName(DISPLAY_NAME); @@ -105,7 +105,7 @@ public class BlackboardArtifactTagTypeNode extends DisplayableItemNode { keys.addAll(Case.getCurrentCase().getServices().getTagsManager().getBlackboardArtifactTagsByTagName(tagName)); } catch (TskCoreException ex) { - Logger.getLogger(BlackboardArtifactTagTypeNode.BlackboardArtifactTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); + Logger.getLogger(BlackboardArtifactTagTypeNode.BlackboardArtifactTagNodeFactory.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS } return true; } diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java b/Core/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java index 506a37741c..4facc9603a 100755 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java @@ -345,7 +345,7 @@ public class DataResultFilterNode extends FilterNode { } } } catch (TskException ex) { - Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Error getting linked file", ex); + Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Error getting linked file", ex); //NON-NLS } return c; } @@ -555,7 +555,7 @@ public class DataResultFilterNode extends FilterNode { sourceEm.setExploredContextAndSelection(newSelection, new Node[]{newSelection}); } catch (PropertyVetoException ex) { Logger logger = Logger.getLogger(DataResultFilterNode.class.getName()); - logger.log(Level.WARNING, "Error: can't open the selected directory.", ex); + logger.log(Level.WARNING, "Error: can't open the selected directory.", ex); //NON-NLS } } } @@ -580,7 +580,7 @@ public class DataResultFilterNode extends FilterNode { sourceEm.setSelectedNodes(new Node[]{parentNode}); } catch (PropertyVetoException ex) { Logger logger = Logger.getLogger(DataResultFilterNode.class.getName()); - logger.log(Level.WARNING, "Error: can't open the parent directory.", ex); + logger.log(Level.WARNING, "Error: can't open the parent directory.", ex); //NON-NLS } } }; diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterChildren.java b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterChildren.java index ab941e2ff1..7d85a1b2dd 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterChildren.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterChildren.java @@ -114,7 +114,7 @@ class DirectoryTreeFilterChildren extends FilterNode.Children { } } catch (TskException ex) { Logger.getLogger(DirectoryTreeFilterChildren.class.getName()) - .log(Level.WARNING, "Error getting directory children", ex); + .log(Level.WARNING, "Error getting directory children", ex); //NON-NLS return false; } return ret; @@ -138,7 +138,7 @@ class DirectoryTreeFilterChildren extends FilterNode.Children { } catch (TskException ex) { Logger.getLogger(DirectoryTreeFilterChildren.class.getName()) - .log(Level.WARNING, "Error getting volume children", ex); + .log(Level.WARNING, "Error getting volume children", ex); //NON-NLS return false; } return ret; @@ -198,7 +198,7 @@ class DirectoryTreeFilterChildren extends FilterNode.Children { return false; } } catch (TskCoreException e) { - logger.log(Level.SEVERE, "Error checking if file node is leaf.", e); + logger.log(Level.SEVERE, "Error checking if file node is leaf.", e); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterNode.java b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterNode.java index bb7a5abd65..fc52066044 100755 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterNode.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterNode.java @@ -75,7 +75,7 @@ class DirectoryTreeFilterNode extends FilterNode { final int numChildren = file.getChildrenCount(); name = name + " (" + numChildren + ")"; } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting children count to display for file: " + file, ex); + logger.log(Level.SEVERE, "Error getting children count to display for file: " + file, ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java index 53242a04b3..a03933abf6 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java @@ -90,7 +90,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat * path to the icon used by the component and its open action */ // static final String ICON_PATH = "SET/PATH/TO/ICON/HERE"; - private static final String PREFERRED_ID = "DirectoryTreeTopComponent"; + private static final String PREFERRED_ID = "DirectoryTreeTopComponent"; //NON-NLS private PropertyChangeSupport pcs; // for error handling private JPanel caller; @@ -161,32 +161,32 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat jScrollPane1.setBorder(null); - backButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_back.png"))); // NOI18N + backButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_back.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(backButton, org.openide.util.NbBundle.getMessage(DirectoryTreeTopComponent.class, "DirectoryTreeTopComponent.backButton.text")); // NOI18N backButton.setBorderPainted(false); backButton.setContentAreaFilled(false); - backButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_back_disabled.png"))); // NOI18N + backButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_back_disabled.png"))); // NOI18N NON-NLS backButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); backButton.setMaximumSize(new java.awt.Dimension(55, 100)); backButton.setMinimumSize(new java.awt.Dimension(5, 5)); backButton.setPreferredSize(new java.awt.Dimension(23, 23)); - backButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_back_hover.png"))); // NOI18N + backButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_back_hover.png"))); // NOI18N NON-NLS backButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backButtonActionPerformed(evt); } }); - forwardButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_forward.png"))); // NOI18N + forwardButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_forward.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(forwardButton, org.openide.util.NbBundle.getMessage(DirectoryTreeTopComponent.class, "DirectoryTreeTopComponent.forwardButton.text")); // NOI18N forwardButton.setBorderPainted(false); forwardButton.setContentAreaFilled(false); - forwardButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_forward_disabled.png"))); // NOI18N + forwardButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_forward_disabled.png"))); // NOI18N NON-NLS forwardButton.setMargin(new java.awt.Insets(2, 0, 2, 0)); forwardButton.setMaximumSize(new java.awt.Dimension(55, 100)); forwardButton.setMinimumSize(new java.awt.Dimension(5, 5)); forwardButton.setPreferredSize(new java.awt.Dimension(23, 23)); - forwardButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_forward_hover.png"))); // NOI18N + forwardButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/directorytree/btn_step_forward_hover.png"))); // NOI18N NON-NLS forwardButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { forwardButtonActionPerformed(evt); @@ -295,15 +295,15 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat TopComponent win = winManager.findTopComponent(PREFERRED_ID); if (win == null) { logger.warning( - "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system."); + "Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system."); //NON-NLS return getDefault(); } if (win instanceof DirectoryTreeTopComponent) { return (DirectoryTreeTopComponent) win; } logger.warning( - "There seem to be multiple components with the '" + PREFERRED_ID - + "' ID. That is a potential source of errors and unexpected behavior."); + "There seem to be multiple components with the '" + PREFERRED_ID //NON-NLS + + "' ID. That is a potential source of errors and unexpected behavior."); //NON-NLS return getDefault(); } @@ -412,7 +412,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat try { em.setSelectedNodes(new Node[]{childNodes.getNodeAt(0)}); } catch (Exception ex) { - logger.log(Level.SEVERE, "Error setting default selected node.", ex); + logger.log(Level.SEVERE, "Error setting default selected node.", ex); //NON-NLS } } @@ -667,7 +667,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat try { displayName = content.getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Exception while calling Content.getUniquePath() for node: " + originNode); + logger.log(Level.SEVERE, "Exception while calling Content.getUniquePath() for node: " + originNode); //NON-NLS } } else if (originNode.getLookup().lookup(String.class) != null) { displayName = originNode.getLookup().lookup(String.class); @@ -783,13 +783,13 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat Children rootChildren = em.getRootContext().getChildren(); Node dataSourcesFilterNode = rootChildren.findChild(DataSourcesNode.NAME); if (dataSourcesFilterNode == null) { - logger.log(Level.SEVERE, "Cannot find data sources filter node, won't refresh the content tree"); + logger.log(Level.SEVERE, "Cannot find data sources filter node, won't refresh the content tree"); //NON-NLS return; } OriginalNode imagesNodeOrig = dataSourcesFilterNode.getLookup().lookup(OriginalNode.class); if (imagesNodeOrig == null) { - logger.log(Level.SEVERE, "Cannot find data sources node, won't refresh the content tree"); + logger.log(Level.SEVERE, "Cannot find data sources node, won't refresh the content tree"); //NON-NLS return; } @@ -822,7 +822,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat Node results = dirChilds.findChild(ResultsNode.NAME); if (results == null) { - logger.log(Level.SEVERE, "Cannot find Results filter node, won't refresh the bb tree"); + logger.log(Level.SEVERE, "Cannot find Results filter node, won't refresh the bb tree"); //NON-NLS return; } OriginalNode original = results.getLookup().lookup(OriginalNode.class); @@ -888,7 +888,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat for (int i = 0; i < previouslySelectedNodePath.length; ++i) { nodePath.append(previouslySelectedNodePath[i]).append("/"); } - logger.log(Level.WARNING, "Failed to find any nodes to select on path " + nodePath.toString(), ex); + logger.log(Level.WARNING, "Failed to find any nodes to select on path " + nodePath.toString(), ex); //NON-NLS break; } } @@ -903,7 +903,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat try { em.setExploredContextAndSelection(selectedNode, new Node[]{selectedNode}); } catch (PropertyVetoException ex) { - logger.log(Level.WARNING, "Property veto from ExplorerManager setting selection to " + selectedNode.getName(), ex); + logger.log(Level.WARNING, "Property veto from ExplorerManager setting selection to " + selectedNode.getName(), ex); //NON-NLS } } } @@ -942,7 +942,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat } treeNode = hashsetRootChilds.findChild(setName); } catch (TskException ex) { - logger.log(Level.WARNING, "Error retrieving attributes", ex); + logger.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS } } else if (type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT)) { Node keywordRootNode = resultsChilds.findChild(type.getLabel()); @@ -963,7 +963,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat Children listChildren = listNode.getChildren(); treeNode = listChildren.findChild(keywordName); } catch (TskException ex) { - logger.log(Level.WARNING, "Error retrieving attributes", ex); + logger.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS } } else if (type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT) || type.equals(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT)) { @@ -980,7 +980,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat } treeNode = interestingItemsRootChildren.findChild(setName); } catch (TskException ex) { - logger.log(Level.WARNING, "Error retrieving attributes", ex); + logger.log(Level.WARNING, "Error retrieving attributes", ex); //NON-NLS } } else { Node extractedContent = resultsChilds.findChild(ExtractedContentNode.NAME); @@ -990,7 +990,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat try { em.setExploredContextAndSelection(treeNode, new Node[]{treeNode}); } catch (PropertyVetoException ex) { - logger.log(Level.WARNING, "Property Veto: ", ex); + logger.log(Level.WARNING, "Property Veto: ", ex); //NON-NLS } // Another thread is needed because we have to wait for dataResult to populate @@ -1029,7 +1029,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat try { firePropertyChange(BlackboardResultViewer.FINISHED_DISPLAY_EVT, 0, 1); } catch (Exception e) { - logger.log(Level.SEVERE, "DirectoryTreeTopComponent listener threw exception", e); + logger.log(Level.SEVERE, "DirectoryTreeTopComponent listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "DirectoryTreeTopComponent.moduleErr"), NbBundle.getMessage(this.getClass(), "DirectoryTreeTopComponent.moduleErr.msg"), diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ExplorerNodeActionVisitor.java b/Core/src/org/sleuthkit/autopsy/directorytree/ExplorerNodeActionVisitor.java index 55dd6deef8..d4bdbc0425 100755 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ExplorerNodeActionVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ExplorerNodeActionVisitor.java @@ -331,15 +331,15 @@ public class ExplorerNodeActionVisitor extends ContentVisitor.Default { private static final String NONE_SELECTED_MESSAGE = NbBundle.getMessage(DateSearchFilter.class, "DateSearchFilter.noneSelectedMsg.text"); private static final DateFormat DATE_FORMAT = new SimpleDateFormat("MM/dd/yyyy"); - private static final String SEPARATOR = "SEPARATOR"; + private static final String SEPARATOR = "SEPARATOR"; //NON-NLS /** * New DateSearchFilter with the default panel @@ -88,7 +88,7 @@ class DateSearchFilter extends AbstractFileSearchFilter { sdf.setTimeZone(selectedTZ); // get the time in the selected timezone Date temp = sdf.parse(startDateValue); - startDate = Calendar.getInstance(new SimpleTimeZone(0, "GMT")); + startDate = Calendar.getInstance(new SimpleTimeZone(0, "GMT")); //NON-NLS startDate.setTime(temp); // convert to GMT } catch (ParseException ex) { // for now, no need to show the error message to the user her @@ -107,7 +107,7 @@ class DateSearchFilter extends AbstractFileSearchFilter { sdf.setTimeZone(selectedTZ); // get the time in the selected timezone Date temp2 = sdf.parse(endDateValue); - endDate = Calendar.getInstance(new SimpleTimeZone(0, "GMT")); + endDate = Calendar.getInstance(new SimpleTimeZone(0, "GMT")); //NON-NLS endDate.setTime(temp2); // convert to GMT endDate.set(Calendar.HOUR, endDate.get(Calendar.HOUR) + 24); // get the next 24 hours } catch (ParseException ex) { @@ -130,22 +130,22 @@ class DateSearchFilter extends AbstractFileSearchFilter { String subQuery = "0"; if (modifiedChecked) { - subQuery += " or mtime between " + fromDate + " and " + toDate; + subQuery += " or mtime between " + fromDate + " and " + toDate; //NON-NLS } if (changedChecked) { - subQuery += " or ctime between " + fromDate + " and " + toDate; + subQuery += " or ctime between " + fromDate + " and " + toDate; //NON-NLS } if (accessedChecked) { - subQuery += " or atime between " + fromDate + " and " + toDate; + subQuery += " or atime between " + fromDate + " and " + toDate; //NON-NLS } if (createdChecked) { - subQuery += " or crtime between " + fromDate + " and " + toDate; + subQuery += " or crtime between " + fromDate + " and " + toDate; //NON-NLS } - addQuery += " and (" + subQuery + ")"; + addQuery += " and (" + subQuery + ")"; //NON-NLS } else { throw new FilterValidationException(NONE_SELECTED_MESSAGE); } @@ -173,7 +173,7 @@ class DateSearchFilter extends AbstractFileSearchFilter { int offset = zone.getRawOffset() / 1000; int hour = offset / 3600; int minutes = (offset % 3600) / 60; - String item = String.format("(GMT%+d:%02d) %s", hour, minutes, zone.getID()); + String item = String.format("(GMT%+d:%02d) %s", hour, minutes, zone.getID()); //NON-NLS timeZones.add(item); } @@ -188,7 +188,7 @@ class DateSearchFilter extends AbstractFileSearchFilter { int offset = zone.getRawOffset() / 1000; int hour = offset / 3600; int minutes = (offset % 3600) / 60; - String item = String.format("(GMT%+d:%02d) %s", hour, minutes, id); + String item = String.format("(GMT%+d:%02d) %s", hour, minutes, id); //NON-NLS timeZones.add(item); } } diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java index e063636c24..66adb046b4 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java @@ -156,7 +156,7 @@ import org.sleuthkit.datamodel.TskCoreException; } catch (TskCoreException ex) { Logger logger = Logger.getLogger(this.getClass().getName()); - logger.log(Level.WARNING, "Error while trying to get the number of matches.", ex); + logger.log(Level.WARNING, "Error while trying to get the number of matches.", ex); //NON-NLS } if (contentList == null) { @@ -209,7 +209,7 @@ import org.sleuthkit.datamodel.TskCoreException; String query = " 1"; for (FileSearchFilter f : this.getEnabledFilters()) { - query += " and (" + f.getPredicate() + ")"; + query += " and (" + f.getPredicate() + ")"; //NON-NLS } return query; diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchFilter.java b/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchFilter.java index f76ae9d664..247faa87db 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchFilter.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchFilter.java @@ -58,13 +58,13 @@ class KnownStatusSearchFilter extends AbstractFileSearchFilter { keyword.replace("'", "''"); // escape quotes in string //TODO: escaping might not be enough, would ideally be part of a prepared statement - return "name like '%" + keyword + "%'"; + return "name like '%" + keyword + "%'"; //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.java index b3021dd19a..887b50ae81 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.java @@ -113,7 +113,7 @@ class NameSearchPanel extends javax.swing.JPanel { } }); - noteNameLabel.setFont(new java.awt.Font("Tahoma", 0, 10)); + noteNameLabel.setFont(new java.awt.Font("Tahoma", 0, 10)); //NON-NLS noteNameLabel.setText(org.openide.util.NbBundle.getMessage(NameSearchPanel.class, "NameSearchPanel.noteNameLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchFilter.java b/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchFilter.java index b51746e0d1..03fc59b8d4 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchFilter.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchFilter.java @@ -50,7 +50,7 @@ class SizeSearchFilter extends AbstractFileSearchFilter { int unit = this.getComponent().getSizeUnitComboBox().getSelectedIndex(); int divider = (int) Math.pow(2, (unit * 10)); size = size * divider; - return "size " + operator + " " + size; + return "size " + operator + " " + size; //NON-NLS } private String compareComboBoxToOperator(JComboBox compare) { diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.java index 060234c232..f9cfdb77c4 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.java @@ -112,7 +112,7 @@ class SizeSearchPanel extends javax.swing.JPanel { selectAllMenuItem.setText(org.openide.util.NbBundle.getMessage(SizeSearchPanel.class, "SizeSearchPanel.selectAllMenuItem.text")); // NOI18N rightClickMenu.add(selectAllMenuItem); - sizeUnitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Byte(s)", "KB", "MB", "GB", "TB" })); + sizeUnitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Byte(s)", "KB", "MB", "GB", "TB" })); //NON-NLS sizeTextField.setValue(0); sizeTextField.addMouseListener(new java.awt.event.MouseAdapter() { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java index 2a9ac8ced4..82c93fcd34 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java @@ -79,7 +79,7 @@ abstract class GetFilesContentVisitor implements ContentVisitor warnings = new ArrayList<>(); private IngestJobConfigurationPanel ingestConfigPanel; @@ -78,7 +78,7 @@ public final class IngestJobLauncher { for (String moduleName : missingModuleNames) { enabledModuleNames.remove(moduleName); disabledModuleNames.remove(moduleName); - warnings.add(String.format("Previously loaded %s module could not be found", moduleName)); + warnings.add(String.format("Previously loaded %s module could not be found", moduleName)); //NON-NLS } // Create ingest module templates. @@ -111,7 +111,7 @@ public final class IngestJobLauncher { // Get the process unallocated space flag setting. If the setting does // not exist yet, default it to false. if (ModuleSettings.settingExists(launcherContext, PARSE_UNALLOC_SPACE_KEY) == false) { - ModuleSettings.setConfigSetting(launcherContext, PARSE_UNALLOC_SPACE_KEY, "false"); + ModuleSettings.setConfigSetting(launcherContext, PARSE_UNALLOC_SPACE_KEY, "false"); //NON-NLS } boolean processUnallocatedSpace = Boolean.parseBoolean(ModuleSettings.getConfigSetting(launcherContext, PARSE_UNALLOC_SPACE_KEY)); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java index c5fa91a01a..2398e9c87e 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -39,6 +39,7 @@ import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Content; import java.util.prefs.Preferences; +import javax.swing.JOptionPane; import javax.swing.SwingWorker; import org.sleuthkit.autopsy.ingest.IngestScheduler.FileIngestScheduler.FileIngestTask; @@ -47,7 +48,7 @@ import org.sleuthkit.autopsy.ingest.IngestScheduler.FileIngestScheduler.FileInge */ public class IngestManager { - private static final String NUMBER_OF_FILE_INGEST_THREADS_KEY = "NumberOfFileingestThreads"; + private static final String NUMBER_OF_FILE_INGEST_THREADS_KEY = "NumberOfFileingestThreads"; //NON-NLS private static final int MIN_NUMBER_OF_FILE_INGEST_THREADS = 1; private static final int MAX_NUMBER_OF_FILE_INGEST_THREADS = 4; private static final int DEFAULT_NUMBER_OF_FILE_INGEST_THREADS = 2; @@ -198,7 +199,7 @@ public class IngestManager { try { pcs.firePropertyChange(eventType, jobId, null); } catch (Exception e) { - logger.log(Level.SEVERE, "Ingest manager listener threw exception", e); + logger.log(Level.SEVERE, "Ingest manager listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"), NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr.errListenToUpdates.msg"), MessageNotifyUtil.MessageType.ERROR); @@ -214,7 +215,7 @@ public class IngestManager { try { pcs.firePropertyChange(IngestEvent.FILE_DONE.toString(), fileId, null); } catch (Exception e) { - logger.log(Level.SEVERE, "Ingest manager listener threw exception", e); + logger.log(Level.SEVERE, "Ingest manager listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"), NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr.errListenToUpdates.msg"), MessageNotifyUtil.MessageType.ERROR); @@ -231,7 +232,7 @@ public class IngestManager { try { pcs.firePropertyChange(IngestEvent.DATA.toString(), moduleDataEvent, null); } catch (Exception e) { - logger.log(Level.SEVERE, "Ingest manager listener threw exception", e); + logger.log(Level.SEVERE, "Ingest manager listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"), NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr.errListenToUpdates.msg"), MessageNotifyUtil.MessageType.ERROR); @@ -248,7 +249,7 @@ public class IngestManager { try { pcs.firePropertyChange(IngestEvent.CONTENT_CHANGED.toString(), moduleContentEvent, null); } catch (Exception e) { - logger.log(Level.SEVERE, "Ingest manager listener threw exception", e); + logger.log(Level.SEVERE, "Ingest manager listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"), NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr.errListenToUpdates.msg"), MessageNotifyUtil.MessageType.ERROR); @@ -360,14 +361,14 @@ public class IngestManager { public void run() { try { final String displayName = NbBundle.getMessage(this.getClass(), - "IngestManager.StartIngestJobsTask.run.displayName"); + "IngestManager.StartIngestJobsTask.run.displayName"); progress = ProgressHandleFactory.createHandle(displayName, new Cancellable() { @Override public boolean cancel() { if (progress != null) { progress.setDisplayName(NbBundle.getMessage(this.getClass(), - "IngestManager.StartIngestJobsTask.run.cancelling", - displayName)); + "IngestManager.StartIngestJobsTask.run.cancelling", + displayName)); } IngestManager.getInstance().cancelIngestJobs(); return true; @@ -381,37 +382,48 @@ public class IngestManager { break; } + // Create an ingest job. IngestJob ingestJob = new IngestJob(IngestManager.this.ingestJobId.incrementAndGet(), dataSource, moduleTemplates, processUnallocatedSpace); - List errors = ingestJob.startUpIngestPipelines(); - if (!errors.isEmpty()) { - StringBuilder failedModules = new StringBuilder(); - for (int i = 0; i < errors.size(); ++i) { - IngestModuleError error = errors.get(i); - String moduleName = error.getModuleDisplayName(); - logger.log(Level.SEVERE, "The " + moduleName + " module failed to start up", error.getModuleError()); - failedModules.append(moduleName); - if ((errors.size() > 1) && (i != (errors.size() - 1))) { - failedModules.append(","); - } - } - MessageNotifyUtil.Message.error( // RJCTODO: Fix this to show all errors, probably should specify data source name - "Failed to start the following ingest modules: " + failedModules.toString() + " .\n\n" - + "No ingest modules will be run. Please disable the module " - + "or fix the error and restart ingest by right clicking on " - + "the data source and selecting Run Ingest Modules.\n\n" - + "Error: " + errors.get(0).getModuleError().getMessage()); - ingestJob.cancel(); - break; - } - - // Save the ingest job for later cleanup of pipelines. synchronized (IngestManager.this) { ingestJobs.put(ingestJob.getId(), ingestJob); } + // Start at least one instance of each kind of ingest + // pipeline for this ingest job. This allows for an early out + // if the full ingest module lineup specified by the user + // cannot be started up. + List errors = ingestJob.startUpIngestPipelines(); + if (!errors.isEmpty()) { + // Report the error to the user. + StringBuilder moduleStartUpErrors = new StringBuilder(); + for (IngestModuleError error : errors) { + String moduleName = error.getModuleDisplayName(); + logger.log(Level.SEVERE, "The " + moduleName + " module failed to start up", error.getModuleError()); //NON-NLS + moduleStartUpErrors.append(moduleName); + moduleStartUpErrors.append(": "); + moduleStartUpErrors.append(error.getModuleError().getLocalizedMessage()); + moduleStartUpErrors.append("\n"); + } + StringBuilder notifyMessage = new StringBuilder(); + notifyMessage.append("Unable to start up one or more ingest modules, ingest job cancelled.\n"); + notifyMessage.append("Please disable the failed modules or fix the errors and then restart ingest\n"); + notifyMessage.append("by right clicking on the data source and selecting Run Ingest Modules.\n"); + notifyMessage.append("Errors:\n\n"); + notifyMessage.append(moduleStartUpErrors.toString()); + notifyMessage.append("\n\n"); + JOptionPane.showMessageDialog(null, notifyMessage.toString(), "Ingest Failure", JOptionPane.ERROR_MESSAGE); + + // Jettison the ingest job and move on to the next one. + synchronized (IngestManager.this) { + ingestJob.cancel(); + ingestJobs.remove(ingestJob.getId()); + } + break; + } + // Queue the data source ingest tasks for the ingest job. final String inputName = dataSource.getName(); - progress.progress("Data source ingest tasks for " + inputName, workUnitsCompleted); // RJCTODO: Improve + progress.progress("Data source ingest tasks for " + inputName, workUnitsCompleted); scheduler.getDataSourceIngestScheduler().queueForIngest(ingestJob); progress.progress("Data source ingest tasks for " + inputName, ++workUnitsCompleted); @@ -426,7 +438,7 @@ public class IngestManager { } } } catch (Exception ex) { - String message = String.format("StartIngestJobsTask (id=%d) caught exception", id); + String message = String.format("StartIngestJobsTask (id=%d) caught exception", id); //NON-NLS logger.log(Level.SEVERE, message, ex); MessageNotifyUtil.Message.error( NbBundle.getMessage(this.getClass(), "IngestManager.StartIngestJobsTask.run.catchException.msg")); @@ -458,7 +470,7 @@ public class IngestManager { job = scheduler.getNextTask(); } } catch (Exception ex) { - String message = String.format("RunDataSourceIngestModulesTask (id=%d) caught exception", id); + String message = String.format("RunDataSourceIngestModulesTask (id=%d) caught exception", id); //NON-NLS logger.log(Level.SEVERE, message, ex); } finally { reportRunIngestModulesTaskDone(id); @@ -489,7 +501,7 @@ public class IngestManager { task = fileScheduler.getNextTask(); } } catch (Exception ex) { - String message = String.format("RunFileSourceIngestModulesTask (id=%d) caught exception", id); + String message = String.format("RunFileSourceIngestModulesTask (id=%d) caught exception", id); //NON-NLS logger.log(Level.SEVERE, message, ex); } finally { reportRunIngestModulesTaskDone(id); @@ -511,7 +523,7 @@ public class IngestManager { super.get(); } catch (CancellationException | InterruptedException ex) { } catch (Exception ex) { - logger.log(Level.SEVERE, "Error while cancelling ingest jobs", ex); + logger.log(Level.SEVERE, "Error while cancelling ingest jobs", ex); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java index 37a97ae2d1..ffe21e40ef 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageDetailsPanel.java @@ -50,7 +50,7 @@ class IngestMessageDetailsPanel extends javax.swing.JPanel { } private void customizeComponents() { - messageDetailsPane.setContentType("text/html"); + messageDetailsPane.setContentType("text/html"); //NON-NLS viewArtifactButton.setEnabled(false); viewContentButton.setEnabled(false); HTMLEditorKit kit = new HTMLEditorKit(); @@ -58,12 +58,12 @@ class IngestMessageDetailsPanel extends javax.swing.JPanel { StyleSheet styleSheet = kit.getStyleSheet(); /* I tried to define the font-size only on body to have it inherit, * it didn't work in all cases. */ - styleSheet.addRule("body {font-family:Arial;font-size:10pt;}"); - styleSheet.addRule("p {font-family:Arial;font-size:10pt;}"); - styleSheet.addRule("li {font-family:Arial;font-size:10pt;}"); - styleSheet.addRule("table {table-layout:fixed;}"); - styleSheet.addRule("td {white-space:pre-wrap;overflow:hidden;}"); - styleSheet.addRule("th {font-weight:bold;}"); + styleSheet.addRule("body {font-family:Arial;font-size:10pt;}"); //NON-NLS + styleSheet.addRule("p {font-family:Arial;font-size:10pt;}"); //NON-NLS + styleSheet.addRule("li {font-family:Arial;font-size:10pt;}"); //NON-NLS + styleSheet.addRule("table {table-layout:fixed;}"); //NON-NLS + styleSheet.addRule("td {white-space:pre-wrap;overflow:hidden;}"); //NON-NLS + styleSheet.addRule("th {font-weight:bold;}"); //NON-NLS BlackboardResultViewer v = Lookup.getDefault().lookup(BlackboardResultViewer.class); v.addOnFinishedListener(new PropertyChangeListener() { @@ -124,22 +124,22 @@ class IngestMessageDetailsPanel extends javax.swing.JPanel { messageDetailsPane.setBackground(new java.awt.Color(221, 221, 235)); messageDetailsPane.setBorder(null); messageDetailsPane.setContentType(org.openide.util.NbBundle.getMessage(IngestMessageDetailsPanel.class, "IngestMessageDetailsPanel.messageDetailsPane.contentType")); // NOI18N - messageDetailsPane.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N + messageDetailsPane.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N NON-NLS messageDetailsPane.setToolTipText(org.openide.util.NbBundle.getMessage(IngestMessageDetailsPanel.class, "IngestMessageDetailsPanel.messageDetailsPane.toolTipText")); // NOI18N jScrollPane1.setViewportView(messageDetailsPane); jToolBar1.setFloatable(false); jToolBar1.setRollover(true); - backButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/btn_step_back.png"))); // NOI18N + backButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/btn_step_back.png"))); // NOI18N NON-NLS backButton.setText(org.openide.util.NbBundle.getMessage(IngestMessageDetailsPanel.class, "IngestMessageDetailsPanel.backButton.text")); // NOI18N backButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); backButton.setMargin(new java.awt.Insets(2, 2, 2, 2)); backButton.setMaximumSize(new java.awt.Dimension(23, 23)); backButton.setMinimumSize(new java.awt.Dimension(23, 23)); backButton.setPreferredSize(new java.awt.Dimension(23, 23)); - backButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/btn_step_back_hover.png"))); // NOI18N - backButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/btn_step_back_hover.png"))); // NOI18N + backButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/btn_step_back_hover.png"))); // NOI18N NON-NLS + backButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/btn_step_back_hover.png"))); // NOI18N NON-NLS backButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { backButtonActionPerformed(evt); @@ -148,7 +148,7 @@ class IngestMessageDetailsPanel extends javax.swing.JPanel { jToolBar1.add(backButton); jToolBar1.add(filler1); - viewArtifactButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/goto_res.png"))); // NOI18N + viewArtifactButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/goto_res.png"))); // NOI18N NON-NLS viewArtifactButton.setText(org.openide.util.NbBundle.getMessage(IngestMessageDetailsPanel.class, "IngestMessageDetailsPanel.viewArtifactButton.text")); // NOI18N viewArtifactButton.setIconTextGap(2); viewArtifactButton.setPreferredSize(new java.awt.Dimension(93, 23)); @@ -159,7 +159,7 @@ class IngestMessageDetailsPanel extends javax.swing.JPanel { }); jToolBar1.add(viewArtifactButton); - viewContentButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/goto_dir.png"))); // NOI18N + viewContentButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/goto_dir.png"))); // NOI18N NON-NLS viewContentButton.setText(org.openide.util.NbBundle.getMessage(IngestMessageDetailsPanel.class, "IngestMessageDetailsPanel.viewContentButton.text")); // NOI18N viewContentButton.setIconTextGap(2); viewContentButton.setPreferredSize(new java.awt.Dimension(111, 23)); @@ -260,10 +260,10 @@ class IngestMessageDetailsPanel extends javax.swing.JPanel { String details = messageGroup.getDetails(); if (details != null) { StringBuilder b = new StringBuilder(); - if (details.startsWith("") == false) { - b.append(""); + if (details.startsWith("") == false) { //NON-NLS + b.append(""); //NON-NLS b.append(details); - b.append(""); + b.append(""); //NON-NLS } else { b.append(details); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java index 5e0bf81fec..f8ed72a3cc 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java @@ -31,8 +31,8 @@ import org.sleuthkit.autopsy.coreutils.Logger; private IngestMessageDetailsPanel detailsPanel; private Logger logger = Logger.getLogger(IngestMessageMainPanel.class.getName()); //the 2 layer names - private static final String MESSAGES_VIEWER_LAYER = "MESSAGES"; - private static final String DETAILS_VIEWER_LAYER = "DETAILS"; + private static final String MESSAGES_VIEWER_LAYER = "MESSAGES"; //NON-NLS + private static final String DETAILS_VIEWER_LAYER = "DETAILS"; //NON-NLS /** * Creates new form IngestMessageMainPanel diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java index 8d2e676911..a452481e63 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java @@ -70,9 +70,9 @@ class IngestMessagePanel extends JPanel implements TableModelListener { private volatile long totalMessages = 0; private static final Logger logger = Logger.getLogger(IngestMessagePanel.class.getName()); private static PropertyChangeSupport messagePcs = new PropertyChangeSupport(IngestMessagePanel.class); - static final String TOTAL_NUM_MESSAGES_CHANGED = "TOTAL_NUM_MESSAGES_CHANGED"; // total number of messages changed - static final String MESSAGES_BOX_CLEARED = "MESSAGES_BOX_CLEARED"; // all messaged in inbox were cleared - static final String TOTAL_NUM_NEW_MESSAGES_CHANGED = "TOTAL_NUM_NEW_MESSAGES_CHANGED"; // total number of new messages changed + static final String TOTAL_NUM_MESSAGES_CHANGED = "TOTAL_NUM_MESSAGES_CHANGED"; // total number of messages changed NON-NLS + static final String MESSAGES_BOX_CLEARED = "MESSAGES_BOX_CLEARED"; // all messaged in inbox were cleared NON-NLS + static final String TOTAL_NUM_NEW_MESSAGES_CHANGED = "TOTAL_NUM_NEW_MESSAGES_CHANGED"; // total number of new messages changed NON-NLS /** Creates new form IngestMessagePanel */ public IngestMessagePanel(IngestMessageMainPanel mainPanel) { @@ -296,7 +296,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener { messagePcs.firePropertyChange(TOTAL_NUM_MESSAGES_CHANGED, 0, newMsgUnreadUnique); } catch (Exception e) { - logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", e); + logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr"), NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr.errListenUpdates.text"), @@ -320,7 +320,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener { messagePcs.firePropertyChange(MESSAGES_BOX_CLEARED, origMsgGroups, 0); } catch (Exception e) { - logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", e); + logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr"), NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr.errListenUpdates.text"), @@ -341,7 +341,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener { messagePcs.firePropertyChange(TOOL_TIP_TEXT_KEY, origMsgGroups, tableModel.getNumberUnreadGroups()); } catch (Exception e) { - logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", e); + logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr"), NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr.errListenUpdates.text"), @@ -357,7 +357,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener { messagePcs.firePropertyChange(new PropertyChangeEvent(tableModel, TOTAL_NUM_NEW_MESSAGES_CHANGED, -1, newMessages)); } catch (Exception ee) { - logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", ee); + logger.log(Level.SEVERE, "IngestMessagePanel listener threw exception", ee); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr"), NbBundle.getMessage(this.getClass(), "IngestMessagePanel.moduleErr.errListenUpdates.text"), @@ -464,7 +464,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener { columnIndex > columnNames.length - 1) { //temporary check if the rare case still occurrs //#messages is now lower after last regrouping, and gui event thinks it's not - logger.log(Level.WARNING, "Requested inbox message at" + rowIndex, ", only have " + numMessages); + logger.log(Level.WARNING, "Requested inbox message at" + rowIndex, ", only have " + numMessages); //NON-NLS return ""; } TableEntry entry = messageData.get(rowIndex); @@ -486,7 +486,7 @@ class IngestMessagePanel extends JPanel implements TableModelListener { ret = entry.messageGroup.getDatePosted(); break; default: - logger.log(Level.SEVERE, "Invalid table column index: {0}", columnIndex); + logger.log(Level.SEVERE, "Invalid table column index: {0}", columnIndex); //NON-NLS break; } return ret; @@ -742,8 +742,8 @@ class IngestMessagePanel extends JPanel implements TableModelListener { continue; } b.append(details); - b.append("
"); - b.append("
"); + b.append("
"); //NON-NLS + b.append("
"); //NON-NLS } return b.toString(); diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java index dabc002c81..ed291bb6eb 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java @@ -50,7 +50,7 @@ import org.sleuthkit.datamodel.Content; private static final Logger logger = Logger.getLogger(IngestMessageTopComponent.class.getName()); private IngestMessageMainPanel messagePanel; private IngestManager manager; - private static String PREFERRED_ID = "IngestMessageTopComponent"; + private static String PREFERRED_ID = "IngestMessageTopComponent"; //NON-NLS private ActionListener showIngestInboxAction; private static final Pattern tagRemove = Pattern.compile("<.+?>"); @@ -146,7 +146,7 @@ import org.sleuthkit.datamodel.Content; //logger.log(Level.INFO, "SHOWING"); super.componentShowing(); - Mode mode = WindowManager.getDefault().findMode("floatingLeftBottom"); + Mode mode = WindowManager.getDefault().findMode("floatingLeftBottom"); //NON-NLS if (mode != null) { TopComponent[] tcs = mode.getTopComponents(); for (int i = 0; i < tcs.length; ++i) { @@ -193,7 +193,7 @@ import org.sleuthkit.datamodel.Content; @Override public java.awt.Image getIcon() { return ImageUtilities.loadImage( - "org/sleuthkit/autopsy/ingest/eye-icon.png"); + "org/sleuthkit/autopsy/ingest/eye-icon.png"); //NON-NLS } void writeProperties(java.util.Properties p) { @@ -261,12 +261,12 @@ import org.sleuthkit.datamodel.Content; options, options[0]); - final String reportActionName = "org.sleuthkit.autopsy.report.ReportAction"; + final String reportActionName = "org.sleuthkit.autopsy.report.ReportAction"; //NON-NLS Action reportAction = null; //find action by name from action lookup, without introducing cyclic dependency if (choice == JOptionPane.NO_OPTION) { - List actions = Utilities.actionsForPath("Toolbars/File"); + List actions = Utilities.actionsForPath("Toolbars/File"); //NON-NLS for (Action a : actions) { //separators are null actions if (a != null) { @@ -278,7 +278,7 @@ import org.sleuthkit.datamodel.Content; } if (reportAction == null) { - logger.log(Level.SEVERE, "Could not locate Action: " + reportActionName); + logger.log(Level.SEVERE, "Could not locate Action: " + reportActionName); //NON-NLS } else { reportAction.actionPerformed(null); } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagesToolbar.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagesToolbar.java index 27613846e2..ecd5302401 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagesToolbar.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagesToolbar.java @@ -88,9 +88,9 @@ import org.sleuthkit.autopsy.casemodule.Case; ingestMessagesButton.setFocusPainted(false); ingestMessagesButton.setContentAreaFilled(false); - ingestMessagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/eye-bw-25.png"))); + ingestMessagesButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/eye-bw-25.png"))); //NON-NLS ingestMessagesButton.setRolloverEnabled(true); - ingestMessagesButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/eye-bw-25-rollover.png"))); + ingestMessagesButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/ingest/eye-bw-25-rollover.png"))); //NON-NLS ingestMessagesButton.setToolTipText( NbBundle.getMessage(this.getClass(), "IngestMessagesToolbar.customizeButton.toolTipText")); ingestMessagesButton.setBorder(null); @@ -159,7 +159,7 @@ import org.sleuthkit.autopsy.casemodule.Case; void showIngestMessages() { IngestMessageTopComponent tc = IngestMessageTopComponent.findInstance(); - Mode mode = WindowManager.getDefault().findMode("floatingLeftBottom"); + Mode mode = WindowManager.getDefault().findMode("floatingLeftBottom"); //NON-NLS if (mode != null) { //TopComponent[] tcs = mode.getTopComponents(); mode.dockInto(tc); @@ -177,7 +177,7 @@ import org.sleuthkit.autopsy.casemodule.Case; private static class IngestMessagesButton extends JButton { private static final int fontSize = 9; - private static final Font messagesFont = new java.awt.Font("Tahoma", Font.PLAIN, fontSize); + private static final Font messagesFont = new java.awt.Font("Tahoma", Font.PLAIN, fontSize); //NON-NLS private int messages = 0; @Override diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java index 3b11b3b897..510e777091 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestModuleFactoryLoader.java @@ -57,13 +57,13 @@ final class IngestModuleFactoryLoader { HashMap moduleFactoriesByClass = new HashMap<>(); Collection factories = Lookup.getDefault().lookupAll(IngestModuleFactory.class); for (IngestModuleFactory factory : factories) { - logger.log(Level.INFO, "Found ingest module factory: name = {0}, version = {1}", new Object[]{factory.getModuleDisplayName(), factory.getModuleVersionNumber()}); + logger.log(Level.INFO, "Found ingest module factory: name = {0}, version = {1}", new Object[]{factory.getModuleDisplayName(), factory.getModuleVersionNumber()}); //NON-NLS if (!moduleDisplayNames.contains(factory.getModuleDisplayName())) { moduleFactoriesByClass.put(factory.getClass().getCanonicalName(), factory); moduleDisplayNames.add(factory.getModuleDisplayName()); } else { // Not popping up a message box to keep this class UI-indepdent. - logger.log(Level.SEVERE, "Found duplicate ingest module display name, discarding ingest module factory (name = {0}", new Object[]{factory.getModuleDisplayName(), factory.getModuleVersionNumber()}); + logger.log(Level.SEVERE, "Found duplicate ingest module display name, discarding ingest module factory (name = {0}", new Object[]{factory.getModuleDisplayName(), factory.getModuleVersionNumber()}); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java index 5c311363fd..17ef4f41fc 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java @@ -44,7 +44,7 @@ public final class IngestMonitor { private static final int INITIAL_INTERVAL_MS = 60000; //1 min. private final Logger logger = Logger.getLogger(IngestMonitor.class.getName()); private Timer timer; - private static final java.util.logging.Logger MONITOR_LOGGER = java.util.logging.Logger.getLogger("monitor"); + private static final java.util.logging.Logger MONITOR_LOGGER = java.util.logging.Logger.getLogger("monitor"); //NON-NLS private MonitorAction monitor; IngestMonitor() { @@ -52,7 +52,7 @@ public final class IngestMonitor { //setup the custom memory logger try { final int MAX_LOG_FILES = 3; - FileHandler monitorLogHandler = new FileHandler(PlatformUtil.getUserDirectory().getAbsolutePath() + "/var/log/monitor.log", + FileHandler monitorLogHandler = new FileHandler(PlatformUtil.getUserDirectory().getAbsolutePath() + "/var/log/monitor.log", //NON-NLS 0, MAX_LOG_FILES); monitorLogHandler.setFormatter(new SimpleFormatter()); monitorLogHandler.setEncoding(PlatformUtil.getLogFileEncoding()); @@ -103,7 +103,7 @@ public final class IngestMonitor { try { return monitor.getFreeSpace(); } catch (SecurityException e) { - logger.log(Level.WARNING, "Error checking for free disk space on ingest data drive", e); + logger.log(Level.WARNING, "Error checking for free disk space on ingest data drive", e); //NON-NLS return DISK_FREE_SPACE_UNKNOWN; } } @@ -146,7 +146,7 @@ public final class IngestMonitor { curDir = tempF; } root = curDir; - logger.log(Level.INFO, "Monitoring disk space of case root: " + curDir.getAbsolutePath()); + logger.log(Level.INFO, "Monitoring disk space of case root: " + curDir.getAbsolutePath()); //NON-NLS } @Override @@ -163,8 +163,8 @@ public final class IngestMonitor { if (checkDiskSpace() == false) { //stop ingest if running final String diskPath = root.getAbsolutePath(); - MONITOR_LOGGER.log(Level.SEVERE, "Stopping ingest due to low disk space on disk {0}", diskPath); - logger.log(Level.SEVERE, "Stopping ingest due to low disk space on disk {0}", diskPath); + MONITOR_LOGGER.log(Level.SEVERE, "Stopping ingest due to low disk space on disk {0}", diskPath); //NON-NLS + logger.log(Level.SEVERE, "Stopping ingest due to low disk space on disk {0}", diskPath); //NON-NLS manager.cancelIngestJobs(); IngestServices.getInstance().postMessage(IngestMessage.createManagerErrorMessage( NbBundle.getMessage(this.getClass(), "IngestMonitor.mgrErrMsg.lowDiskSpace.title", diskPath), @@ -204,7 +204,7 @@ public final class IngestMonitor { try { freeSpace = getFreeSpace(); } catch (SecurityException e) { - logger.log(Level.WARNING, "Unable to check for free disk space (permission issue)", e); + logger.log(Level.WARNING, "Unable to check for free disk space (permission issue)", e); //NON-NLS return true; //OK } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestPipelinesConfiguration.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestPipelinesConfiguration.java index b834d13f62..5e9a7dce4c 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestPipelinesConfiguration.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestPipelinesConfiguration.java @@ -40,17 +40,17 @@ import org.w3c.dom.NodeList; final class IngestPipelinesConfiguration { private static final Logger logger = Logger.getLogger(IngestPipelinesConfiguration.class.getName()); - private static final String PIPELINE_CONFIG_FILE_VERSION_KEY = "PipelineConfigFileVersion"; + private static final String PIPELINE_CONFIG_FILE_VERSION_KEY = "PipelineConfigFileVersion"; //NON-NLS private static final String PIPELINE_CONFIG_FILE_VERSION_NO_STRING = "1"; private static final int PIPELINE_CONFIG_FILE_VERSION_NO = 1; - private static final String PIPELINES_CONFIG_FILE = "pipeline_config.xml"; - private static final String PIPELINES_CONFIG_FILE_XSD = "PipelineConfigSchema.xsd"; - private static final String XML_PIPELINE_ELEM = "PIPELINE"; - private static final String XML_PIPELINE_TYPE_ATTR = "type"; - private static final String DATA_SOURCE_INGEST_PIPELINE_TYPE = "ImageAnalysis"; - private static final String FILE_INGEST_PIPELINE_TYPE = "FileAnalysis"; - private static final String XML_MODULE_ELEM = "MODULE"; - private static final String XML_MODULE_CLASS_NAME_ATTR = "location"; + private static final String PIPELINES_CONFIG_FILE = "pipeline_config.xml"; //NON-NLS + private static final String PIPELINES_CONFIG_FILE_XSD = "PipelineConfigSchema.xsd"; //NON-NLS + private static final String XML_PIPELINE_ELEM = "PIPELINE"; //NON-NLS + private static final String XML_PIPELINE_TYPE_ATTR = "type"; //NON-NLS + private static final String DATA_SOURCE_INGEST_PIPELINE_TYPE = "ImageAnalysis"; //NON-NLS + private static final String FILE_INGEST_PIPELINE_TYPE = "FileAnalysis"; //NON-NLS + private static final String XML_MODULE_ELEM = "MODULE"; //NON-NLS + private static final String XML_MODULE_CLASS_NAME_ATTR = "location"; //NON-NLS private static IngestPipelinesConfiguration instance; private final List dataSourceIngestPipelineConfig = new ArrayList<>(); private final List fileIngestPipelineConfig = new ArrayList<>(); @@ -61,7 +61,7 @@ final class IngestPipelinesConfiguration { synchronized static IngestPipelinesConfiguration getInstance() { if (instance == null) { - Logger.getLogger(IngestPipelinesConfiguration.class.getName()).log(Level.INFO, "Creating ingest module loader instance"); + Logger.getLogger(IngestPipelinesConfiguration.class.getName()).log(Level.INFO, "Creating ingest module loader instance"); //NON-NLS instance = new IngestPipelinesConfiguration(); } return instance; @@ -96,14 +96,14 @@ final class IngestPipelinesConfiguration { Element rootElement = doc.getDocumentElement(); if (rootElement == null) { - logger.log(Level.SEVERE, "Invalid pipelines config file"); + logger.log(Level.SEVERE, "Invalid pipelines config file"); //NON-NLS return; } NodeList pipelineElements = rootElement.getElementsByTagName(XML_PIPELINE_ELEM); int numPipelines = pipelineElements.getLength(); if (numPipelines < 1 || numPipelines > 2) { - logger.log(Level.SEVERE, "Invalid pipelines config file"); + logger.log(Level.SEVERE, "Invalid pipelines config file"); //NON-NLS return; } @@ -120,7 +120,7 @@ final class IngestPipelinesConfiguration { pipelineConfig = fileIngestPipelineConfig; break; default: - logger.log(Level.SEVERE, "Invalid pipelines config file"); + logger.log(Level.SEVERE, "Invalid pipelines config file"); //NON-NLS return; } } @@ -143,7 +143,7 @@ final class IngestPipelinesConfiguration { } } } catch (IOException ex) { - logger.log(Level.SEVERE, "Error copying default pipeline configuration to user dir", ex); + logger.log(Level.SEVERE, "Error copying default pipeline configuration to user dir", ex); //NON-NLS } } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java index 94583a8b42..70abc43381 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestScheduler.java @@ -146,7 +146,7 @@ final class IngestScheduler { } } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Could not get children of root to enqueue: " + root.getId() + ": " + root.getName(), ex); + logger.log(Level.WARNING, "Could not get children of root to enqueue: " + root.getId() + ": " + root.getName(), ex); //NON-NLS } } } @@ -197,7 +197,7 @@ final class IngestScheduler { totalFiles += content.accept(countVisitor); } - logger.log(Level.INFO, "Total files to queue up: {0}", totalFiles); + logger.log(Level.INFO, "Total files to queue up: {0}", totalFiles); //NON-NLS return totalFiles; } @@ -282,7 +282,7 @@ final class IngestScheduler { } } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Could not get children of file and update file queues: " + logger.log(Level.SEVERE, "Could not get children of file and update file queues: " //NON-NLS + parentFile.getName(), ex); } } @@ -348,7 +348,7 @@ final class IngestScheduler { try { fs = f.getFileSystem(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Could not get FileSystem for " + f, ex); + logger.log(Level.SEVERE, "Could not get FileSystem for " + f, ex); //NON-NLS } TskData.TSK_FS_TYPE_ENUM fsType = TskData.TSK_FS_TYPE_ENUM.TSK_FS_TYPE_UNSUPP; if (fs != null) { @@ -364,7 +364,7 @@ final class IngestScheduler { try { isInRootDir = f.getParentDirectory().isRoot(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Could not check if should enqueue the file: " + f.getName(), ex); + logger.log(Level.WARNING, "Could not check if should enqueue the file: " + f.getName(), ex); //NON-NLS } if (isInRootDir && f.getMetaAddr() < 32) { @@ -405,12 +405,12 @@ final class IngestScheduler { @Override public String toString() { try { - return "ProcessTask{" + "file=" + file.getId() + ": " + return "ProcessTask{" + "file=" + file.getId() + ": " //NON-NLS + file.getUniquePath() + "}"; // + ", dataSourceTask=" + dataSourceTask + '}'; } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Cound not get unique path of file in queue, ", ex); + logger.log(Level.SEVERE, "Cound not get unique path of file in queue, ", ex); //NON-NLS } - return "ProcessTask{" + "file=" + file.getId() + ": " + return "ProcessTask{" + "file=" + file.getId() + ": " //NON-NLS + file.getName() + '}'; } @@ -581,12 +581,12 @@ final class IngestScheduler { SleuthkitCase sc = Case.getCurrentCase().getSleuthkitCase(); StringBuilder queryB = new StringBuilder(); - queryB.append("( (fs_obj_id = ").append(fs.getId()); + queryB.append("( (fs_obj_id = ").append(fs.getId()); //NON-NLS //queryB.append(") OR (fs_obj_id = NULL) )"); queryB.append(") )"); - queryB.append(" AND ( (meta_type = ").append(TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG.getValue()); - queryB.append(") OR (meta_type = ").append(TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getValue()); - queryB.append(" AND (name != '.') AND (name != '..')"); + queryB.append(" AND ( (meta_type = ").append(TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG.getValue()); //NON-NLS + queryB.append(") OR (meta_type = ").append(TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR.getValue()); //NON-NLS + queryB.append(" AND (name != '.') AND (name != '..')"); //NON-NLS queryB.append(") )"); //queryB.append( "AND (type = "); @@ -594,10 +594,10 @@ final class IngestScheduler { //queryB.append(")"); try { final String query = queryB.toString(); - logger.log(Level.INFO, "Executing count files query: {0}", query); + logger.log(Level.INFO, "Executing count files query: {0}", query); //NON-NLS return sc.countFilesWhere(query); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Couldn't get count of all files in FileSystem", ex); + logger.log(Level.SEVERE, "Couldn't get count of all files in FileSystem", ex); //NON-NLS return 0L; } } @@ -621,7 +621,7 @@ final class IngestScheduler { count = 1; } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Could not get count of objects from children to get num of total files to be ingested", ex); + logger.log(Level.WARNING, "Could not get count of objects from children to get num of total files to be ingested", ex); //NON-NLS } return count; } @@ -707,11 +707,11 @@ final class IngestScheduler { synchronized void queueForIngest(IngestJob job) { try { if (job.getDataSource().getParent() != null) { - logger.log(Level.SEVERE, "Only parent-less Content (data sources) can be scheduled for DataSource ingest, skipping: {0}", job.getDataSource()); + logger.log(Level.SEVERE, "Only parent-less Content (data sources) can be scheduled for DataSource ingest, skipping: {0}", job.getDataSource()); //NON-NLS return; } } catch (TskCoreException e) { - logger.log(Level.SEVERE, "Error validating data source to be scheduled for DataSource ingest" + job.getDataSource(), e); + logger.log(Level.SEVERE, "Error validating data source to be scheduled for DataSource ingest" + job.getDataSource(), e); //NON-NLS return; } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/Installer.java b/Core/src/org/sleuthkit/autopsy/ingest/Installer.java index d6ba900084..a3599d8ff2 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/Installer.java @@ -45,7 +45,7 @@ public class Installer extends ModuleInstall { public void restored() { Logger logger = Logger.getLogger(Installer.class.getName()); - logger.log(Level.INFO, "Initializing ingest manager"); + logger.log(Level.INFO, "Initializing ingest manager"); //NON-NLS final IngestManager manager = IngestManager.getInstance(); WindowManager.getDefault().invokeWhenUIReady(new Runnable() { @Override diff --git a/Core/src/org/sleuthkit/autopsy/ingest/NoIngestModuleIngestJobSettings.java b/Core/src/org/sleuthkit/autopsy/ingest/NoIngestModuleIngestJobSettings.java index 88f1a5f3cf..da3ad8e5a9 100755 --- a/Core/src/org/sleuthkit/autopsy/ingest/NoIngestModuleIngestJobSettings.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/NoIngestModuleIngestJobSettings.java @@ -24,7 +24,7 @@ package org.sleuthkit.autopsy.ingest; */ public final class NoIngestModuleIngestJobSettings implements IngestModuleIngestJobSettings { - private final String setting = "None"; + private final String setting = "None"; //NON-NLS /** * Gets the string used as an ingest options placeholder for serialization diff --git a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java index 6e9f8c4ecf..75d5582d45 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java @@ -162,13 +162,13 @@ public final class ExifParserFileIngestModule extends IngestModuleAdapter implem return ProcessResult.OK; } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to create blackboard artifact for exif metadata ({0}).", ex.getLocalizedMessage()); + logger.log(Level.WARNING, "Failed to create blackboard artifact for exif metadata ({0}).", ex.getLocalizedMessage()); //NON-NLS return ProcessResult.ERROR; } catch (ImageProcessingException ex) { - logger.log(Level.WARNING, "Failed to process the image file: {0}/{1}({2})", new Object[]{f.getParentPath(), f.getName(), ex.getLocalizedMessage()}); + logger.log(Level.WARNING, "Failed to process the image file: {0}/{1}({2})", new Object[]{f.getParentPath(), f.getName(), ex.getLocalizedMessage()}); //NON-NLS return ProcessResult.ERROR; } catch (IOException ex) { - logger.log(Level.WARNING, "IOException when parsing image file: " + f.getParentPath() + "/" + f.getName(), ex); + logger.log(Level.WARNING, "IOException when parsing image file: " + f.getParentPath() + "/" + f.getName(), ex); //NON-NLS return ProcessResult.ERROR; } finally { try { @@ -179,7 +179,7 @@ public final class ExifParserFileIngestModule extends IngestModuleAdapter implem bin.close(); } } catch (IOException ex) { - logger.log(Level.WARNING, "Failed to close InputStream.", ex); + logger.log(Level.WARNING, "Failed to close InputStream.", ex); //NON-NLS return ProcessResult.ERROR; } } diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchContextMenuActionsProvider.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchContextMenuActionsProvider.java index b52140876f..c87dffde92 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchContextMenuActionsProvider.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchContextMenuActionsProvider.java @@ -60,7 +60,7 @@ public class FileExtMismatchContextMenuActionsProvider implements ContextMenuAct for (BlackboardArtifact nodeArt : selectedArts) { // Only for mismatch results - if (nodeArt.getArtifactTypeName().equals("TSK_EXT_MISMATCH_DETECTED")) { + if (nodeArt.getArtifactTypeName().equals("TSK_EXT_MISMATCH_DETECTED")) { //NON-NLS String mimeTypeStr = ""; String extStr = ""; @@ -68,7 +68,7 @@ public class FileExtMismatchContextMenuActionsProvider implements ContextMenuAct try { af = nodeArt.getSleuthkitCase().getAbstractFileById(nodeArt.getObjectID()); } catch (TskCoreException ex) { - Logger.getLogger(FileExtMismatchContextMenuActionsProvider.class.getName()).log(Level.SEVERE, "Error getting file by id", ex); + Logger.getLogger(FileExtMismatchContextMenuActionsProvider.class.getName()).log(Level.SEVERE, "Error getting file by id", ex); //NON-NLS } if (af != null) { @@ -92,7 +92,7 @@ public class FileExtMismatchContextMenuActionsProvider implements ContextMenuAct } } } catch (TskCoreException ex) { - Logger.getLogger(FileExtMismatchContextMenuActionsProvider.class.getName()).log(Level.SEVERE, "Error looking up blackboard attributes", ex); + Logger.getLogger(FileExtMismatchContextMenuActionsProvider.class.getName()).log(Level.SEVERE, "Error looking up blackboard attributes", ex); //NON-NLS } if (!extStr.isEmpty() && !mimeTypeStr.isEmpty()) { diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java index ca662deddf..245ea7db3f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java @@ -122,7 +122,7 @@ public class FileExtMismatchIngestModule extends IngestModuleAdapter implements } return ProcessResult.OK; } catch (TskException ex) { - logger.log(Level.WARNING, "Error matching file signature", ex); + logger.log(Level.WARNING, "Error matching file signature", ex); //NON-NLS return ProcessResult.ERROR; } } @@ -148,7 +148,7 @@ public class FileExtMismatchIngestModule extends IngestModuleAdapter implements for (BlackboardAttribute attribute : attributes) { String currActualSigType = attribute.getValueString(); if (settings.skipFilesWithTextPlainMimeType()) { - if (!currActualExt.isEmpty() && currActualSigType.equals("text/plain")) { + if (!currActualExt.isEmpty() && currActualSigType.equals("text/plain")) { //NON-NLS return false; } } @@ -170,7 +170,7 @@ public class FileExtMismatchIngestModule extends IngestModuleAdapter implements } } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Error while getting file signature from blackboard.", ex); + logger.log(Level.WARNING, "Error while getting file signature from blackboard.", ex); //NON-NLS } return false; @@ -183,15 +183,16 @@ public class FileExtMismatchIngestModule extends IngestModuleAdapter implements IngestJobTotals jobTotals = totalsForIngestJobs.remove(jobId); StringBuilder detailsSb = new StringBuilder(); - detailsSb.append(""); - detailsSb.append(""); - detailsSb.append("\n"); //NON-NLS + detailsSb.append("
").append(FileExtMismatchDetectorModuleFactory.getModuleName()).append("
").append( + detailsSb.append(""); //NON-NLS + detailsSb.append(""); //NON-NLS + detailsSb.append("\n"); - detailsSb.append("\n"); //NON-NLS + detailsSb.append("\n"); - detailsSb.append("
").append(FileExtMismatchDetectorModuleFactory.getModuleName()).append("
").append( //NON-NLS NbBundle.getMessage(this.getClass(), "FileExtMismatchIngestModule.complete.totalProcTime")) - .append("").append(jobTotals.processTime).append("
").append( + .append("").append(jobTotals.processTime).append("
").append( //NON-NLS NbBundle.getMessage(this.getClass(), "FileExtMismatchIngestModule.complete.totalFiles")) - .append("").append(jobTotals.numFiles).append("
"); + .append("
").append(jobTotals.numFiles).append("
"); //NON-NLS + services.postMessage(IngestMessage.createMessage(IngestMessage.MessageType.INFO, FileExtMismatchDetectorModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), "FileExtMismatchIngestModule.complete.svcMsg.text"), diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchOptionsPanelController.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchOptionsPanelController.java index 35749a810e..376590f259 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchOptionsPanelController.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchOptionsPanelController.java @@ -90,7 +90,7 @@ public final class FileExtMismatchOptionsPanelController extends OptionsPanelCon try { pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); } catch (Exception e) { - logger.log(Level.SEVERE, "FileExtMismatchOptionsPanelController listener threw exception", e); + logger.log(Level.SEVERE, "FileExtMismatchOptionsPanelController listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show( NbBundle.getMessage(this.getClass(), "FileExtMismatchOptionsPanelController.moduleErr"), NbBundle.getMessage(this.getClass(), "FileExtMismatchOptionsPanelController.moduleErr.msg"), @@ -101,7 +101,7 @@ public final class FileExtMismatchOptionsPanelController extends OptionsPanelCon try { pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); } catch (Exception e) { - logger.log(Level.SEVERE, "FileExtMismatchOptionsPanelController listener threw exception", e); + logger.log(Level.SEVERE, "FileExtMismatchOptionsPanelController listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show( NbBundle.getMessage(this.getClass(), "FileExtMismatchOptionsPanelController.moduleErr"), NbBundle.getMessage(this.getClass(), "FileExtMismatchOptionsPanelController.moduleErr.msg"), diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java index de8b1e30dd..46f683f666 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchSettingsPanel.java @@ -154,7 +154,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel extRemoveErrLabel = new javax.swing.JLabel(); saveMsgLabel = new javax.swing.JLabel(); - saveButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/fileextmismatch/save16.png"))); // NOI18N + saveButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/modules/fileextmismatch/save16.png"))); // NOI18N NON-NLS saveButton.setText(org.openide.util.NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.saveButton.text")); // NOI18N saveButton.setEnabled(false); saveButton.addActionListener(new java.awt.event.ActionListener() { @@ -399,7 +399,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel mimeErrLabel.setText(NbBundle.getMessage(this.getClass(), "FileExtMismatchConfigPanel.addTypeButton.empty")); return; } - if (newMime.equals("application/octet-stream")) { + if (newMime.equals("application/octet-stream")) { //NON-NLS mimeErrLabel.setForeground(Color.red); mimeErrLabel.setText(NbBundle.getMessage(this.getClass(), "FileExtMismatchConfigPanel.addTypeButton.mimeTypeNotSupported")); @@ -645,7 +645,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel ret = (Object) word; break; default: - logger.log(Level.SEVERE, "Invalid table column index: " + columnIndex); + logger.log(Level.SEVERE, "Invalid table column index: " + columnIndex); //NON-NLS break; } return ret; @@ -710,7 +710,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel ret = (Object) word; break; default: - logger.log(Level.SEVERE, "Invalid table column index: " + columnIndex); + logger.log(Level.SEVERE, "Invalid table column index: " + columnIndex); //NON-NLS break; } return ret; diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java index 0abeed4ee2..558e78990f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchXML.java @@ -45,15 +45,15 @@ class FileExtMismatchXML { private static final Logger logger = Logger.getLogger(FileExtMismatchXML.class.getName()); private static FileExtMismatchXML defaultInstance = null; - private static final String ENCODING = "UTF-8"; - private static final String XSDFILE = "MismatchConfigSchema.xsd"; + private static final String ENCODING = "UTF-8"; //NON-NLS + private static final String XSDFILE = "MismatchConfigSchema.xsd"; //NON-NLS - private static final String ROOT_EL = "mismatch_config"; - private static final String SIG_EL = "signature"; - private static final String EXT_EL = "ext"; - private static final String SIG_MIMETYPE_ATTR = "mimetype"; + private static final String ROOT_EL = "mismatch_config"; //NON-NLS + private static final String SIG_EL = "signature"; //NON-NLS + private static final String EXT_EL = "ext"; //NON-NLS + private static final String SIG_MIMETYPE_ATTR = "mimetype"; //NON-NLS - private static final String DEFAULT_CONFIG_FILE_NAME = "mismatch_config.xml"; + private static final String DEFAULT_CONFIG_FILE_NAME = "mismatch_config.xml"; //NON-NLS protected String filePath; @@ -63,7 +63,7 @@ class FileExtMismatchXML { try { boolean extracted = PlatformUtil.extractResourceToUserConfigDir(FileExtMismatchXML.class, DEFAULT_CONFIG_FILE_NAME, false); } catch (IOException ex) { - logger.log(Level.SEVERE, "Error copying default mismatch configuration to user dir ", ex); + logger.log(Level.SEVERE, "Error copying default mismatch configuration to user dir ", ex); //NON-NLS } } @@ -96,7 +96,7 @@ class FileExtMismatchXML { Element root = doc.getDocumentElement(); if (root == null) { - logger.log(Level.SEVERE, "Error loading config file: invalid file format (bad root)."); + logger.log(Level.SEVERE, "Error loading config file: invalid file format (bad root)."); //NON-NLS return null; } @@ -128,7 +128,7 @@ class FileExtMismatchXML { } } catch (Exception e) { - logger.log(Level.SEVERE, "Error loading config file.", e); + logger.log(Level.SEVERE, "Error loading config file.", e); //NON-NLS return null; } return sigTypeToExtMap; @@ -176,7 +176,7 @@ class FileExtMismatchXML { success = XMLUtil.saveDoc(FileExtMismatchXML.class, filePath, ENCODING, doc); } catch (ParserConfigurationException e) { - logger.log(Level.SEVERE, "Error saving keyword list: can't initialize parser.", e); + logger.log(Level.SEVERE, "Error saving keyword list: can't initialize parser.", e); //NON-NLS success = false; } return success; diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index ddbf765475..ae9247722f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -120,10 +120,10 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI } return ProcessResult.OK; } catch (TskException ex) { - logger.log(Level.WARNING, "Error matching file signature", ex); + logger.log(Level.WARNING, "Error matching file signature", ex); //NON-NLS return ProcessResult.ERROR; } catch (Exception e) { - logger.log(Level.WARNING, "Error matching file signature", e); + logger.log(Level.WARNING, "Error matching file signature", e); //NON-NLS return ProcessResult.ERROR; } } @@ -135,15 +135,15 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI IngestJobTotals jobTotals = totalsForIngestJobs.remove(jobId); StringBuilder detailsSb = new StringBuilder(); - detailsSb.append(""); - detailsSb.append(""); - detailsSb.append("\n"); //NON-NLS + detailsSb.append("
").append(FileTypeIdModuleFactory.getModuleName()).append("
") + detailsSb.append(""); //NON-NLS + detailsSb.append(""); //NON-NLS + detailsSb.append("\n"); - detailsSb.append("\n"); //NON-NLS + detailsSb.append("\n"); - detailsSb.append("
").append(FileTypeIdModuleFactory.getModuleName()).append("
") //NON-NLS .append(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.totalProcTime")) - .append("").append(jobTotals.matchTime).append("
") + .append("").append(jobTotals.matchTime).append("
") //NON-NLS .append(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.totalFiles")) - .append("").append(jobTotals.numFiles).append("
"); + .append("
").append(jobTotals.numFiles).append("
"); //NON-NLS IngestServices.getInstance().postMessage(IngestMessage.createMessage(IngestMessage.MessageType.INFO, FileTypeIdModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.srvMsg.text"), diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/TikaFileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/TikaFileTypeDetector.java index e51ad24bc2..ee2ebdf61b 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/TikaFileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/TikaFileTypeDetector.java @@ -43,8 +43,8 @@ class TikaFileTypeDetector implements FileTypeDetectionInterface { // for files that are not complete try { String tagHeader = new String(buffer, 0, 5); - if (tagHeader.equals(" unpackedFiles = unpack(abstractFile); if (!unpackedFiles.isEmpty()) { @@ -239,7 +239,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F final long archiveItemPackedSize = archiveFileItem.getPackedSize(); if (archiveItemPackedSize <= 0) { - logger.log(Level.WARNING, "Cannot getting compression ratio, cannot detect if zipbomb: {0}, item: {1}", new Object[]{archiveName, archiveFileItem.getPath()}); + logger.log(Level.WARNING, "Cannot getting compression ratio, cannot detect if zipbomb: {0}, item: {1}", new Object[]{archiveName, archiveFileItem.getPath()}); //NON-NLS return false; } @@ -247,7 +247,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F if (cRatio >= MAX_COMPRESSION_RATIO) { String itemName = archiveFileItem.getPath(); - logger.log(Level.INFO, "Possible zip bomb detected, compression ration: {0} for in archive item: {1}", new Object[]{cRatio, itemName}); + logger.log(Level.INFO, "Possible zip bomb detected, compression ration: {0} for in archive item: {1}", new Object[]{cRatio, itemName}); //NON-NLS String msg = NbBundle.getMessage(this.getClass(), "SevenZipIngestModule.isZipBombCheck.warnMsg", archiveName, itemName); String details = NbBundle.getMessage(this.getClass(), @@ -260,7 +260,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F } } catch (SevenZipException ex) { - logger.log(Level.SEVERE, "Error getting archive item size and cannot detect if zipbomb. ", ex); + logger.log(Level.SEVERE, "Error getting archive item size and cannot detect if zipbomb. ", ex); //NON-NLS return false; } } @@ -309,7 +309,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F stream); int numItems = inArchive.getNumberOfItems(); - logger.log(Level.INFO, "Count of items in archive: {0}: {1}", new Object[]{archiveFile.getName(), numItems}); + logger.log(Level.INFO, "Count of items in archive: {0}: {1}", new Object[]{archiveFile.getName(), numItems}); //NON-NLS progress.start(numItems); progressStarted = true; @@ -323,7 +323,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F try { localRoot.mkdirs(); } catch (SecurityException e) { - logger.log(Level.SEVERE, "Error setting up output path for archive root: {0}", localRootAbsPath); + logger.log(Level.SEVERE, "Error setting up output path for archive root: {0}", localRootAbsPath); //NON-NLS //bail return unpackedFiles; } @@ -351,11 +351,11 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F String base = archName.substring(0, dotI); String ext = archName.substring(dotI); switch (ext) { - case ".gz": + case ".gz": //NON-NLS useName = base; break; - case ".tgz": - useName = base + ".tar"; + case ".tgz": //NON-NLS + useName = base + ".tar"; //NON-NLS break; } } @@ -372,7 +372,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F } ++itemNumber; - logger.log(Level.INFO, "Extracted item path: {0}", extractedPath); + logger.log(Level.INFO, "Extracted item path: {0}", extractedPath); //NON-NLS //check if possible zip bomb if (isZipBombArchiveItemCheck(archiveFile.getName(), item)) { @@ -395,7 +395,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F final boolean isDir = item.isFolder(); if (isEncrypted) { - logger.log(Level.WARNING, "Skipping encrypted file in archive: {0}", extractedPath); + logger.log(Level.WARNING, "Skipping encrypted file in archive: {0}", extractedPath); //NON-NLS hasEncrypted = true; continue; } else { @@ -416,7 +416,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F "SevenZipIngestModule.unpack.notEnoughDiskSpace.details"); //MessageNotifyUtil.Notify.error(msg, details); services.postMessage(IngestMessage.createErrorMessage(ArchiveFileExtractorModuleFactory.getModuleName(), msg, details)); - logger.log(Level.INFO, "Skipping archive item due not sufficient disk space for this item: {0}, {1}", new Object[]{archiveFile.getName(), fileName}); + logger.log(Level.INFO, "Skipping archive item due not sufficient disk space for this item: {0}, {1}", new Object[]{archiveFile.getName(), fileName}); //NON-NLS continue; //skip this file } else { //update est. disk space during this archive, so we don't need to poll for every file extracted @@ -440,11 +440,11 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F try { localFile.createNewFile(); } catch (IOException ex) { - logger.log(Level.SEVERE, "Error creating extracted file: " + localFile.getAbsolutePath(), ex); + logger.log(Level.SEVERE, "Error creating extracted file: " + localFile.getAbsolutePath(), ex); //NON-NLS } } } catch (SecurityException e) { - logger.log(Level.SEVERE, "Error setting up output path for unpacked file: {0}", extractedPath); + logger.log(Level.SEVERE, "Error setting up output path for unpacked file: {0}", extractedPath); //NON-NLS //TODO consider bail out / msg to the user } } @@ -468,7 +468,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F item.extractSlow(unpackStream); } catch (Exception e) { //could be something unexpected with this file, move on - logger.log(Level.WARNING, "Could not extract file from archive: " + localAbsPath, e); + logger.log(Level.WARNING, "Could not extract file from archive: " + localAbsPath, e); //NON-NLS } finally { if (unpackStream != null) { unpackStream.close(); @@ -492,12 +492,12 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F } } catch (TskCoreException e) { - logger.log(Level.SEVERE, "Error populating complete derived file hierarchy from the unpacked dir structure"); + logger.log(Level.SEVERE, "Error populating complete derived file hierarchy from the unpacked dir structure"); //NON-NLS //TODO decide if anything to cleanup, for now bailing } } catch (SevenZipException ex) { - logger.log(Level.SEVERE, "Error unpacking file: " + archiveFile, ex); + logger.log(Level.SEVERE, "Error unpacking file: " + archiveFile, ex); //NON-NLS //inbox message String fullName; try { @@ -520,7 +520,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F try { inArchive.close(); } catch (SevenZipException e) { - logger.log(Level.SEVERE, "Error closing archive: " + archiveFile, e); + logger.log(Level.SEVERE, "Error closing archive: " + archiveFile, e); //NON-NLS } } @@ -528,7 +528,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F try { stream.close(); } catch (IOException ex) { - logger.log(Level.SEVERE, "Error closing stream after unpacking archive: " + archiveFile, ex); + logger.log(Level.SEVERE, "Error closing stream after unpacking archive: " + archiveFile, ex); //NON-NLS } } @@ -546,7 +546,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F artifact.addAttribute(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_NAME.getTypeID(), ArchiveFileExtractorModuleFactory.getModuleName(), encryptionType)); services.fireModuleDataEvent(new ModuleDataEvent(ArchiveFileExtractorModuleFactory.getModuleName(), BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED)); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error creating blackboard artifact for encryption detected for file: " + archiveFile, ex); + logger.log(Level.SEVERE, "Error creating blackboard artifact for encryption detected for file: " + archiveFile, ex); //NON-NLS } String msg = NbBundle.getMessage(this.getClass(), "SevenZipIngestModule.unpack.encrFileDetected.msg"); @@ -575,7 +575,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F for (BlackboardAttribute attribute : attributes) { attributeFound = true; String fileType = attribute.getValueString(); - if (!fileType.isEmpty() && fileType.equals("application/zip")) { + if (!fileType.isEmpty() && fileType.equals("application/zip")) { //NON-NLS return true; } } @@ -629,7 +629,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F try { output = new BufferedOutputStream(new FileOutputStream(localAbsPath)); } catch (FileNotFoundException ex) { - logger.log(Level.SEVERE, "Error writing extracted file: " + localAbsPath, ex); + logger.log(Level.SEVERE, "Error writing extracted file: " + localAbsPath, ex); //NON-NLS } } @@ -652,7 +652,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F output.flush(); output.close(); } catch (IOException e) { - logger.log(Level.SEVERE, "Error closing unpack stream for file: {0}", localAbsPath); + logger.log(Level.SEVERE, "Error closing unpack stream for file: {0}", localAbsPath); //NON-NLS } } } @@ -780,7 +780,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error adding a derived file to db:" + fileName, ex); + logger.log(Level.SEVERE, "Error adding a derived file to db:" + fileName, ex); //NON-NLS throw new TskCoreException( NbBundle.getMessage(this.getClass(), "SevenZipIngestModule.UnpackedTree.exception.msg", fileName), ex); diff --git a/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java b/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java index 3ba14c7577..ae12c42e73 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java +++ b/Core/src/org/sleuthkit/autopsy/report/ArtifactSelectionDialog.java @@ -84,7 +84,7 @@ public class ArtifactSelectionDialog extends javax.swing.JDialog { artifactStates.put(type, Boolean.TRUE); } } catch (TskCoreException ex) { - Logger.getLogger(ArtifactSelectionDialog.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage()); + Logger.getLogger(ArtifactSelectionDialog.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage()); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java b/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java index b05b2628e4..17dec869a7 100644 --- a/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/DefaultReportConfigurationPanel.java @@ -41,7 +41,7 @@ public class DefaultReportConfigurationPanel extends javax.swing.JPanel { infoLabel = new javax.swing.JLabel(); - infoLabel.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N + infoLabel.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(infoLabel, org.openide.util.NbBundle.getMessage(DefaultReportConfigurationPanel.class, "DefaultReportConfigurationPanel.infoLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java b/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java index a118ef23f2..9d4e6cfa57 100755 --- a/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportDataTypes.java @@ -56,7 +56,7 @@ import org.sleuthkit.datamodel.TskData; @Override public String getValue(AbstractFile file) { if (file.getMetaFlagsAsString().equals(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC.toString())) { - return "yes"; + return "yes"; //NON-NLS } return ""; } diff --git a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java index 68268cf4d5..330ad7515f 100755 --- a/Core/src/org/sleuthkit/autopsy/report/FileReportText.java +++ b/Core/src/org/sleuthkit/autopsy/report/FileReportText.java @@ -41,7 +41,7 @@ import org.sleuthkit.datamodel.AbstractFile; private static final Logger logger = Logger.getLogger(FileReportText.class.getName()); private String reportPath; private Writer out; - private static final String FILE_NAME = "file-report.txt"; + private static final String FILE_NAME = "file-report.txt"; //NON-NLS private static FileReportText instance; @@ -59,7 +59,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(this.reportPath))); } catch (IOException ex) { - logger.log(Level.WARNING, "Failed to create report text file", ex); + logger.log(Level.WARNING, "Failed to create report text file", ex); //NON-NLS } } @@ -69,7 +69,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close output writer when ending report.", ex); + logger.log(Level.WARNING, "Could not close output writer when ending report.", ex); //NON-NLS } } } @@ -92,7 +92,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out.write(getTabDelimitedList(titles)); } catch (IOException ex) { - logger.log(Level.WARNING, "Error when writing headers to report file: {0}", ex); + logger.log(Level.WARNING, "Error when writing headers to report file: {0}", ex); //NON-NLS } } @@ -105,7 +105,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out.write(getTabDelimitedList(cells)); } catch (IOException ex) { - logger.log(Level.WARNING, "Error when writing row to report file: {0}", ex); + logger.log(Level.WARNING, "Error when writing row to report file: {0}", ex); //NON-NLS } } @@ -114,7 +114,7 @@ import org.sleuthkit.datamodel.AbstractFile; try { out.write(System.lineSeparator()); } catch (IOException ex) { - logger.log(Level.WARNING, "Error when closing table: {0}", ex); + logger.log(Level.WARNING, "Error when closing table: {0}", ex); //NON-NLS } } @@ -130,7 +130,7 @@ import org.sleuthkit.datamodel.AbstractFile; @Override public String getExtension() { - return ".txt"; + return ".txt"; //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java b/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java index ef7772fa3e..83f1a9a7bf 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportBodyFile.java @@ -75,7 +75,7 @@ import org.sleuthkit.datamodel.*; progressPanel.setIndeterminate(false); progressPanel.start(); progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportBodyFile.progress.querying")); - reportPath = path + "BodyFile.txt"; + reportPath = path + "BodyFile.txt"; //NON-NLS currentCase = Case.getCurrentCase(); skCase = currentCase.getSleuthkitCase(); @@ -83,8 +83,8 @@ import org.sleuthkit.datamodel.*; try { // exclude non-fs files/dirs and . and .. files - final String query = "type = " + TskData.TSK_DB_FILES_TYPE_ENUM.FS.getFileType() - + " AND name != '.' AND name != '..'"; + final String query = "type = " + TskData.TSK_DB_FILES_TYPE_ENUM.FS.getFileType() //NON-NLS + + " AND name != '.' AND name != '..'"; //NON-NLS progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportBodyFile.progress.loading")); List fs = skCase.findFilesWhere(query); @@ -148,18 +148,18 @@ import org.sleuthkit.datamodel.*; out.write("\n"); } } catch (IOException ex) { - logger.log(Level.WARNING, "Could not write the temp body file report.", ex); + logger.log(Level.WARNING, "Could not write the temp body file report.", ex); //NON-NLS } finally { try { out.flush(); out.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not flush and close the BufferedWriter.", ex); + logger.log(Level.WARNING, "Could not flush and close the BufferedWriter.", ex); //NON-NLS } } progressPanel.complete(); } catch(TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get the unique path.", ex); + logger.log(Level.WARNING, "Failed to get the unique path.", ex); //NON-NLS } } @@ -176,7 +176,7 @@ import org.sleuthkit.datamodel.*; @Override public String getExtension() { - String ext = ".txt"; + String ext = ".txt"; //NON-NLS return ext; } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java b/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java index f71e047f6e..63fd7fe337 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportBranding.java @@ -41,12 +41,12 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil; public final class ReportBranding implements ReportBrandingProviderI { //property names - private static final String GENERATOR_LOGO_PATH_PROP = "GeneratorLogoPath"; - private static final String AGENCY_LOGO_PATH_PROP = "AgencyLogoPath"; - private static final String REPORT_TITLE_PROP = "ReportTitle"; - private static final String REPORT_FOOTER_PROP = "ReportFooter"; + private static final String GENERATOR_LOGO_PATH_PROP = "GeneratorLogoPath"; //NON-NLS + private static final String AGENCY_LOGO_PATH_PROP = "AgencyLogoPath"; //NON-NLS + private static final String REPORT_TITLE_PROP = "ReportTitle"; //NON-NLS + private static final String REPORT_FOOTER_PROP = "ReportFooter"; //NON-NLS //default settings - private static final String DEFAULT_GENERATOR_LOGO = "/org/sleuthkit/autopsy/report/images/default_generator_logo.png"; + private static final String DEFAULT_GENERATOR_LOGO = "/org/sleuthkit/autopsy/report/images/default_generator_logo.png"; //NON-NLS private static final String DEFAULT_REPORT_TITLE = NbBundle .getMessage(ReportBranding.class, "ReportBranding.defaultReportTitle.text"); private static final String DEFAULT_REPORT_FOOTER = NbBundle @@ -61,11 +61,11 @@ public final class ReportBranding implements ReportBrandingProviderI { synchronized (ReportBranding.class) { reportsBrandingDir = PlatformUtil.getUserConfigDirectory() + File.separator + ReportGenerator.REPORTS_DIR + File.separator - + "branding"; + + "branding"; //NON-NLS File brandingDir = new File(reportsBrandingDir); if (!brandingDir.exists()) { if (!brandingDir.mkdirs()) { - logger.log(Level.SEVERE, "Error creating report branding dir for the case, will use defaults"); + logger.log(Level.SEVERE, "Error creating report branding dir for the case, will use defaults"); //NON-NLS //TODO use defaults } } @@ -86,15 +86,15 @@ public final class ReportBranding implements ReportBrandingProviderI { curPath = ModuleSettings.getConfigSetting(MODULE_NAME, GENERATOR_LOGO_PATH_PROP); if (curPath == null || (!curPath.isEmpty() && !new File(curPath).canRead() ) ) { //use default - logger.log(Level.INFO, "Using default report branding for generator logo"); - curPath = reportsBrandingDir + File.separator + "logo.png"; + logger.log(Level.INFO, "Using default report branding for generator logo"); //NON-NLS + curPath = reportsBrandingDir + File.separator + "logo.png"; //NON-NLS InputStream in = getClass().getResourceAsStream(DEFAULT_GENERATOR_LOGO); OutputStream output = new FileOutputStream(new File(curPath)); FileUtil.copy(in, output); ModuleSettings.setConfigSetting(MODULE_NAME, GENERATOR_LOGO_PATH_PROP, curPath); } } catch (IOException e) { - logger.log(Level.SEVERE, "Error extracting report branding resources for generator logo", e); + logger.log(Level.SEVERE, "Error extracting report branding resources for generator logo", e); //NON-NLS } return curPath; @@ -113,7 +113,7 @@ public final class ReportBranding implements ReportBrandingProviderI { //if has been set, validate it's correct, if not set, return null if (curPath != null && new File(curPath).canRead() == false) { //use default - logger.log(Level.INFO, "Custom report branding for agency logo is not valid: " + curPath); + logger.log(Level.INFO, "Custom report branding for agency logo is not valid: " + curPath); //NON-NLS curPath = null; } @@ -132,7 +132,7 @@ public final class ReportBranding implements ReportBrandingProviderI { curTitle = ModuleSettings.getConfigSetting(MODULE_NAME, REPORT_TITLE_PROP); if (curTitle == null || curTitle.isEmpty()) { //use default - logger.log(Level.INFO, "Using default report branding for report title"); + logger.log(Level.INFO, "Using default report branding for report title"); //NON-NLS curTitle = DEFAULT_REPORT_TITLE; ModuleSettings.setConfigSetting(MODULE_NAME, REPORT_TITLE_PROP, curTitle); } @@ -152,7 +152,7 @@ public final class ReportBranding implements ReportBrandingProviderI { curFooter = ModuleSettings.getConfigSetting(MODULE_NAME, REPORT_FOOTER_PROP); if (curFooter == null) { //use default - logger.log(Level.INFO, "Using default report branding for report footer"); + logger.log(Level.INFO, "Using default report branding for report footer"); //NON-NLS curFooter = DEFAULT_REPORT_FOOTER; ModuleSettings.setConfigSetting(MODULE_NAME, REPORT_FOOTER_PROP, curFooter); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java index 2b9c9c18f7..94116f324d 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportExcel.java @@ -111,7 +111,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; out = new FileOutputStream(reportPath); wb.write(out); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write Excel report.", ex); + logger.log(Level.SEVERE, "Failed to write Excel report.", ex); //NON-NLS } finally { if (out != null) { try { @@ -288,7 +288,7 @@ import org.sleuthkit.autopsy.coreutils.Logger; @Override public String getExtension() { - return ".xlsx"; + return ".xlsx"; //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java index f79a9b02f7..bf0d869460 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerationPanel.java @@ -171,7 +171,7 @@ import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus; reportScrollPane.setViewportView(reportPanel); - titleLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + titleLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(titleLabel, org.openide.util.NbBundle.getMessage(ReportGenerationPanel.class, "ReportGenerationPanel.titleLabel.text")); // NOI18N titleSeparator.setForeground(new java.awt.Color(0, 0, 0)); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index 1e92c0d439..2400f38c88 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -85,7 +85,7 @@ import org.sleuthkit.datamodel.TskData; private String reportPath; private ReportGenerationPanel panel = new ReportGenerationPanel(); - static final String REPORTS_DIR = "Reports"; + static final String REPORTS_DIR = "Reports"; //NON-NLS ReportGenerator(Map tableModuleStates, Map generalModuleStates, Map fileListModuleStates) { // Create the root reports directory path of the form: /Reports/ / @@ -98,7 +98,7 @@ import org.sleuthkit.datamodel.TskData; try { FileUtil.createFolder(new File(this.reportPath)); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to make report folder, may be unable to generate reports.", ex); + logger.log(Level.SEVERE, "Failed to make report folder, may be unable to generate reports.", ex); //NON-NLS } // Initialize the progress panels @@ -260,7 +260,7 @@ import org.sleuthkit.datamodel.TskData; NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorTitle"), NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(), MessageNotifyUtil.MessageType.ERROR); - logger.log(Level.SEVERE, "failed to generate reports", ex); + logger.log(Level.SEVERE, "failed to generate reports", ex); //NON-NLS } // catch and ignore if we were cancelled catch (java.util.concurrent.CancellationException ex ) { } @@ -347,7 +347,7 @@ import org.sleuthkit.datamodel.TskData; List absFiles; try { SleuthkitCase skCase = Case.getCurrentCase().getSleuthkitCase(); - absFiles = skCase.findAllFilesWhere("NOT meta_type = 2"); + absFiles = skCase.findAllFilesWhere("NOT meta_type = 2"); //NON-NLS return absFiles; } catch (TskCoreException ex) { // TODO @@ -364,7 +364,7 @@ import org.sleuthkit.datamodel.TskData; NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorTitle"), NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(), MessageNotifyUtil.MessageType.ERROR); - logger.log(Level.SEVERE, "failed to generate reports", ex); + logger.log(Level.SEVERE, "failed to generate reports", ex); //NON-NLS } // catch and ignore if we were cancelled catch (java.util.concurrent.CancellationException ex ) { } @@ -552,7 +552,7 @@ import org.sleuthkit.datamodel.TskData; tags = Case.getCurrentCase().getServices().getTagsManager().getAllContentTags(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "failed to get content tags", ex); + logger.log(Level.SEVERE, "failed to get content tags", ex); //NON-NLS return; } @@ -563,7 +563,7 @@ import org.sleuthkit.datamodel.TskData; tableProgress.get(module).updateStatusLabel( NbBundle.getMessage(this.getClass(), "ReportGenerator.progress.processing", ARTIFACT_TYPE.TSK_TAG_FILE.getDisplayName())); - ArrayList columnHeaders = new ArrayList<>(Arrays.asList("File", "Tag", "Comment")); + ArrayList columnHeaders = new ArrayList<>(Arrays.asList("File", "Tag", "Comment")); //NON-NLS StringBuilder comment = new StringBuilder(); if (!tagNamesFilter.isEmpty()) { comment.append( @@ -628,7 +628,7 @@ import org.sleuthkit.datamodel.TskData; NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorTitle"), NbBundle.getMessage(this.getClass(), "ReportGenerator.errors.reportErrorText") + ex.getLocalizedMessage(), MessageNotifyUtil.MessageType.ERROR); - logger.log(Level.SEVERE, "failed to generate reports", ex); + logger.log(Level.SEVERE, "failed to generate reports", ex); //NON-NLS } // catch and ignore if we were cancelled catch (java.util.concurrent.CancellationException ex ) { } @@ -649,7 +649,7 @@ import org.sleuthkit.datamodel.TskData; tags = Case.getCurrentCase().getServices().getTagsManager().getAllBlackboardArtifactTags(); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "failed to get blackboard artifact tags", ex); + logger.log(Level.SEVERE, "failed to get blackboard artifact tags", ex); //NON-NLS return; } @@ -754,7 +754,7 @@ import org.sleuthkit.datamodel.TskData; try { file = Case.getCurrentCase().getSleuthkitCase().getAbstractFileById(artifactTag.getArtifact().getObjectID()); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Error while getting content from a blackboard artifact to report on.", ex); + logger.log(Level.WARNING, "Error while getting content from a blackboard artifact to report on.", ex); //NON-NLS return; } checkIfFileIsImage(file); @@ -826,12 +826,12 @@ import org.sleuthkit.datamodel.TskData; try { artifacts.add(new ArtifactData(artifact, skCase.getBlackboardAttributes(artifact), uniqueTagNames)); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Failed to get Blackboard Attributes when generating report.", ex); + logger.log(Level.SEVERE, "Failed to get Blackboard Attributes when generating report.", ex); //NON-NLS } } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Failed to get Blackboard Artifacts when generating report.", ex); + logger.log(Level.SEVERE, "Failed to get Blackboard Artifacts when generating report.", ex); //NON-NLS } return artifacts; } @@ -845,12 +845,12 @@ import org.sleuthkit.datamodel.TskData; ResultSet listsRs = null; try { // Query for keyword lists - listsRs = skCase.runQuery("SELECT att.value_text AS list " + - "FROM blackboard_attributes AS att, blackboard_artifacts AS art " + - "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + " " + - "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() + " " + - "AND att.artifact_id = art.artifact_id " + - "GROUP BY list"); + listsRs = skCase.runQuery("SELECT att.value_text AS list " + //NON-NLS + "FROM blackboard_attributes AS att, blackboard_artifacts AS art " + //NON-NLS + "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + " " + //NON-NLS + "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() + " " + //NON-NLS + "AND att.artifact_id = art.artifact_id " + //NON-NLS + "GROUP BY list"); //NON-NLS List lists = new ArrayList<>(); while(listsRs.next()) { String list = listsRs.getString("list"); @@ -870,7 +870,7 @@ import org.sleuthkit.datamodel.TskData; } } catch (SQLException ex) { - logger.log(Level.SEVERE, "Failed to query keyword lists.", ex); + logger.log(Level.SEVERE, "Failed to query keyword lists.", ex); //NON-NLS } finally { if (listsRs != null) { try { @@ -883,17 +883,17 @@ import org.sleuthkit.datamodel.TskData; ResultSet rs = null; try { // Query for keywords - rs = skCase.runQuery("SELECT art.artifact_id, art.obj_id, att1.value_text AS keyword, att2.value_text AS preview, att3.value_text AS list, f.name AS name " + - "FROM blackboard_artifacts AS art, blackboard_attributes AS att1, blackboard_attributes AS att2, blackboard_attributes AS att3, tsk_files AS f " + - "WHERE (att1.artifact_id = art.artifact_id) " + - "AND (att2.artifact_id = art.artifact_id) " + - "AND (att3.artifact_id = art.artifact_id) " + - "AND (f.obj_id = art.obj_id) " + - "AND (att1.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID() + ") " + - "AND (att2.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID() + ") " + - "AND (att3.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + ") " + - "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() + ") " + - "ORDER BY list, keyword, name"); + rs = skCase.runQuery("SELECT art.artifact_id, art.obj_id, att1.value_text AS keyword, att2.value_text AS preview, att3.value_text AS list, f.name AS name " + //NON-NLS + "FROM blackboard_artifacts AS art, blackboard_attributes AS att1, blackboard_attributes AS att2, blackboard_attributes AS att3, tsk_files AS f " + //NON-NLS + "WHERE (att1.artifact_id = art.artifact_id) " + //NON-NLS + "AND (att2.artifact_id = art.artifact_id) " + //NON-NLS + "AND (att3.artifact_id = art.artifact_id) " + //NON-NLS + "AND (f.obj_id = art.obj_id) " + //NON-NLS + "AND (att1.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID() + ") " + //NON-NLS + "AND (att2.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID() + ") " + //NON-NLS + "AND (att3.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + ") " + //NON-NLS + "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID() + ") " + //NON-NLS + "ORDER BY list, keyword, name"); //NON-NLS String currentKeyword = ""; String currentList = ""; while (rs.next()) { @@ -911,25 +911,25 @@ import org.sleuthkit.datamodel.TskData; // Get any tags that associated with this artifact and apply the tag filter. HashSet uniqueTagNames = new HashSet<>(); - ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); + ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); //NON-NLS while (tagNameRows.next()) { - uniqueTagNames.add(tagNameRows.getString("display_name")); + uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS } if(failsTagFilter(uniqueTagNames, tagNamesFilter)) { continue; } String tagsList = makeCommaSeparatedList(uniqueTagNames); - Long objId = rs.getLong("obj_id"); - String keyword = rs.getString("keyword"); - String preview = rs.getString("preview"); - String list = rs.getString("list"); + Long objId = rs.getLong("obj_id"); //NON-NLS + String keyword = rs.getString("keyword"); //NON-NLS + String preview = rs.getString("preview"); //NON-NLS + String list = rs.getString("list"); //NON-NLS String uniquePath = ""; try { uniquePath = skCase.getAbstractFileById(objId).getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get Abstract File by ID.", ex); + logger.log(Level.WARNING, "Failed to get Abstract File by ID.", ex); //NON-NLS } // If the lists aren't the same, we've started a new list @@ -976,7 +976,7 @@ import org.sleuthkit.datamodel.TskData; module.endDataType(); } } catch (SQLException ex) { - logger.log(Level.SEVERE, "Failed to query keywords.", ex); + logger.log(Level.SEVERE, "Failed to query keywords.", ex); //NON-NLS } finally { if (rs != null) { try { @@ -996,12 +996,12 @@ import org.sleuthkit.datamodel.TskData; ResultSet listsRs = null; try { // Query for hashsets - listsRs = skCase.runQuery("SELECT att.value_text AS list " + - "FROM blackboard_attributes AS att, blackboard_artifacts AS art " + - "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + " " + - "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() + " " + - "AND att.artifact_id = art.artifact_id " + - "GROUP BY list"); + listsRs = skCase.runQuery("SELECT att.value_text AS list " + //NON-NLS + "FROM blackboard_attributes AS att, blackboard_artifacts AS art " + //NON-NLS + "WHERE att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + " " + //NON-NLS + "AND art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() + " " + //NON-NLS + "AND att.artifact_id = art.artifact_id " + //NON-NLS + "GROUP BY list"); //NON-NLS List lists = new ArrayList<>(); while(listsRs.next()) { lists.add(listsRs.getString("list")); @@ -1015,7 +1015,7 @@ import org.sleuthkit.datamodel.TskData; ARTIFACT_TYPE.TSK_HASHSET_HIT.getDisplayName())); } } catch (SQLException ex) { - logger.log(Level.SEVERE, "Failed to query hashset lists.", ex); + logger.log(Level.SEVERE, "Failed to query hashset lists.", ex); //NON-NLS } finally { if (listsRs != null) { try { @@ -1028,13 +1028,13 @@ import org.sleuthkit.datamodel.TskData; ResultSet rs = null; try { // Query for hashset hits - rs = skCase.runQuery("SELECT art.artifact_id, art.obj_id, att.value_text AS setname, f.name AS name, f.size AS size " + - "FROM blackboard_artifacts AS art, blackboard_attributes AS att, tsk_files AS f " + - "WHERE (att.artifact_id = art.artifact_id) " + - "AND (f.obj_id = art.obj_id) " + - "AND (att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + ") " + - "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() + ") " + - "ORDER BY setname, name, size"); + rs = skCase.runQuery("SELECT art.artifact_id, art.obj_id, att.value_text AS setname, f.name AS name, f.size AS size " + //NON-NLS + "FROM blackboard_artifacts AS art, blackboard_attributes AS att, tsk_files AS f " + //NON-NLS + "WHERE (att.artifact_id = art.artifact_id) " + //NON-NLS + "AND (f.obj_id = art.obj_id) " + //NON-NLS + "AND (att.attribute_type_id = " + ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID() + ") " + //NON-NLS + "AND (art.artifact_type_id = " + ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID() + ") " + //NON-NLS + "ORDER BY setname, name, size"); //NON-NLS String currentSet = ""; while (rs.next()) { // Check to see if all the TableReportModules have been canceled @@ -1051,24 +1051,24 @@ import org.sleuthkit.datamodel.TskData; // Get any tags that associated with this artifact and apply the tag filter. HashSet uniqueTagNames = new HashSet<>(); - ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); + ResultSet tagNameRows = skCase.runQuery("SELECT display_name FROM tag_names WHERE artifact_id = " + rs.getLong("artifact_id")); //NON-NLS while (tagNameRows.next()) { - uniqueTagNames.add(tagNameRows.getString("display_name")); + uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS } if(failsTagFilter(uniqueTagNames, tagNamesFilter)) { continue; } String tagsList = makeCommaSeparatedList(uniqueTagNames); - Long objId = rs.getLong("obj_id"); - String set = rs.getString("setname"); - String size = rs.getString("size"); + Long objId = rs.getLong("obj_id"); //NON-NLS + String set = rs.getString("setname"); //NON-NLS + String size = rs.getString("size"); //NON-NLS String uniquePath = ""; try { uniquePath = skCase.getAbstractFileById(objId).getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get Abstract File from ID.", ex); + logger.log(Level.WARNING, "Failed to get Abstract File from ID.", ex); //NON-NLS } // If the sets aren't the same, we've started a new set @@ -1101,7 +1101,7 @@ import org.sleuthkit.datamodel.TskData; module.endDataType(); } } catch (SQLException ex) { - logger.log(Level.SEVERE, "Failed to query hashsets hits.", ex); + logger.log(Level.SEVERE, "Failed to query hashsets hits.", ex); //NON-NLS } finally { if (rs != null) { try { @@ -1402,7 +1402,7 @@ import org.sleuthkit.datamodel.TskData; try { return skCase.getAbstractFileById(objId).getUniquePath(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Failed to get Abstract File by ID.", ex); + logger.log(Level.WARNING, "Failed to get Abstract File by ID.", ex); //NON-NLS } return ""; } @@ -1464,7 +1464,7 @@ import org.sleuthkit.datamodel.TskData; try { rowData = getOrderedRowDataAsStrings(); } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Core exception while generating row data for artifact report.", ex); + logger.log(Level.WARNING, "Core exception while generating row data for artifact report.", ex); //NON-NLS rowData = Collections.emptyList(); } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java index 9111fe3e7b..0b0dfd0507 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java @@ -63,7 +63,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; class ReportHTML implements TableReportModule { private static final Logger logger = Logger.getLogger(ReportHTML.class.getName()); - private static final String THUMBS_REL_PATH = "thumbs" + File.separator; + private static final String THUMBS_REL_PATH = "thumbs" + File.separator; //NON-NLS private static ReportHTML instance; private static final int MAX_THUMBS_PER_PAGE = 1000; private Case currentCase; @@ -140,7 +140,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; InputStream in; OutputStream output = null; - logger.log(Level.INFO, "useDataTypeIcon: dataType = {0}", dataType); + logger.log(Level.INFO, "useDataTypeIcon: dataType = {0}", dataType); //NON-NLS // find the artifact with matching display name BlackboardArtifact.ARTIFACT_TYPE artifactType = null; @@ -153,93 +153,93 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; if (null != artifactType) { // set the icon file name - iconFileName = dataTypeToFileName(artifactType.getDisplayName()) + ".png"; + iconFileName = dataTypeToFileName(artifactType.getDisplayName()) + ".png"; //NON-NLS iconFilePath = path + File.separator + iconFileName; // determine the source image to use switch (artifactType) { case TSK_WEB_BOOKMARK: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/bookmarks.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/bookmarks.png"); //NON-NLS break; case TSK_WEB_COOKIE: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/cookies.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/cookies.png"); //NON-NLS break; case TSK_WEB_HISTORY: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/history.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/history.png"); //NON-NLS break; case TSK_WEB_DOWNLOAD: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/downloads.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/downloads.png"); //NON-NLS break; case TSK_RECENT_OBJECT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/recent.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/recent.png"); //NON-NLS break; case TSK_INSTALLED_PROG: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/installed.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/installed.png"); //NON-NLS break; case TSK_KEYWORD_HIT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/keywords.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/keywords.png"); //NON-NLS break; case TSK_HASHSET_HIT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/hash.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/hash.png"); //NON-NLS break; case TSK_DEVICE_ATTACHED: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/devices.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/devices.png"); //NON-NLS break; case TSK_WEB_SEARCH_QUERY: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/search.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/search.png"); //NON-NLS break; case TSK_METADATA_EXIF: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/exif.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/exif.png"); //NON-NLS break; case TSK_TAG_FILE: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/userbookmarks.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/userbookmarks.png"); //NON-NLS break; case TSK_TAG_ARTIFACT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/userbookmarks.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/userbookmarks.png"); //NON-NLS break; case TSK_SERVICE_ACCOUNT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/account-icon-16.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/account-icon-16.png"); //NON-NLS break; case TSK_CONTACT: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/contact.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/contact.png"); //NON-NLS break; case TSK_MESSAGE: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/message.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/message.png"); //NON-NLS break; case TSK_CALLLOG: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/calllog.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/calllog.png"); //NON-NLS break; case TSK_CALENDAR_ENTRY: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/calendar.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/calendar.png"); //NON-NLS break; case TSK_SPEED_DIAL_ENTRY: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/speeddialentry.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/speeddialentry.png"); //NON-NLS break; case TSK_BLUETOOTH_PAIRING: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/bluetooth.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/bluetooth.png"); //NON-NLS break; case TSK_GPS_BOOKMARK: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gpsfav.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gpsfav.png"); //NON-NLS break; case TSK_GPS_LAST_KNOWN_LOCATION: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gps-lastlocation.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gps-lastlocation.png"); //NON-NLS break; case TSK_GPS_SEARCH: - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gps-search.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/gps-search.png"); //NON-NLS break; default: - logger.log(Level.WARNING, "useDataTypeIcon: unhandled artifact type = " + dataType); - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/star.png"); - iconFileName = "star.png"; + logger.log(Level.WARNING, "useDataTypeIcon: unhandled artifact type = " + dataType); //NON-NLS + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/star.png"); //NON-NLS + iconFileName = "star.png"; //NON-NLS iconFilePath = path + File.separator + iconFileName; break; } } else { // no defined artifact found for this dataType - logger.log(Level.WARNING, "useDataTypeIcon: no artifact found for data type = " + dataType); - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/star.png"); - iconFileName = "star.png"; + logger.log(Level.WARNING, "useDataTypeIcon: no artifact found for data type = " + dataType); //NON-NLS + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/star.png"); //NON-NLS + iconFileName = "star.png"; //NON-NLS iconFilePath = path + File.separator + iconFileName; } @@ -249,7 +249,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; in.close(); output.close(); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to extract images for HTML report.", ex); + logger.log(Level.SEVERE, "Failed to extract images for HTML report.", ex); //NON-NLS } finally { if (output != null) { try { @@ -277,13 +277,13 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; // Refresh the HTML report refresh(); // Setup the path for the HTML report - this.path = path + "HTML Report" + File.separator; - this.thumbsPath = this.path + "thumbs" + File.separator; + this.path = path + "HTML Report" + File.separator; //NON-NLS + this.thumbsPath = this.path + "thumbs" + File.separator; //NON-NLS try { FileUtil.createFolder(new File(this.path)); FileUtil.createFolder(new File(this.thumbsPath)); } catch (IOException ex) { - logger.log(Level.SEVERE, "Unable to make HTML report folder."); + logger.log(Level.SEVERE, "Unable to make HTML report folder."); //NON-NLS } // Write the basic files writeCss(); @@ -302,7 +302,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; try { out.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close the output writer when ending report.", ex); + logger.log(Level.WARNING, "Could not close the output writer when ending report.", ex); //NON-NLS } } } @@ -319,27 +319,27 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; public void startDataType(String name, String description) { String title = dataTypeToFileName(name); try { - out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + title + getExtension()), "UTF-8")); + out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + title + getExtension()), "UTF-8")); //NON-NLS } catch (FileNotFoundException ex) { - logger.log(Level.SEVERE, "File not found: {0}", ex); + logger.log(Level.SEVERE, "File not found: {0}", ex); //NON-NLS } catch (UnsupportedEncodingException ex) { - logger.log(Level.SEVERE, "Unrecognized encoding"); + logger.log(Level.SEVERE, "Unrecognized encoding"); //NON-NLS } try { StringBuilder page = new StringBuilder(); - page.append("\n\n\t").append(name).append("\n\t\n\n\n\n"); - page.append("
").append(name).append("
\n
\n"); + page.append("\n\n\t").append(name).append("\n\t\n\n\n\n"); //NON-NLS + page.append("
").append(name).append("
\n
\n"); //NON-NLS if (!description.isEmpty()) { - page.append("

"); + page.append("

"); //NON-NLS page.append(description); - page.append("

\n"); + page.append("

\n"); //NON-NLS } out.write(page.toString()); currentDataType = name; rowCount = 0; } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write page head: {0}", ex); + logger.log(Level.SEVERE, "Failed to write page head: {0}", ex); //NON-NLS } } @@ -351,7 +351,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; public void endDataType() { dataTypes.put(currentDataType, rowCount); try { - out.write("
\n\n\n"); + out.write("
\n\n\n"); //NON-NLS } catch (IOException ex) { Exceptions.printStackTrace(ex); } finally { @@ -360,7 +360,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; out.flush(); out.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close the output writer when ending data type.", ex); + logger.log(Level.WARNING, "Could not close the output writer when ending data type.", ex); //NON-NLS } out = null; } @@ -374,13 +374,13 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void startSet(String setName) { StringBuilder set = new StringBuilder(); - set.append("

").append(setName).append("

\n"); - set.append("
\n"); + set.append("

").append(setName).append("

\n"); //NON-NLS + set.append("
\n"); //NON-NLS try { out.write(set.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write set: {0}", ex); + logger.log(Level.SEVERE, "Failed to write set: {0}", ex); //NON-NLS } } @@ -390,9 +390,9 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void endSet() { try { - out.write("
\n"); + out.write("
\n"); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write end of set: {0}", ex); + logger.log(Level.SEVERE, "Failed to write end of set: {0}", ex); //NON-NLS } } @@ -403,15 +403,15 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void addSetIndex(List sets) { StringBuilder index = new StringBuilder(); - index.append("\n"); //NON-NLS try { out.write(index.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to add set index: {0}", ex); + logger.log(Level.SEVERE, "Failed to add set index: {0}", ex); //NON-NLS } } @@ -422,9 +422,9 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void addSetElement(String elementName) { try { - out.write("

" + elementName + "

\n"); + out.write("

" + elementName + "

\n"); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write set element: {0}", ex); + logger.log(Level.SEVERE, "Failed to write set element: {0}", ex); //NON-NLS } } @@ -435,16 +435,16 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void startTable(List titles) { StringBuilder ele = new StringBuilder(); - ele.append("\n\n\t\n"); + ele.append("
\n\n\t\n"); //NON-NLS for(String title : titles) { - ele.append("\t\t\n"); + ele.append("\t\t\n"); //NON-NLS } - ele.append("\t\n\n"); + ele.append("\t\n\n"); //NON-NLS try { out.write(ele.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write table start: {0}", ex); + logger.log(Level.SEVERE, "Failed to write table start: {0}", ex); //NON-NLS } } @@ -457,22 +457,22 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; */ public void startContentTagsTable(List columnHeaders) { StringBuilder htmlOutput = new StringBuilder(); - htmlOutput.append("
").append(title).append("").append(title).append("
\n\n\t\n"); + htmlOutput.append("
\n\n\t\n"); //NON-NLS // Add the specified columns. for(String columnHeader : columnHeaders) { - htmlOutput.append("\t\t\n"); + htmlOutput.append("\t\t\n"); //NON-NLS } // Add a column for a hyperlink to a local copy of the tagged content. - htmlOutput.append("\t\t\n"); + htmlOutput.append("\t\t\n"); //NON-NLS - htmlOutput.append("\t\n\n"); + htmlOutput.append("\t\n\n"); //NON-NLS try { out.write(htmlOutput.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write table start: {0}", ex); + logger.log(Level.SEVERE, "Failed to write table start: {0}", ex); //NON-NLS } } @@ -482,9 +482,9 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void endTable() { try { - out.write("
").append(columnHeader).append("").append(columnHeader).append("
\n"); + out.write("\n"); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write end of table: {0}", ex); + logger.log(Level.SEVERE, "Failed to write end of table: {0}", ex); //NON-NLS } } @@ -495,19 +495,19 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public void addRow(List row) { StringBuilder builder = new StringBuilder(); - builder.append("\t\n"); + builder.append("\t\n"); //NON-NLS for (String cell : row) { - builder.append("\t\t").append(cell).append("\n"); + builder.append("\t\t").append(cell).append("\n"); //NON-NLS } - builder.append("\t\n"); + builder.append("\t\n"); //NON-NLS rowCount++; try { out.write(builder.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write row to out.", ex); + logger.log(Level.SEVERE, "Failed to write row to out.", ex); //NON-NLS } catch (NullPointerException ex) { - logger.log(Level.SEVERE, "Output writer is null. Page was not initialized before writing.", ex); + logger.log(Level.SEVERE, "Output writer is null. Page was not initialized before writing.", ex); //NON-NLS } } @@ -541,27 +541,27 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; // Add the hyperlink to the row. A column header for it was created in startTable(). StringBuilder localFileLink = new StringBuilder(); - localFileLink.append("").append(NbBundle.getMessage(this.getClass(), "ReportHTML.link.viewFile")).append(""); + localFileLink.append("\">").append(NbBundle.getMessage(this.getClass(), "ReportHTML.link.viewFile")).append(""); //NON-NLS row.add(localFileLink.toString()); StringBuilder builder = new StringBuilder(); - builder.append("\t\n"); + builder.append("\t\n"); //NON-NLS for (String cell : row) { - builder.append("\t\t").append(cell).append("\n"); + builder.append("\t\t").append(cell).append("\n"); //NON-NLS } - builder.append("\t\n"); + builder.append("\t\n"); //NON-NLS rowCount++; try { out.write(builder.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write row to out.", ex); + logger.log(Level.SEVERE, "Failed to write row to out.", ex); //NON-NLS } catch (NullPointerException ex) { - logger.log(Level.SEVERE, "Output writer is null. Page was not initialized before writing.", ex); + logger.log(Level.SEVERE, "Output writer is null. Page was not initialized before writing.", ex); //NON-NLS } } @@ -608,7 +608,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; if (thumbnailPath == null) { continue; } - String contentPath = saveContent(file, "thumbs_fullsize"); + String contentPath = saveContent(file, "thumbs_fullsize"); //NON-NLS String nameInImage; try { nameInImage = file.getUniquePath(); @@ -617,12 +617,12 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; } StringBuilder linkToThumbnail = new StringBuilder(); - linkToThumbnail.append(""); - linkToThumbnail.append(""); - linkToThumbnail.append("
"); - linkToThumbnail.append(file.getName()).append("
"); + linkToThumbnail.append(""); //NON-NLS + linkToThumbnail.append("
"); //NON-NLS + linkToThumbnail.append(file.getName()).append("
"); //NON-NLS Services services = currentCase.getServices(); TagsManager tagsManager = services.getTagsManager(); @@ -639,7 +639,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; } } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Could not find get tags for file.", ex); + logger.log(Level.WARNING, "Could not find get tags for file.", ex); //NON-NLS } currentRow.add(linkToThumbnail.toString()); @@ -735,7 +735,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public String getFilePath() { - return "HTML Report" + File.separator + "index.html"; + return "HTML Report" + File.separator + "index.html"; //NON-NLS } @@ -752,7 +752,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; @Override public String getExtension() { - return ".html"; + return ".html"; //NON-NLS } /** @@ -761,30 +761,30 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; private void writeCss() { Writer cssOut = null; try { - cssOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "index.css"), "UTF-8")); - String css = "body {margin: 0px; padding: 0px; background: #FFFFFF; font: 13px/20px Arial, Helvetica, sans-serif; color: #535353;}\n" + - "#content {padding: 30px;}\n" + - "#header {width:100%; padding: 10px; line-height: 25px; background: #07A; color: #FFF; font-size: 20px;}\n" + - "h1 {font-size: 20px; font-weight: normal; color: #07A; padding: 0 0 7px 0; margin-top: 25px; border-bottom: 1px solid #D6D6D6;}\n" + - "h2 {font-size: 20px; font-weight: bolder; color: #07A;}\n" + - "h3 {font-size: 16px; color: #07A;}\n" + - "h4 {background: #07A; color: #FFF; font-size: 16px; margin: 0 0 0 25px; padding: 0; padding-left: 15px;}\n" + - "ul.nav {list-style-type: none; line-height: 35px; padding: 0px; margin-left: 15px;}\n" + - "ul li a {font-size: 14px; color: #444; text-decoration: none; padding-left: 25px;}\n" + - "ul li a:hover {text-decoration: underline;}\n" + - "p {margin: 0 0 20px 0;}\n" + - "table {max-width: 100%; min-width: 700px; padding: 0; margin: 0; border-collapse: collapse; border-bottom: 2px solid #e5e5e5;}\n" + - ".keyword_list table {width: 100%; margin: 0 0 25px 25px; border-bottom: 2px solid #dedede;}\n" + - "table th {display: table-cell; text-align: left; padding: 8px 16px; background: #e5e5e5; color: #777; font-size: 11px; text-shadow: #e9f9fd 0 1px 0; border-top: 1px solid #dedede; border-bottom: 2px solid #e5e5e5;}\n" + - "table td {display: table-cell; padding: 8px 16px; font: 13px/20px Arial, Helvetica, sans-serif; max-width: 500px; min-width: 125px; word-break: break-all; overflow: auto;}\n" + - "table tr:nth-child(even) td {background: #f3f3f3;}"; + cssOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "index.css"), "UTF-8")); //NON-NLS NON-NLS + String css = "body {margin: 0px; padding: 0px; background: #FFFFFF; font: 13px/20px Arial, Helvetica, sans-serif; color: #535353;}\n" + //NON-NLS + "#content {padding: 30px;}\n" + //NON-NLS + "#header {width:100%; padding: 10px; line-height: 25px; background: #07A; color: #FFF; font-size: 20px;}\n" + //NON-NLS + "h1 {font-size: 20px; font-weight: normal; color: #07A; padding: 0 0 7px 0; margin-top: 25px; border-bottom: 1px solid #D6D6D6;}\n" + //NON-NLS + "h2 {font-size: 20px; font-weight: bolder; color: #07A;}\n" + //NON-NLS + "h3 {font-size: 16px; color: #07A;}\n" + //NON-NLS + "h4 {background: #07A; color: #FFF; font-size: 16px; margin: 0 0 0 25px; padding: 0; padding-left: 15px;}\n" + //NON-NLS + "ul.nav {list-style-type: none; line-height: 35px; padding: 0px; margin-left: 15px;}\n" + //NON-NLS + "ul li a {font-size: 14px; color: #444; text-decoration: none; padding-left: 25px;}\n" + //NON-NLS + "ul li a:hover {text-decoration: underline;}\n" + //NON-NLS + "p {margin: 0 0 20px 0;}\n" + //NON-NLS + "table {max-width: 100%; min-width: 700px; padding: 0; margin: 0; border-collapse: collapse; border-bottom: 2px solid #e5e5e5;}\n" + //NON-NLS + ".keyword_list table {width: 100%; margin: 0 0 25px 25px; border-bottom: 2px solid #dedede;}\n" + //NON-NLS + "table th {display: table-cell; text-align: left; padding: 8px 16px; background: #e5e5e5; color: #777; font-size: 11px; text-shadow: #e9f9fd 0 1px 0; border-top: 1px solid #dedede; border-bottom: 2px solid #e5e5e5;}\n" + //NON-NLS + "table td {display: table-cell; padding: 8px 16px; font: 13px/20px Arial, Helvetica, sans-serif; max-width: 500px; min-width: 125px; word-break: break-all; overflow: auto;}\n" + //NON-NLS + "table tr:nth-child(even) td {background: #f3f3f3;}"; //NON-NLS cssOut.write(css); } catch (FileNotFoundException ex) { - logger.log(Level.SEVERE, "Could not find index.css file to write to.", ex); + logger.log(Level.SEVERE, "Could not find index.css file to write to.", ex); //NON-NLS } catch (UnsupportedEncodingException ex) { - logger.log(Level.SEVERE, "Did not recognize encoding when writing index.css.", ex); + logger.log(Level.SEVERE, "Did not recognize encoding when writing index.css.", ex); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Error creating Writer for index.css.", ex); + logger.log(Level.SEVERE, "Error creating Writer for index.css.", ex); //NON-NLS } finally { try { if(cssOut != null) { @@ -802,24 +802,24 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; private void writeIndex() { Writer indexOut = null; try { - indexOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "index.html"), "UTF-8")); + indexOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "index.html"), "UTF-8")); //NON-NLS StringBuilder index = new StringBuilder(); - index.append("\n").append( + index.append("<head>\n<title>").append( //NON-NLS NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.title", currentCase.getName())).append( - "\n"); - index.append("\n"); - index.append("\n"); - index.append("\n"); - index.append("\n"); - index.append("\n"); - index.append("").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.noFrames.msg")).append("<br />\n"); - index.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.noFrames.seeNav")).append("<br />\n"); - index.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.seeSum")).append("\n"); - index.append("\n"); - index.append(""); + "\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append("").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.noFrames.msg")).append("<br />\n"); //NON-NLS + index.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.noFrames.seeNav")).append("<br />\n"); //NON-NLS + index.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.seeSum")).append("\n"); //NON-NLS + index.append("\n"); //NON-NLS + index.append(""); //NON-NLS indexOut.write(index.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Error creating Writer for index.html: {0}", ex); + logger.log(Level.SEVERE, "Error creating Writer for index.html: {0}", ex); //NON-NLS } finally { try { if(indexOut != null) { @@ -837,38 +837,38 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; private void writeNav() { Writer navOut = null; try { - navOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "nav.html"), "UTF-8")); + navOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "nav.html"), "UTF-8")); //NON-NLS StringBuilder nav = new StringBuilder(); - nav.append("\n\n\t").append( + nav.append("<html>\n<head>\n\t<title>").append( //NON-NLS NbBundle.getMessage(this.getClass(), "ReportHTML.writeNav.title")) - .append("\n\t\n\n\n"); - nav.append("
\n

").append( - NbBundle.getMessage(this.getClass(), "ReportHTML.writeNav.h1")).append("

\n"); - nav.append("\n"); //NON-NLS + nav.append("
\n\n"); //NON-NLS navOut.write(nav.toString()); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write end of report navigation menu: {0}", ex); + logger.log(Level.SEVERE, "Failed to write end of report navigation menu: {0}", ex); //NON-NLS } finally { if (navOut != null) { try { navOut.flush(); navOut.close(); } catch (IOException ex) { - logger.log(Level.WARNING, "Could not close navigation out writer."); + logger.log(Level.WARNING, "Could not close navigation out writer."); //NON-NLS } } } @@ -882,23 +882,23 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; if (generatorLogoPath != null && ! generatorLogoPath.isEmpty()) { File from = new File(generatorLogoPath); File to = new File(path); - FileUtil.copyFile(FileUtil.toFileObject(from), FileUtil.toFileObject(to), "generator_logo"); + FileUtil.copyFile(FileUtil.toFileObject(from), FileUtil.toFileObject(to), "generator_logo"); //NON-NLS } String agencyLogoPath = reportBranding.getAgencyLogoPath(); if (agencyLogoPath != null && ! agencyLogoPath.isEmpty() ) { File from = new File(agencyLogoPath); File to = new File(path); - FileUtil.copyFile(FileUtil.toFileObject(from), FileUtil.toFileObject(to), "agency_logo"); + FileUtil.copyFile(FileUtil.toFileObject(from), FileUtil.toFileObject(to), "agency_logo"); //NON-NLS } - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/favicon.ico"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/favicon.ico"); //NON-NLS output = new FileOutputStream(new File(path + File.separator + "favicon.ico")); FileUtil.copy(in, output); in.close(); output.close(); - in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/summary.png"); + in = getClass().getResourceAsStream("/org/sleuthkit/autopsy/report/images/summary.png"); //NON-NLS output = new FileOutputStream(new File(path + File.separator + "summary.png")); FileUtil.copy(in, output); in.close(); @@ -906,7 +906,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to extract images for HTML report.", ex); + logger.log(Level.SEVERE, "Failed to extract images for HTML report.", ex); //NON-NLS } finally { if (output != null) { try { @@ -929,27 +929,27 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; private void writeSummary() { Writer out = null; try { - out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "summary.html"), "UTF-8")); + out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path + "summary.html"), "UTF-8")); //NON-NLS StringBuilder head = new StringBuilder(); - head.append("\n\n").append( - NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.title")).append("\n"); - head.append("\n"); - head.append("\n\n"); + head.append("\n\n").append( //NON-NLS + NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.title")).append("\n"); //NON-NLS + head.append("\n"); //NON-NLS + head.append("\n\n"); //NON-NLS out.write(head.toString()); DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); @@ -972,78 +972,78 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; final boolean agencyLogoSet = reportBranding.getAgencyLogoPath() != null && !reportBranding.getAgencyLogoPath().isEmpty(); final boolean generatorLogoSet = reportBranding.getGeneratorLogoPath() != null && !reportBranding.getGeneratorLogoPath().isEmpty(); - summary.append("
\n"); - summary.append("

").append(reportTitle) + summary.append("
\n"); //NON-NLS + summary.append("

").append(reportTitle) //NON-NLS .append(running ? NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.warningMsg") : "") - .append("

\n"); - summary.append("

").append( - NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.reportGenOn.text", datetime)).append("

\n"); - summary.append("
\n"); + .append("

\n"); //NON-NLS + summary.append("

").append( //NON-NLS + NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.reportGenOn.text", datetime)).append("

\n"); //NON-NLS + summary.append("
\n"); //NON-NLS if (agencyLogoSet) { - summary.append("
\n"); - summary.append("\n"); - summary.append("
\n"); + summary.append("
\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("
\n"); //NON-NLS } - final String align = agencyLogoSet?"right":"left"; - summary.append("
\n"); - summary.append("\n"); - summary.append("\n"); - summary.append("\n"); - summary.append("\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseName")) - .append("").append(caseName).append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseNum")) - .append("").append(!caseNumber.isEmpty() ? caseNumber : NbBundle - .getMessage(this.getClass(), "ReportHTML.writeSum.noCaseNum")).append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.examiner")).append("") + final String align = agencyLogoSet?"right":"left"; //NON-NLS NON-NLS + summary.append("
\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("\n"); //NON-NLS NON-NLS + summary.append("\n"); //NON-NLS + summary.append("\n"); - summary.append("\n"); - summary.append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseName")) //NON-NLS + .append("").append(caseName).append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.caseNum")) //NON-NLS + .append("").append(!caseNumber.isEmpty() ? caseNumber : NbBundle //NON-NLS + .getMessage(this.getClass(), "ReportHTML.writeSum.noCaseNum")).append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.examiner")).append("") //NON-NLS .append(!examiner.isEmpty() ? examiner : NbBundle .getMessage(this.getClass(), "ReportHTML.writeSum.noExaminer")) - .append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.numImages")) - .append("").append(imagecount).append("
\n"); - summary.append("
\n"); - summary.append("
\n"); - summary.append("\n"); + .append("
").append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.numImages")) //NON-NLS + .append("").append(imagecount).append("
\n"); //NON-NLS + summary.append("
\n"); //NON-NLS + summary.append("
\n"); //NON-NLS + summary.append("
\n"); //NON-NLS summary.append(NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.imageInfoHeading")); - summary.append("
\n"); + summary.append("
\n"); //NON-NLS try { Image[] images = new Image[imagecount]; for(int i=0; i").append(img.getName()).append("

\n"); - summary.append("\n"); - summary.append("
").append( + summary.append("

").append(img.getName()).append("

\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("\n"); + .append("\n"); //NON-NLS for(String imgPath : img.getPaths()) { - summary.append("\n"); + .append("\n"); //NON-NLS } - summary.append("
").append( //NON-NLS NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.timezone")) - .append("").append(img.getTimeZone()).append("
").append(img.getTimeZone()).append("
").append( + summary.append("
").append( //NON-NLS NbBundle.getMessage(this.getClass(), "ReportHTML.writeSum.path")) - .append("").append(imgPath).append("
").append(imgPath).append("
\n"); + summary.append("
\n"); //NON-NLS } } catch (TskCoreException ex) { - logger.log(Level.WARNING, "Unable to get image information for the HTML report."); + logger.log(Level.WARNING, "Unable to get image information for the HTML report."); //NON-NLS } - summary.append("
\n"); + summary.append("
\n"); //NON-NLS if (generatorLogoSet) { - summary.append("
\n"); - summary.append("\n"); - summary.append("
\n"); + summary.append("
\n"); //NON-NLS + summary.append("\n"); //NON-NLS + summary.append("
\n"); //NON-NLS } - summary.append("
\n"); + summary.append("
\n"); //NON-NLS if (reportFooter != null) { - summary.append("

").append(reportFooter).append("

\n"); + summary.append("

").append(reportFooter).append("

\n"); //NON-NLS } - summary.append("
\n"); - summary.append(""); + summary.append("\n"); //NON-NLS + summary.append(""); //NON-NLS out.write(summary.toString()); } catch (FileNotFoundException ex) { - logger.log(Level.SEVERE, "Could not find summary.html file to write to."); + logger.log(Level.SEVERE, "Could not find summary.html file to write to."); //NON-NLS } catch (UnsupportedEncodingException ex) { - logger.log(Level.SEVERE, "Did not recognize encoding when writing summary.hmtl."); + logger.log(Level.SEVERE, "Did not recognize encoding when writing summary.hmtl."); //NON-NLS } catch (IOException ex) { - logger.log(Level.SEVERE, "Error creating Writer for summary.html."); + logger.log(Level.SEVERE, "Error creating Writer for summary.html."); //NON-NLS } finally { try { if(out != null) { @@ -1066,7 +1066,7 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM; FileObject dest = FileUtil.toFileObject(to); FileUtil.copyFile(from, dest, thumbFile.getName(), ""); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write thumb file to report directory.", ex); + logger.log(Level.SEVERE, "Failed to write thumb file to report directory.", ex); //NON-NLS } return THUMBS_REL_PATH + thumbFile.getName(); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java index 05cbb3b6a7..b466d9bd0d 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java @@ -80,8 +80,8 @@ class ReportKML implements GeneralReportModule { progressPanel.setIndeterminate(false); progressPanel.start(); progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), "ReportKML.progress.querying")); - reportPath = path + "ReportKML.kml"; - String reportPath2 = path + "ReportKML.txt"; + reportPath = path + "ReportKML.kml"; //NON-NLS + String reportPath2 = path + "ReportKML.txt"; //NON-NLS currentCase = Case.getCurrentCase(); skCase = currentCase.getSleuthkitCase(); @@ -151,18 +151,18 @@ class ReportKML implements GeneralReportModule { /* * Step 1: generate XML stub */ - Namespace ns = Namespace.getNamespace("", "http://earth.google.com/kml/2.2"); + Namespace ns = Namespace.getNamespace("", "http://earth.google.com/kml/2.2"); //NON-NLS // kml - Element kml = new Element("kml", ns); + Element kml = new Element("kml", ns); //NON-NLS Document kmlDocument = new Document(kml); // Document - Element document = new Element("Document", ns); + Element document = new Element("Document", ns); //NON-NLS kml.addContent(document); // name - Element name = new Element("name", ns); - name.setText("Java Generated KML Document"); + Element name = new Element("name", ns); //NON-NLS + name.setText("Java Generated KML Document"); //NON-NLS document.addContent(name); /* @@ -170,26 +170,26 @@ class ReportKML implements GeneralReportModule { */ // Style - Element style = new Element("Style", ns); - style.setAttribute("id", "redIcon"); + Element style = new Element("Style", ns); //NON-NLS + style.setAttribute("id", "redIcon"); //NON-NLS document.addContent(style); // IconStyle - Element iconStyle = new Element("IconStyle", ns); + Element iconStyle = new Element("IconStyle", ns); //NON-NLS style.addContent(iconStyle); // color - Element color = new Element("color", ns); - color.setText("990000ff"); + Element color = new Element("color", ns); //NON-NLS + color.setText("990000ff"); //NON-NLS iconStyle.addContent(color); // Icon - Element icon = new Element("Icon", ns); + Element icon = new Element("Icon", ns); //NON-NLS iconStyle.addContent(icon); // href - Element href = new Element("href", ns); - href.setText("http://www.cs.mun.ca/~hoeber/teaching/cs4767/notes/02.1-kml/circle.png"); + Element href = new Element("href", ns); //NON-NLS + href.setText("http://www.cs.mun.ca/~hoeber/teaching/cs4767/notes/02.1-kml/circle.png"); //NON-NLS icon.addContent(href); progressPanel.increment(); /* @@ -208,37 +208,37 @@ class ReportKML implements GeneralReportModule { if (lineParts.length == 4) { String coordinates = lineParts[1].trim() + "," + lineParts[0].trim(); //lat,lon // Placemark - Element placemark = new Element("Placemark", ns); + Element placemark = new Element("Placemark", ns); //NON-NLS document.addContent(placemark); // name - Element pmName = new Element("name", ns); + Element pmName = new Element("name", ns); //NON-NLS pmName.setText(lineParts[3].trim()); placemark.addContent(pmName); // Path - Element pmPath = new Element("Path", ns); + Element pmPath = new Element("Path", ns); //NON-NLS pmPath.setText(lineParts[2].trim()); placemark.addContent(pmPath); // description - Element pmDescription = new Element("description", ns); - String xml = "

" + shortenPath(reportPath) + ""); + pathLabel.setText("" + shortenPath(reportPath) + ""); //NON-NLS pathLabel.setToolTipText(reportPath); // Add the "link" effect to the pathLabel @@ -137,7 +137,7 @@ public class ReportProgressPanel extends javax.swing.JPanel { EventQueue.invokeLater(new Runnable() { @Override public void run() { - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); //NON-NLS cancelButton.setToolTipText( NbBundle.getMessage(this.getClass(), "ReportProgressPanel.start.cancelButton.text")); processingLabel.setText(NbBundle.getMessage(this.getClass(), "ReportProgressPanel.start.progress.text")); @@ -241,7 +241,7 @@ public class ReportProgressPanel extends javax.swing.JPanel { processingLabel.setText( NbBundle.getMessage(this.getClass(), "ReportProgressPanel.complete.processLbl.text")); reportProgressBar.setValue(reportProgressBar.getMaximum()); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_complete.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_complete.png"))); //NON-NLS cancelButton.setToolTipText( NbBundle.getMessage(this.getClass(), "ReportProgressPanel.complete.cancelButton.text")); } @@ -268,7 +268,7 @@ public class ReportProgressPanel extends javax.swing.JPanel { setMinimumSize(new java.awt.Dimension(486, 68)); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); // NOI18N + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.cancelButton.text")); // NOI18N cancelButton.setToolTipText(org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.cancelButton.toolTipText")); // NOI18N cancelButton.setBorder(null); @@ -289,12 +289,12 @@ public class ReportProgressPanel extends javax.swing.JPanel { } }); - reportLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + reportLabel.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(reportLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.reportLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(pathLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.pathLabel.text")); // NOI18N - processingLabel.setFont(new java.awt.Font("Tahoma", 2, 10)); // NOI18N + processingLabel.setFont(new java.awt.Font("Tahoma", 2, 10)); // NOI18N NON-NLS org.openide.awt.Mnemonics.setLocalizedText(processingLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.processingLabel.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(separationLabel, org.openide.util.NbBundle.getMessage(ReportProgressPanel.class, "ReportProgressPanel.separationLabel.text")); // NOI18N @@ -374,7 +374,7 @@ public class ReportProgressPanel extends javax.swing.JPanel { break; default: setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel_hover.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel_hover.png"))); //NON-NLS break; } }//GEN-LAST:event_cancelButtonMouseEntered @@ -387,11 +387,11 @@ public class ReportProgressPanel extends javax.swing.JPanel { break; case QUEUING: setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_loading.png"))); //NON-NLS break; case RUNNING: setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); + cancelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/report/images/report_cancel.png"))); //NON-NLS break; } }//GEN-LAST:event_cancelButtonMouseExited diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java index 587dd1ff27..bf7524e408 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportVisualPanel2.java @@ -76,7 +76,7 @@ final class ReportVisualPanel2 extends JPanel { try { tagNamesInUse = Case.getCurrentCase().getServices().getTagsManager().getTagNamesInUse(); } catch (TskCoreException ex) { - Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); + Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS return; } @@ -123,7 +123,7 @@ final class ReportVisualPanel2 extends JPanel { artifactStates.put(type, Boolean.TRUE); } } catch (TskCoreException ex) { - Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage(), ex); + Logger.getLogger(ReportVisualPanel2.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage(), ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java index af9aeea288..fcabfca3f2 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java @@ -71,11 +71,11 @@ public final class ReportWizardAction extends CallableSystemAction implements P wiz.setTitle(NbBundle.getMessage(ReportWizardAction.class, "ReportWizardAction.reportWiz.title")); if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) { @SuppressWarnings("unchecked") - ReportGenerator generator = new ReportGenerator((Map)wiz.getProperty("tableModuleStates"), - (Map)wiz.getProperty("generalModuleStates"), - (Map)wiz.getProperty("fileModuleStates")); - generator.generateTableReports((Map)wiz.getProperty("artifactStates"), (Map)wiz.getProperty("tagStates")); - generator.generateFileListReports((Map)wiz.getProperty("fileReportOptions")); + ReportGenerator generator = new ReportGenerator((Map)wiz.getProperty("tableModuleStates"), //NON-NLS + (Map)wiz.getProperty("generalModuleStates"), //NON-NLS + (Map)wiz.getProperty("fileModuleStates")); //NON-NLS + generator.generateTableReports((Map)wiz.getProperty("artifactStates"), (Map)wiz.getProperty("tagStates")); //NON-NLS + generator.generateFileListReports((Map)wiz.getProperty("fileReportOptions")); //NON-NLS generator.generateGeneralReports(); generator.displayProgressPanels(); } @@ -96,7 +96,7 @@ public final class ReportWizardAction extends CallableSystemAction implements P if (!exists) { boolean reportCreate = (new File(newCase.getCaseDirectory() + File.separator + "Reports")).mkdirs(); if (!reportCreate) { - logger.log(Level.WARNING, "Could not create Reports directory for case. It does not exist."); + logger.log(Level.WARNING, "Could not create Reports directory for case. It does not exist."); //NON-NLS } } } @@ -140,7 +140,7 @@ public final class ReportWizardAction extends CallableSystemAction implements P */ @Override public Component getToolbarPresenter() { - ImageIcon icon = new ImageIcon(getClass().getResource("images/btn_icon_generate_report.png")); + ImageIcon icon = new ImageIcon(getClass().getResource("images/btn_icon_generate_report.png")); //NON-NLS toolbarButton.setIcon(icon); toolbarButton.setText(NbBundle.getMessage(this.getClass(), "ReportWizardAction.toolBarButton.text")); return toolbarButton; diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java index ffa7b56796..b428e3cad2 100755 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardFileOptionsPanel.java @@ -79,7 +79,7 @@ import org.openide.util.NbBundle; @Override public void storeSettings(WizardDescriptor data) { - data.putProperty("fileReportOptions", getComponent().getFileReportOptions()); + data.putProperty("fileReportOptions", getComponent().getFileReportOptions()); //NON-NLS } @Override diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java index 29df382148..830e7bccef 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardIterator.java @@ -134,8 +134,8 @@ import org.openide.util.NbPreferences; // Update path through configuration panels boolean generalModule, tableModule; // These preferences are set in ReportWizardPanel1.storeSettings() - generalModule = NbPreferences.forModule(ReportWizardPanel1.class).getBoolean("generalModule", true); - tableModule = NbPreferences.forModule(ReportWizardPanel1.class).getBoolean("tableModule", true); + generalModule = NbPreferences.forModule(ReportWizardPanel1.class).getBoolean("generalModule", true); //NON-NLS + tableModule = NbPreferences.forModule(ReportWizardPanel1.class).getBoolean("tableModule", true); //NON-NLS enableConfigPanels(generalModule, tableModule); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java index abac0b9969..1f961e6fe8 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel1.java @@ -109,15 +109,15 @@ import org.openide.util.NbPreferences; public void storeSettings(WizardDescriptor wiz) { Map tables = getComponent().getTableModuleStates(); Map generals = getComponent().getGeneralModuleStates(); - wiz.putProperty("tableModuleStates", tables); - wiz.putProperty("generalModuleStates", generals); - wiz.putProperty("fileModuleStates", getComponent().getFileModuleStates()); + wiz.putProperty("tableModuleStates", tables); //NON-NLS + wiz.putProperty("generalModuleStates", generals); //NON-NLS + wiz.putProperty("fileModuleStates", getComponent().getFileModuleStates()); //NON-NLS // Store preferences that WizardIterator will use to determine what // panels need to be shown Preferences prefs = NbPreferences.forModule(ReportWizardPanel1.class); - prefs.putBoolean("tableModule", any(tables.values())); - prefs.putBoolean("generalModule", any(generals.values())); + prefs.putBoolean("tableModule", any(tables.values())); //NON-NLS + prefs.putBoolean("generalModule", any(generals.values())); //NON-NLS } /** diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java index 767b9266bd..4cf694cd0c 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardPanel2.java @@ -95,8 +95,8 @@ import org.openide.util.NbPreferences; @Override public void storeSettings(WizardDescriptor wiz) { - wiz.putProperty("tagStates", getComponent().getTagStates()); - wiz.putProperty("artifactStates", getComponent().getArtifactStates()); - wiz.putProperty("isTagsSelected", getComponent().isTaggedResultsRadioButtonSelected()); + wiz.putProperty("tagStates", getComponent().getTagStates()); //NON-NLS + wiz.putProperty("artifactStates", getComponent().getArtifactStates()); //NON-NLS + wiz.putProperty("isTagsSelected", getComponent().isTaggedResultsRadioButtonSelected()); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/Timeline.java b/Core/src/org/sleuthkit/autopsy/timeline/Timeline.java index 74bde34f56..4607f809c5 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/Timeline.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/Timeline.java @@ -117,7 +117,7 @@ import org.sleuthkit.datamodel.TskCoreException; public class Timeline extends CallableSystemAction implements Presenter.Toolbar, PropertyChangeListener { private static final Logger logger = Logger.getLogger(Timeline.class.getName()); - private final java.io.File macRoot = InstalledFileLocator.getDefault().locate("mactime", Timeline.class.getPackage().getName(), false); + private final java.io.File macRoot = InstalledFileLocator.getDefault().locate("mactime", Timeline.class.getPackage().getName(), false); //NON-NLS private TimelineFrame mainFrame; //frame for holding all the elements private Group fxGroupCharts; //Orders the charts private Scene fxSceneCharts; //Displays the charts @@ -198,7 +198,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, dataResultPanel.setContentViewer(dataContentPanel); //dataResultPanel.setAlignmentX(Component.LEFT_ALIGNMENT); //dataResultPanel.setPreferredSize(new Dimension((int)(FRAME_WIDTH * 0.5), (int) (FRAME_HEIGHT * 0.5))); - logger.log(Level.INFO, "Successfully created viewers"); + logger.log(Level.INFO, "Successfully created viewers"); //NON-NLS mainFrame.setBottomLeftPanel(dataResultPanel); mainFrame.setBottomRightPanel(dataContentPanel); @@ -247,12 +247,12 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, java.io.File mactimeFile = new java.io.File(moduleDir, mactimeFileName); if (!mactimeFile.exists()) { progressDialog.setProgressTotal(3); //total 3 units - logger.log(Level.INFO, "Creating body file"); + logger.log(Level.INFO, "Creating body file"); //NON-NLS progressDialog.updateProgressBar( NbBundle.getMessage(this.getClass(), "Timeline.runJavaFxThread.progress.genBodyFile")); String bodyFilePath = makeBodyFile(); progressDialog.updateProgressBar(++currentProgress); - logger.log(Level.INFO, "Creating mactime file: " + mactimeFile.getAbsolutePath()); + logger.log(Level.INFO, "Creating mactime file: " + mactimeFile.getAbsolutePath()); //NON-NLS progressDialog.updateProgressBar( NbBundle.getMessage(this.getClass(), "Timeline.runJavaFxThread.progress.genMacTime")); makeMacTime(bodyFilePath); @@ -260,14 +260,14 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, data = null; } else { progressDialog.setProgressTotal(1); //total 1 units - logger.log(Level.INFO, "Mactime file already exists; parsing that: " + mactimeFile.getAbsolutePath()); + logger.log(Level.INFO, "Mactime file already exists; parsing that: " + mactimeFile.getAbsolutePath()); //NON-NLS } progressDialog.updateProgressBar( NbBundle.getMessage(this.getClass(), "Timeline.runJavaFxThread.progress.parseMacTime")); if (data == null) { - logger.log(Level.INFO, "Parsing mactime file: " + mactimeFile.getAbsolutePath()); + logger.log(Level.INFO, "Parsing mactime file: " + mactimeFile.getAbsolutePath()); //NON-NLS data = parseMacTime(mactimeFile); //The sum total of the mactime parsing. YearEpochs contain everything you need to make a timeline. } progressDialog.updateProgressBar(++currentProgress); @@ -357,7 +357,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, final CategoryAxis xAxis = new CategoryAxis(); //Axes are very specific types. Categorys are strings. final NumberAxis yAxis = new NumberAxis(); final Label l = new Label(""); - l.setStyle("-fx-font: 24 arial;"); + l.setStyle("-fx-font: 24 arial;"); //NON-NLS l.setTextFill(Color.AZURE); xAxis.setLabel(NbBundle.getMessage(this.getClass(), "Timeline.yearBarChart.x.years")); yAxis.setLabel(NbBundle.getMessage(this.getClass(), "Timeline.yearBarChart.y.numEvents")); @@ -532,7 +532,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, if (de != null) { afs = de.getEvents(); } else { - logger.log(Level.SEVERE, "There were no events for the clicked-on day: " + day); + logger.log(Level.SEVERE, "There were no events for the clicked-on day: " + day); //NON-NLS return; } @@ -592,7 +592,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, cal.setTime(date); return cal.get(Calendar.MONTH); } catch (ParseException ex) { - logger.log(Level.WARNING, "Unable to convert string " + mon + " to integer", ex); + logger.log(Level.WARNING, "Unable to convert string " + mon + " to integer", ex); //NON-NLS return -1; } } @@ -886,7 +886,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, try { af = skCase.getAbstractFileById(fileId); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error getting file by id and creating a node in Timeline: " + fileId, ex); + logger.log(Level.SEVERE, "Error getting file by id and creating a node in Timeline: " + fileId, ex); //NON-NLS //no node will be shown for this object return null; } @@ -932,7 +932,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, try { scan = new Scanner(new FileInputStream(f)); } catch (FileNotFoundException ex) { - logger.log(Level.SEVERE, "Error: could not find mactime file.", ex); + logger.log(Level.SEVERE, "Error: could not find mactime file.", ex); //NON-NLS return years; } scan.useDelimiter(","); @@ -945,7 +945,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, String[] s = scan.nextLine().split(","); //1999-02-08T11:08:08Z, 78706, m..b, rrwxrwxrwx, 0, 0, 8355, /img... // break the date into year,month,day,hour,minute, and second: Note that the ISO times are in GMT - String delims = "[T:Z\\-]+"; //split by the delimiters + String delims = "[T:Z\\-]+"; //split by the delimiters NON-NLS String[] date = s[0].split(delims); //{1999,02,08,11,08,08,...} int year = Integer.valueOf(date[0]); @@ -1004,15 +1004,15 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, // Get report path String bodyFilePath = moduleDir.getAbsolutePath() - + java.io.File.separator + currentCase.getName() + "-" + datenotime + ".txt"; + + java.io.File.separator + currentCase.getName() + "-" + datenotime + ".txt"; //NON-NLS // Run query to get all files - final String filesAndDirs = "name != '.' " - + "AND name != '..'"; + final String filesAndDirs = "name != '.' " //NON-NLS + + "AND name != '..'"; //NON-NLS List fileIds = null; try { fileIds = skCase.findAllFileIdsWhere(filesAndDirs); } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error querying image files to make a body file: " + bodyFilePath, ex); + logger.log(Level.SEVERE, "Error querying image files to make a body file: " + bodyFilePath, ex); //NON-NLS return null; } @@ -1021,7 +1021,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, try { fileWriter = new FileWriter(bodyFilePath, true); } catch (IOException ex) { - logger.log(Level.SEVERE, "Error creating output stream to write body file to: " + bodyFilePath, ex); + logger.log(Level.SEVERE, "Error creating output stream to write body file to: " + bodyFilePath, ex); //NON-NLS return null; } @@ -1040,7 +1040,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, try { path = file.getUniquePath(); } catch (TskCoreException e) { - logger.log(Level.SEVERE, "Failed to get the unique path of: " + file + " and writing body file.", e); + logger.log(Level.SEVERE, "Failed to get the unique path of: " + file + " and writing body file.", e); //NON-NLS return null; } @@ -1070,11 +1070,11 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, out.write("\n"); } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error querying file by id", ex); + logger.log(Level.SEVERE, "Error querying file by id", ex); //NON-NLS return null; } catch (IOException ex) { - logger.log(Level.WARNING, "Error while trying to write data to the body file.", ex); + logger.log(Level.WARNING, "Error while trying to write data to the body file.", ex); //NON-NLS return null; } finally { if (out != null) { @@ -1082,7 +1082,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, out.flush(); out.close(); } catch (IOException ex1) { - logger.log(Level.WARNING, "Could not flush and/or close body file.", ex1); + logger.log(Level.WARNING, "Could not flush and/or close body file.", ex1); //NON-NLS } } } @@ -1103,13 +1103,13 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, final String machome = macRoot.getAbsolutePath(); pathToBodyFile = PlatformUtil.getOSFilePath(pathToBodyFile); if (PlatformUtil.isWindowsOS()) { - macpath = machome + java.io.File.separator + "mactime.exe"; + macpath = machome + java.io.File.separator + "mactime.exe"; //NON-NLS cmdpath = PlatformUtil.getOSFilePath(macpath); - mactimeArgs = new String[]{"-b", pathToBodyFile, "-d", "-y"}; + mactimeArgs = new String[]{"-b", pathToBodyFile, "-d", "-y"}; //NON-NLS } else { - cmdpath = "perl"; - macpath = machome + java.io.File.separator + "mactime.pl"; - mactimeArgs = new String[]{macpath, "-b", pathToBodyFile, "-d", "-y"}; + cmdpath = "perl"; //NON-NLS + macpath = machome + java.io.File.separator + "mactime.pl"; //NON-NLS + mactimeArgs = new String[]{macpath, "-b", pathToBodyFile, "-d", "-y"}; //NON-NLS } String macfile = moduleDir.getAbsolutePath() + java.io.File.separator + mactimeFileName; @@ -1123,17 +1123,17 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, writer = new FileWriter(macfile); execUtil.execute(writer, cmdpath, mactimeArgs); } catch (InterruptedException ie) { - logger.log(Level.WARNING, "Mactime process was interrupted by user", ie); + logger.log(Level.WARNING, "Mactime process was interrupted by user", ie); //NON-NLS return null; } catch (IOException ioe) { - logger.log(Level.SEVERE, "Could not create mactime file, encountered error ", ioe); + logger.log(Level.SEVERE, "Could not create mactime file, encountered error ", ioe); //NON-NLS return null; } finally { if (writer != null) { try { writer.close(); } catch (IOException ex) { - logger.log(Level.SEVERE, "Could not clsoe writer after creating mactime file, encountered error ", ex); + logger.log(Level.SEVERE, "Could not clsoe writer after creating mactime file, encountered error ", ex); //NON-NLS } } } @@ -1161,7 +1161,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, try { if (currentCase.getRootObjectsCount() == 0) { - logger.log(Level.INFO, "Error creating timeline, there are no data sources. "); + logger.log(Level.INFO, "Error creating timeline, there are no data sources. "); //NON-NLS } else { if (IngestManager.getInstance().isIngestRunning()) { @@ -1176,7 +1176,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, } } - logger.log(Level.INFO, "Beginning generation of timeline"); + logger.log(Level.INFO, "Beginning generation of timeline"); //NON-NLS // if the timeline window is already open, bring to front and do nothing if (mainFrame != null && mainFrame.isVisible()) { @@ -1200,7 +1200,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, }); // initialize mactimeFileName - mactimeFileName = currentCase.getName() + "-MACTIME.txt"; + mactimeFileName = currentCase.getName() + "-MACTIME.txt"; //NON-NLS // see if barData has been added to the database since the last // time timeline ran @@ -1213,9 +1213,9 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, customize(); } } catch (TskCoreException ex) { - logger.log(Level.SEVERE, "Error when generating timeline, ", ex); + logger.log(Level.SEVERE, "Error when generating timeline, ", ex); //NON-NLS } catch (Exception ex) { - logger.log(Level.SEVERE, "Unexpected error when generating timeline, ", ex); + logger.log(Level.SEVERE, "Unexpected error when generating timeline, ", ex); //NON-NLS } } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/TimelineFrame.java b/Core/src/org/sleuthkit/autopsy/timeline/TimelineFrame.java index 57e754a50c..76256770d4 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/TimelineFrame.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/TimelineFrame.java @@ -136,7 +136,7 @@ import java.awt.Image; */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(info.getName())) { + if ("Nimbus".equals(info.getName())) { //NON-NLS javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } diff --git a/Core/src/org/sleuthkit/autopsy/timeline/TimelineProgressDialog.java b/Core/src/org/sleuthkit/autopsy/timeline/TimelineProgressDialog.java index 5b83b1b8c9..3b4844d415 100644 --- a/Core/src/org/sleuthkit/autopsy/timeline/TimelineProgressDialog.java +++ b/Core/src/org/sleuthkit/autopsy/timeline/TimelineProgressDialog.java @@ -60,7 +60,7 @@ import org.openide.windows.WindowManager; setName(NbBundle.getMessage(this.getClass(), "TimelineProgressDialog.setName.text")); // Close the dialog when Esc is pressed - String cancelName = "cancel"; + String cancelName = "cancel"; //NON-NLS InputMap inputMap = getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), cancelName); ActionMap actionMap = getRootPane().getActionMap(); diff --git a/CoreLibs/src/org/sleuthkit/autopsy/corelibs/SigarLoader.java b/CoreLibs/src/org/sleuthkit/autopsy/corelibs/SigarLoader.java index 8c2878bf16..12a135c6e1 100644 --- a/CoreLibs/src/org/sleuthkit/autopsy/corelibs/SigarLoader.java +++ b/CoreLibs/src/org/sleuthkit/autopsy/corelibs/SigarLoader.java @@ -44,9 +44,9 @@ public class SigarLoader { try { //rely on netbeans / jna to locate the lib variation for architecture/OS if (PlatformUtil.isWindows()) { - System.loadLibrary("libsigar"); + System.loadLibrary("libsigar"); //NON-NLS } else { - System.loadLibrary("sigar"); + System.loadLibrary("sigar"); //NON-NLS } sigar = new Sigar(); sigar.enableLogging(false); //forces a test diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDatabaseOptionsPanelController.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDatabaseOptionsPanelController.java index 2fcc7ad52d..b8b2a78f88 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDatabaseOptionsPanelController.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDatabaseOptionsPanelController.java @@ -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"), diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbCreateDatabaseDialog.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbCreateDatabaseDialog.java index da11fc8a97..8222371c7a 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbCreateDatabaseDialog.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbCreateDatabaseDialog.java @@ -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 diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbImportDatabaseDialog.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbImportDatabaseDialog.java index 67c95b0e67..2a058c7e25 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbImportDatabaseDialog.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbImportDatabaseDialog.java @@ -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")); diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java index d32d3d073c..1eabb5948b 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java @@ -119,7 +119,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 } } } @@ -148,7 +148,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges getTotalsForIngestJobs(jobId).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(), @@ -175,7 +175,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(), @@ -208,7 +208,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges getTotalsForIngestJobs(jobId).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(), @@ -233,7 +233,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; } } @@ -241,7 +241,7 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges getTotalsForIngestJobs(jobId).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(), @@ -275,32 +275,32 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges if (showInboxMessage) { StringBuilder detailsSb = new StringBuilder(); //details - detailsSb.append(""); + detailsSb.append("
"); //NON-NLS //hit - detailsSb.append(""); - detailsSb.append(""); //NON-NLS + detailsSb.append(""); - detailsSb.append(""); - detailsSb.append(""); + .append(""); //NON-NLS + detailsSb.append(""); //NON-NLS - detailsSb.append(""); - detailsSb.append(""); //NON-NLS + detailsSb.append(""); - detailsSb.append(""); - detailsSb.append(""); + .append(""); //NON-NLS + detailsSb.append(""); //NON-NLS + detailsSb.append(""); //NON-NLS - detailsSb.append(""); - detailsSb.append(""); //NON-NLS + detailsSb.append(""); - detailsSb.append(""); - detailsSb.append(""); + .append(""); //NON-NLS + detailsSb.append(""); //NON-NLS + detailsSb.append(""); //NON-NLS - detailsSb.append("
") + detailsSb.append("
") //NON-NLS .append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.postToBB.fileName")) - .append("") + .append(""); //NON-NLS + detailsSb.append("") //NON-NLS .append(abstractFile.getName()) - .append("
") + detailsSb.append("
") //NON-NLS .append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.postToBB.md5Hash")) - .append("").append(md5Hash).append("
").append(md5Hash).append("
") + detailsSb.append("
") //NON-NLS .append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.postToBB.hashsetName")) - .append("").append(hashSetName).append("
").append(hashSetName).append("
"); + detailsSb.append(""); //NON-NLS services.postMessage(IngestMessage.createDataMessage( HashLookupModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), @@ -312,7 +312,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 } } @@ -322,29 +322,30 @@ public class HashDbIngestModule extends IngestModuleAdapter implements FileInges if ((!knownBadHashSets.isEmpty()) || (!knownHashSets.isEmpty())) { StringBuilder detailsSb = new StringBuilder(); //details - detailsSb.append(""); + detailsSb.append("
"); //NON-NLS - detailsSb.append(""); - detailsSb.append(""); + .append(""); //NON-NLS + detailsSb.append(""); //NON-NLS - detailsSb.append("\n"); - detailsSb.append("\n"); //NON-NLS + detailsSb.append("\n"); - detailsSb.append("
") + detailsSb.append("
") //NON-NLS .append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.complete.knownBadsFound")) - .append("").append(jobTotals.totalKnownBadCount.get()).append("
").append(jobTotals.totalKnownBadCount.get()).append("
") + detailsSb.append("
") //NON-NLS .append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.complete.totalCalcTime")) - .append("").append(jobTotals.totalCalctime.get()).append("
") + .append("").append(jobTotals.totalCalctime.get()).append("
") //NON-NLS .append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.complete.totalLookupTime")) - .append("").append(jobTotals.totalLookuptime.get()).append("
"); + .append("").append(jobTotals.totalLookuptime.get()).append("\n"); //NON-NLS + detailsSb.append(""); //NON-NLS - detailsSb.append("

") + detailsSb.append("

") //NON-NLS .append(NbBundle.getMessage(this.getClass(), "HashDbIngestModule.complete.databasesUsed")) - .append("

\n
    "); + .append("

    \n
      "); //NON-NLS for (HashDb db : knownBadHashSets) { - detailsSb.append("
    • ").append(db.getHashSetName()).append("
    • \n"); + detailsSb.append("
    • ").append(db.getHashSetName()).append("
    • \n"); //NON-NLS } - detailsSb.append("
    "); + detailsSb.append("
"); //NON-NLS + services.postMessage(IngestMessage.createMessage( IngestMessage.MessageType.INFO, HashLookupModuleFactory.getModuleName(), diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManager.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManager.java index 514b99b0ca..32304d47b7 100755 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManager.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManager.java @@ -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 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"), diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchThread.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchThread.java index 2add51a845..e84bd2bb61 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchThread.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchThread.java @@ -50,7 +50,7 @@ class HashDbSearchThread extends SwingWorker { @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 { // 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 { 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 { 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 } } } diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupModuleSettingsPanel.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupModuleSettingsPanel.java index 6d83818961..cc0bcb530e 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupModuleSettingsPanel.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupModuleSettingsPanel.java @@ -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; } diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupSettingsPanel.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupSettingsPanel.java index 055a242cc3..7e901fbc71 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupSettingsPanel.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashLookupSettingsPanel.java @@ -150,14 +150,14 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan 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 IngestModuleGlobalSettingsPan 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 IngestModuleGlobalSettingsPan 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 IngestModuleGlobalSettingsPan 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 IngestModuleGlobalSettingsPan 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 IngestModuleGlobalSettingsPan }); 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 IngestModuleGlobalSettingsPan } }); - 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 IngestModuleGlobalSettingsPan 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)); diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/ModalNoButtons.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/ModalNoButtons.java index d2b2cda389..12fa4bb36f 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/ModalNoButtons.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/ModalNoButtons.java @@ -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 diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java index 5b3baa041f..07cda49234 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java @@ -60,6 +60,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.datamodel.Content; import org.apache.solr.common.SolrInputDocument; import org.apache.solr.client.solrj.impl.XMLResponseParser; +import org.apache.solr.common.SolrException; /** * Handles for keeping track of a Solr server and its cores @@ -533,12 +534,16 @@ public class Server { // probably caused by starting a connection as the server finishes // shutting down) if (cause instanceof ConnectException || cause instanceof SocketException) { //|| cause instanceof NoHttpResponseException) { - logger.log(Level.INFO, "Solr server is not running, cause: " + cause.getMessage()); + logger.log(Level.INFO, "Solr server is not running, cause: {0}", cause.getMessage()); return false; } else { throw new KeywordSearchModuleException( NbBundle.getMessage(this.getClass(), "Server.isRunning.exception.errCheckSolrRunning.msg"), ex); } + } catch (SolrException ex) { + // Just log 404 errors for now... + logger.log(Level.INFO, "Solr server is not running", ex); + return false; } catch (IOException ex) { throw new KeywordSearchModuleException( NbBundle.getMessage(this.getClass(), "Server.isRunning.exception.errCheckSolrRunning.msg2"), ex); diff --git a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index 7e57d709f8..f3d26fbf55 100644 --- a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Thu, 13 Mar 2014 18:09:42 -0400 +#Tue, 22 Apr 2014 15:16:04 -0400 LBL_splash_window_title=Starting Autopsy SPLASH_HEIGHT=288 SPLASH_WIDTH=538 @@ -8,4 +8,4 @@ SplashRunningTextBounds=5,266,530,17 SplashRunningTextColor=0x0 SplashRunningTextFontSize=18 -currentVersion=Autopsy 3.0.9 +currentVersion=Autopsy 3.1.0_Beta diff --git a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties index 4bcee6a939..870a9140a7 100644 --- a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties +++ b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Thu, 13 Mar 2014 18:09:42 -0400 +#Tue, 22 Apr 2014 15:16:04 -0400 -CTL_MainWindow_Title=Autopsy 3.0.9 -CTL_MainWindow_Title_No_Project=Autopsy 3.0.9 +CTL_MainWindow_Title=Autopsy 3.1.0_Beta +CTL_MainWindow_Title_No_Project=Autopsy 3.1.0_Beta diff --git a/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifyIngestModule.java b/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifyIngestModule.java index 96b447fde7..1429d629c7 100755 --- a/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifyIngestModule.java +++ b/ewfVerify/src/org/sleuthkit/autopsy/ewfverify/EwfVerifyIngestModule.java @@ -70,9 +70,9 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo if (messageDigest == null) { try { - messageDigest = MessageDigest.getInstance("MD5"); + messageDigest = MessageDigest.getInstance("MD5"); //NON-NLS } catch (NoSuchAlgorithmException ex) { - logger.log(Level.WARNING, "Error getting md5 algorithm", ex); + logger.log(Level.WARNING, "Error getting md5 algorithm", ex); //NON-NLS throw new RuntimeException( NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.startUp.exception.failGetMd5")); } @@ -88,7 +88,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo img = dataSource.getImage(); } catch (TskCoreException ex) { img = null; - logger.log(Level.SEVERE, "Failed to get image from Content.", ex); + logger.log(Level.SEVERE, "Failed to get image from Content.", ex); //NON-NLS services.postMessage(IngestMessage.createMessage( MessageType.ERROR, EwfVerifierModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.process.errProcImg", @@ -99,7 +99,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo // Skip images that are not E01 if (img.getType() != TskData.TSK_IMG_TYPE_ENUM.TSK_IMG_TYPE_EWF_EWF) { img = null; - logger.log(Level.INFO, "Skipping non-ewf image {0}", imgName); + logger.log(Level.INFO, "Skipping non-ewf image {0}", imgName); //NON-NLS services.postMessage(IngestMessage.createMessage( MessageType.INFO, EwfVerifierModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.process.skipNonEwf", @@ -110,7 +110,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo if ((img.getMd5() != null) && !img.getMd5().isEmpty()) { storedHash = img.getMd5().toLowerCase(); - logger.log(Level.INFO, "Hash value stored in {0}: {1}", new Object[]{imgName, storedHash}); + logger.log(Level.INFO, "Hash value stored in {0}: {1}", new Object[]{imgName, storedHash}); //NON-NLS } else { services.postMessage(IngestMessage.createMessage( MessageType.ERROR, EwfVerifierModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), @@ -119,7 +119,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo return ProcessResult.ERROR; } - logger.log(Level.INFO, "Starting hash verification of {0}", img.getName()); + logger.log(Level.INFO, "Starting hash verification of {0}", img.getName()); //NON-NLS services.postMessage(IngestMessage.createMessage( MessageType.INFO, EwfVerifierModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.process.startingImg", @@ -127,7 +127,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo long size = img.getSize(); if (size == 0) { - logger.log(Level.WARNING, "Size of image {0} was 0 when queried.", imgName); + logger.log(Level.WARNING, "Size of image {0} was 0 when queried.", imgName); //NON-NLS services.postMessage(IngestMessage.createMessage( MessageType.ERROR, EwfVerifierModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), "EwfVerifyIngestModule.process.errGetSizeOfImg", @@ -140,7 +140,7 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo chunkSize = (chunkSize == 0) ? DEFAULT_CHUNK_SIZE : chunkSize; int totalChunks = (int) Math.ceil(size / chunkSize); - logger.log(Level.INFO, "Total chunks = {0}", totalChunks); + logger.log(Level.INFO, "Total chunks = {0}", totalChunks); //NON-NLS int read; byte[] data; @@ -168,13 +168,13 @@ public class EwfVerifyIngestModule extends IngestModuleAdapter implements DataSo // Finish generating the hash and get it as a string value calculatedHash = DatatypeConverter.printHexBinary(messageDigest.digest()).toLowerCase(); verified = calculatedHash.equals(storedHash); - logger.log(Level.INFO, "Hash calculated from {0}: {1}", new Object[]{imgName, calculatedHash}); + logger.log(Level.INFO, "Hash calculated from {0}: {1}", new Object[]{imgName, calculatedHash}); //NON-NLS return ProcessResult.OK; } @Override public void shutDown(boolean ingestJobCancelled) { - logger.log(Level.INFO, "complete() {0}", EwfVerifierModuleFactory.getModuleName()); + logger.log(Level.INFO, "complete() {0}", EwfVerifierModuleFactory.getModuleName()); //NON-NLS if (skipped == false) { String msg = ""; if (verified) { diff --git a/test/script/config.xml b/test/script/config.xml index 740cc327a0..eece486d3f 100644 --- a/test/script/config.xml +++ b/test/script/config.xml @@ -36,6 +36,4 @@ It is up to the user to distinguish between the paths when adding to this file. - - - \ No newline at end of file + diff --git a/test/script/tskdbdiff.py b/test/script/tskdbdiff.py index c098a6a369..b3b7a986cb 100644 --- a/test/script/tskdbdiff.py +++ b/test/script/tskdbdiff.py @@ -230,6 +230,7 @@ class TskDbDiff(object): backup_db_file = TskDbDiff._get_tmp_file("tsk_backup_db", ".db") shutil.copy(db_file, backup_db_file) conn = sqlite3.connect(backup_db_file) + id_path_table = build_id_table(conn.cursor()) conn.text_factory = lambda x: x.decode("utf-8", "ignore") # Delete the blackboard tables conn.execute("DROP TABLE blackboard_artifacts") @@ -238,7 +239,7 @@ class TskDbDiff(object): # Write to the database dump with codecs.open(dump_file, "wb", "utf_8") as db_log: for line in conn.iterdump(): - line = remove_id(line) + line = replace_id(line, id_path_table) db_log.write('%s\n' % line) # cleanup the backup @@ -263,20 +264,37 @@ class TskDbDiff(object): class TskDbDiffException(Exception): pass -def remove_id(line): +def replace_id(line, table): """Remove the object id from a line. Args: line: a String, the line to remove the object id from. + table: a map from object ids to file paths. """ index = line.find('INSERT INTO "tsk_files"') if (index != -1): - newLine = (line[:line.find('('):] + '(' + line[line.find(',') + 1:]) - #print(newLine) + # take the portion of the string between the open parenthesis and the comma (ie, the object id) + obj_id = line[line.find('(') + 1 : line.find(',')] + # takes everything from the beginning of the string up to the opening + # parenthesis, the path associated with the object id, and everything after + # the first comma, and concactenate it + newLine = (line[:line.find('('):] + '(' + table[int(obj_id)] + line[line.find(','):]) return newLine else: return line +def build_id_table(artifact_cursor): + """Build the map of object ids to file paths. + + Args: + artifact_cursor: the database cursor + """ + # for each row in the db, take the object id, parent path, and name, then create a tuple in the dictionary + # with the object id as the key and the full file path (parent + name) as the value + mapping = dict([(row[0], str(row[1]) + str(row[2])) for row in artifact_cursor.execute("SELECT obj_id, parent_path, name FROM tsk_files")]) + return mapping + + def main(): try: sys.argv.pop(0)