diff --git a/Case/manifest.mf b/Case/manifest.mf index a14a27b0c9..e581cd0028 100644 --- a/Case/manifest.mf +++ b/Case/manifest.mf @@ -1,7 +1,8 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.casemodule/1 -OpenIDE-Module-Implementation-Version: 2 -OpenIDE-Module-Layer: org/sleuthkit/autopsy/casemodule/layer.xml -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/casemodule/Bundle.properties -OpenIDE-Module-Requires: org.openide.windows.WindowManager, org.netbeans.api.javahelp.Help - +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.casemodule/1 +OpenIDE-Module-Implementation-Version: 2 +OpenIDE-Module-Layer: org/sleuthkit/autopsy/casemodule/layer.xml +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/casemodule/Bundle.properties +OpenIDE-Module-Requires: org.openide.windows.WindowManager, org.netbeans.api.javahelp.Help + diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java b/Case/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java index 3e09bc5c7a..739c495377 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java @@ -24,7 +24,6 @@ import java.awt.Dialog; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.Action; import javax.swing.ImageIcon; import javax.swing.JButton; @@ -41,7 +40,7 @@ import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.Presenter; import org.openide.util.lookup.ServiceProvider; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.Image; /** @@ -105,7 +104,7 @@ public final class AddImageAction extends CallableSystemAction implements Presen */ @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(AddImageAction.class); + Logger.noteAction(AddImageAction.class); final IngestConfigurator ingestConfig = Lookup.getDefault().lookup(IngestConfigurator.class); if (ingestConfig.isIngestRunning()) { diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel1.java b/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel1.java index a987418131..12284fd10d 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel1.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel1.java @@ -26,7 +26,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.openide.WizardDescriptor; diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel2.java b/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel2.java index 6c2b2ea6da..9d2e81c33a 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel2.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel2.java @@ -27,7 +27,7 @@ import java.util.Iterator; import java.util.Set; import java.util.concurrent.ExecutionException; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JProgressBar; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java b/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java index 28b3d362b0..1a66997fc4 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/AddImageWizardPanel3.java @@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.casemodule; import java.awt.Component; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.event.ChangeListener; import org.openide.WizardDescriptor; import org.openide.util.HelpCtx; diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Case/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 1701014740..3c93f2d682 100755 --- a/Case/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Case/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -3,10 +3,10 @@ CTL_AddImageButton=Add Image CTL_CaseAction=Case CTL_CaseCloseAct=Close Case CTL_CaseNewAction=New Case... -CTL_CaseOpenActionOld=Open Case(old)... +#CTL_CaseOpenActionOld=Open Case(old)... CTL_CasePropertiesAction=Case Properties... CTL_CaseTopComponent=Case Window -CTL_NewCaseAct=New Case(Old)... +#CTL_NewCaseAct=New Case(Old)... CTL_OpenAction=Open Case... CTL_RecentCases=Recent Cases CTL_CaseDeleteAction=Delete Case diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/Case.java b/Case/src/org/sleuthkit/autopsy/casemodule/Case.java index a356046956..67bd3ce7b3 100755 --- a/Case/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -24,7 +24,6 @@ import java.beans.PropertyChangeSupport; import java.io.File; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Arrays; import java.util.GregorianCalendar; import java.util.HashMap; @@ -34,7 +33,6 @@ import java.util.Map; import java.util.Set; import java.util.TimeZone; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; @@ -45,7 +43,7 @@ import org.openide.util.actions.SystemAction; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.corecomponentinterfaces.CoreComponentControl; import org.sleuthkit.autopsy.coreutils.FileUtil; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Version; import org.sleuthkit.datamodel.*; import org.sleuthkit.datamodel.SleuthkitJNI.CaseDbHandle.AddImageProcess; @@ -190,7 +188,7 @@ public class Case { * @param examiner the examiner for this case */ static void create(String caseDir, String caseName, String caseNumber, String examiner) throws Exception { - Log.get(Case.class).log(Level.INFO, "Creating new case.\ncaseDir: {0}\ncaseName: {1}", new Object[]{caseDir, caseName}); + Logger.getLogger(Case.class.getName()).log(Level.INFO, "Creating new case.\ncaseDir: {0}\ncaseName: {1}", new Object[]{caseDir, caseName}); String configFilePath = caseDir + File.separator + caseName + ".aut"; @@ -213,7 +211,7 @@ public class Case { * @throws Exception */ static void open(String configFilePath) throws Exception { - Log.get(Case.class).log(Level.INFO, "Opening case.\nconfigFilePath: {0}", configFilePath); + Logger.getLogger(Case.class.getName()).log(Level.INFO, "Opening case.\nconfigFilePath: {0}", configFilePath); try { XMLCaseManagement xmlcm = new XMLCaseManagement(); @@ -306,7 +304,7 @@ public class Case { * @param timeZone the timeZone of the image where it's added */ Image addImage(String imgPath, long imgId, String timeZone) throws Exception { - Log.get(this.getClass()).log(Level.INFO, "Adding image to Case. imgPath: {0} ID: {1} TimeZone: {2}", new Object[]{imgPath, imgId, timeZone}); + Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Adding image to Case. imgPath: {0} ID: {1} TimeZone: {2}", new Object[]{imgPath, imgId, timeZone}); try { Image newImage = db.getImageById(imgId); @@ -346,7 +344,7 @@ public class Case { * Delete this case. This methods delete all folders and files of this case. */ boolean deleteCase(File caseDir) { - Log.get(this.getClass()).log(Level.FINE, "Deleting case.\ncaseDir: {0}", caseDir); + Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Deleting case.\ncaseDir: {0}", caseDir); try { diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java b/Case/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java index 1be1474884..64e34e7f40 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java @@ -23,8 +23,7 @@ import java.awt.Component; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.logging.Level;; import javax.swing.Action; import javax.swing.ImageIcon; import javax.swing.JButton; @@ -32,7 +31,15 @@ import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.Presenter; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; +import org.openide.util.actions.Presenter; + /** * The action to close the current Case. This class should be disabled on @@ -68,7 +75,7 @@ public final class CaseCloseAction extends CallableSystemAction implements Prese */ @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); if (Case.existsCurrentCase() == false) return; diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java b/Case/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java index 7a1b6cee94..3926374c9f 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/CaseDeleteAction.java @@ -21,8 +21,18 @@ package org.sleuthkit.autopsy.casemodule; import java.awt.event.ActionEvent; import java.io.File; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.util.logging.Level;; +import javax.swing.Action; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import org.openide.DialogDescriptor; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.openide.util.HelpCtx; +import org.openide.util.NbBundle; +import org.openide.util.actions.CallableSystemAction; +import org.sleuthkit.autopsy.coreutils.Logger; +import sun.rmi.runtime.Log; import javax.swing.Action; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -32,7 +42,6 @@ import org.openide.NotifyDescriptor; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; -import org.sleuthkit.autopsy.coreutils.Log; /** * The action to delete the current Case. This class should be disabled on @@ -56,7 +65,7 @@ public final class CaseDeleteAction extends CallableSystemAction { */ @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); Case currentCase = Case.getCurrentCase(); File configFile = new File(currentCase.getConfigFilePath()); diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/CaseNewAction.java b/Case/src/org/sleuthkit/autopsy/casemodule/CaseNewAction.java index 49c2b1c6e4..03cdf27c96 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/CaseNewAction.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/CaseNewAction.java @@ -23,7 +23,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import org.openide.util.actions.SystemAction; import org.openide.util.lookup.ServiceProvider; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; /** * The action to create a new case. This action class is always enabled. @@ -41,7 +41,7 @@ public final class CaseNewAction implements ActionListener { */ @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); wizard.performAction(); } diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java b/Case/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java index ae4b189543..88441c3080 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/CaseOpenAction.java @@ -25,12 +25,11 @@ import java.awt.event.ActionListener; import java.io.File; import java.util.Collections; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import org.openide.util.lookup.ServiceProvider; import org.sleuthkit.autopsy.coreutils.AutopsyPropFile; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; /** * The action to open a existing case. This class is always enabled. @@ -65,7 +64,7 @@ public final class CaseOpenAction implements ActionListener { */ @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); int retval = fc.showOpenDialog((Component) e.getSource()); diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java b/Case/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java index 674e86483f..2f44ceb73d 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/CasePropertiesAction.java @@ -23,8 +23,6 @@ import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.logging.Level; import javax.swing.Action; @@ -33,7 +31,8 @@ import javax.swing.JFrame; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; +import sun.rmi.runtime.Log; /** * The action to pop up the Case Properties Form window. By using this form, @@ -60,7 +59,7 @@ public final class CasePropertiesAction extends CallableSystemAction { */ @Override public void performAction() { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); try { // create the popUp window for it @@ -104,7 +103,7 @@ public final class CasePropertiesAction extends CallableSystemAction { popUpWindow.setVisible(true); } catch (Exception ex) { - Log.get(CasePropertiesAction.class).log(Level.WARNING, "Error displaying Case Properties window.", ex); + Logger.getLogger(CasePropertiesAction.class.getName()).log(Level.WARNING, "Error displaying Case Properties window.", ex); } } diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java b/Case/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java index 5a477b7bc9..5ff08adcad 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/CasePropertiesForm.java @@ -30,7 +30,7 @@ import java.io.File; import java.util.List; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.table.DefaultTableModel; diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java b/Case/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java index b3e8466203..9a3b9c6b31 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/IngestConfigurator.java @@ -1,57 +1,62 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.casemodule; - -import javax.swing.JPanel; -import org.sleuthkit.datamodel.Image; - -/** - * Lookup interface for ingest configuration dialog - */ -public interface IngestConfigurator { - /** - * get JPanel container with the configurator - * @return - */ - JPanel getIngestConfigPanel(); - - /** - * set image for the ingest - * @param image to enqueue to ingest - */ - void setImage(Image image); - - /** - * start ingest enqueing previously set image - */ - void start(); - - /** - * save configuration of lastly selected service - */ - void save(); - - /** - * find out if ingest is currently running - * - * @return true if ingest process is running, false otherwise - */ - boolean isIngestRunning(); - -} +/* + * Autopsy Forensic Browser + * + * Copyright 2011 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.casemodule; + +import javax.swing.JPanel; +import org.sleuthkit.datamodel.Image; + +/** + * Lookup interface for ingest configuration dialog + */ +public interface IngestConfigurator { + /** + * get JPanel container with the configurator + * @return + */ + JPanel getIngestConfigPanel(); + + /** + * set image for the ingest + * @param image to enqueue to ingest + */ + void setImage(Image image); + + /** + * start ingest enqueing previously set image + */ + void start(); + + /** + * save configuration of lastly selected service + */ + void save(); + + /** + * reload the simple panel + */ + void reload(); + + /** + * find out if ingest is currently running + * + * @return true if ingest process is running, false otherwise + */ + boolean isIngestRunning(); + +} diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java b/Case/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java index c8277ccf69..9468e39615 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardAction.java @@ -24,7 +24,6 @@ import java.awt.Dialog; import java.io.File; import java.text.MessageFormat; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JComponent; import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; @@ -33,7 +32,7 @@ import org.openide.WizardDescriptor; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.SystemAction; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; /** * Action to open the New Case wizard. @@ -46,7 +45,7 @@ public final class NewCaseWizardAction extends CallableSystemAction { @Override public void performAction() { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); // there's a case open diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java b/Case/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java index 66eceae985..f46f6594b4 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/NewCaseWizardPanel1.java @@ -24,7 +24,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import org.openide.DialogDescriptor; diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java b/Case/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java index e58a4c51c9..5fae3a97d1 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/OpenRecentCasePanel.java @@ -23,7 +23,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.JTable; diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/RecentCases.java b/Case/src/org/sleuthkit/autopsy/casemodule/RecentCases.java index 300769f350..1710589d33 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/RecentCases.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/RecentCases.java @@ -26,14 +26,13 @@ import java.util.Deque; import java.util.Iterator; import java.util.LinkedList; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JMenuItem; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; import org.openide.util.actions.Presenter; -import org.sleuthkit.autopsy.coreutils.Log; import org.openide.filesystems.FileUtil; import org.sleuthkit.autopsy.coreutils.AutopsyPropFile; +import org.sleuthkit.autopsy.coreutils.Logger; /** * The action in this class is to clear the list of "Recent Cases". @@ -208,7 +207,7 @@ public final class RecentCases extends CallableSystemAction implements Presenter */ @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); UpdateRecentCases.hasRecentCase = false; diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/RecentItems.java b/Case/src/org/sleuthkit/autopsy/casemodule/RecentItems.java index 9cfb9af7cb..dd00b59ea5 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/RecentItems.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/RecentItems.java @@ -23,10 +23,9 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JOptionPane; import javax.swing.JPanel; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; /** * This class is used to add the action to the recent case menu item. When the @@ -51,7 +50,7 @@ class RecentItems implements ActionListener { */ @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); // check if the file exists if(caseName.equals("") || casePath.equals("") || (!new File(casePath).exists())){ diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java b/Case/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java index e67b3e23d2..0e16cab60d 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java +++ b/Case/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java @@ -26,7 +26,7 @@ import java.util.Date; import java.util.HashSet; import java.util.TimeZone; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.xml.parsers.*; diff --git a/Case/src/org/sleuthkit/autopsy/casemodule/layer.xml b/Case/src/org/sleuthkit/autopsy/casemodule/layer.xml index 549f7895c8..e3af281221 100644 --- a/Case/src/org/sleuthkit/autopsy/casemodule/layer.xml +++ b/Case/src/org/sleuthkit/autopsy/casemodule/layer.xml @@ -1,11 +1,6 @@ - - - - - @@ -19,15 +14,15 @@ - + - + @@ -55,7 +50,7 @@ - + @@ -67,12 +62,11 @@ - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -183,50 +139,22 @@ - - + - - - - + - diff --git a/CoreComponentInterfaces/manifest.mf b/CoreComponentInterfaces/manifest.mf index 9a51404ae7..a1988b3db9 100644 --- a/CoreComponentInterfaces/manifest.mf +++ b/CoreComponentInterfaces/manifest.mf @@ -1,7 +1,8 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.corecomponentinterfaces/1 -OpenIDE-Module-Implementation-Version: 2 -OpenIDE-Module-Layer: org/sleuthkit/autopsy/corecomponentinterfaces/layer.xml -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/corecomponentinterfaces/Bundle.properties -OpenIDE-Module-Requires: org.openide.windows.WindowManager - +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.corecomponentinterfaces/1 +OpenIDE-Module-Implementation-Version: 2 +OpenIDE-Module-Layer: org/sleuthkit/autopsy/corecomponentinterfaces/layer.xml +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/corecomponentinterfaces/Bundle.properties +OpenIDE-Module-Requires: org.openide.windows.WindowManager + diff --git a/CoreComponentInterfaces/nbproject/project.xml b/CoreComponentInterfaces/nbproject/project.xml index 3276c14db8..54e5d03db9 100644 --- a/CoreComponentInterfaces/nbproject/project.xml +++ b/CoreComponentInterfaces/nbproject/project.xml @@ -63,6 +63,15 @@ 6.33.1 + + org.sleuthkit.autopsy.coreutils + + + + 0-1 + 0.0 + + org.sleuthkit.autopsy.datamodel diff --git a/CoreComponentInterfaces/src/org/sleuthkit/autopsy/corecomponentinterfaces/CoreComponentControl.java b/CoreComponentInterfaces/src/org/sleuthkit/autopsy/corecomponentinterfaces/CoreComponentControl.java index d1156b53e7..e0cc4c545a 100644 --- a/CoreComponentInterfaces/src/org/sleuthkit/autopsy/corecomponentinterfaces/CoreComponentControl.java +++ b/CoreComponentInterfaces/src/org/sleuthkit/autopsy/corecomponentinterfaces/CoreComponentControl.java @@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.corecomponentinterfaces; import java.util.Collection; import java.util.Iterator; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.util.Lookup; import org.openide.windows.Mode; import org.openide.windows.TopComponent; diff --git a/CoreComponentInterfaces/src/org/sleuthkit/autopsy/corecomponentinterfaces/layer.xml b/CoreComponentInterfaces/src/org/sleuthkit/autopsy/corecomponentinterfaces/layer.xml index 5848e15c04..8a00fbd9d9 100644 --- a/CoreComponentInterfaces/src/org/sleuthkit/autopsy/corecomponentinterfaces/layer.xml +++ b/CoreComponentInterfaces/src/org/sleuthkit/autopsy/corecomponentinterfaces/layer.xml @@ -1,4 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CoreComponents/manifest.mf b/CoreComponents/manifest.mf index 31e5a700d1..5b2cf51b04 100644 --- a/CoreComponents/manifest.mf +++ b/CoreComponents/manifest.mf @@ -1,8 +1,9 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.corecomponents/1 -OpenIDE-Module-Implementation-Version: 2 -OpenIDE-Module-Install: org/sleuthkit/autopsy/corecomponents/Installer.class -OpenIDE-Module-Layer: org/sleuthkit/autopsy/corecomponents/layer.xml -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/corecomponents/Bundle.properties -OpenIDE-Module-Requires: org.openide.windows.WindowManager, org.netbeans.api.javahelp.Help - +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.corecomponents/1 +OpenIDE-Module-Implementation-Version: 2 +OpenIDE-Module-Install: org/sleuthkit/autopsy/corecomponents/Installer.class +OpenIDE-Module-Layer: org/sleuthkit/autopsy/corecomponents/layer.xml +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/corecomponents/Bundle.properties +OpenIDE-Module-Requires: org.openide.windows.WindowManager, org.netbeans.api.javahelp.Help + diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.form b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.form index cc784d4d4a..554b08dbe3 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.form +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.form @@ -17,7 +17,7 @@ - + @@ -42,13 +42,49 @@ - + - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.java index 3c338c9053..3758ee7760 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/AdvancedConfigurationDialog.java @@ -57,7 +57,7 @@ public class AdvancedConfigurationDialog extends javax.swing.JDialog { panel.setAlignmentX(Component.CENTER_ALIGNMENT); - applyButton.setAlignmentX(Component.CENTER_ALIGNMENT); + //applyButton.setAlignmentX(Component.CENTER_ALIGNMENT); this.add(panel, 0); this.pack(); @@ -83,6 +83,7 @@ public class AdvancedConfigurationDialog extends javax.swing.JDialog { jSeparator1 = new javax.swing.JSeparator(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4)); + jPanel1 = new javax.swing.JPanel(); applyButton = new javax.swing.JButton(); filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4), new java.awt.Dimension(0, 4)); @@ -91,8 +92,30 @@ public class AdvancedConfigurationDialog extends javax.swing.JDialog { getContentPane().add(jSeparator1); getContentPane().add(filler1); + jPanel1.setMaximumSize(new java.awt.Dimension(4000, 27)); + jPanel1.setMinimumSize(new java.awt.Dimension(100, 27)); + jPanel1.setPreferredSize(new java.awt.Dimension(400, 27)); + applyButton.setText(org.openide.util.NbBundle.getMessage(AdvancedConfigurationDialog.class, "AdvancedConfigurationDialog.applyButton.text")); // NOI18N - getContentPane().add(applyButton); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(343, Short.MAX_VALUE) + .addComponent(applyButton) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(2, 2, 2) + .addComponent(applyButton) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanel1); getContentPane().add(filler2); pack(); @@ -102,6 +125,7 @@ public class AdvancedConfigurationDialog extends javax.swing.JDialog { private javax.swing.JButton applyButton; private javax.swing.Box.Filler filler1; private javax.swing.Box.Filler filler2; + private javax.swing.JPanel jPanel1; private javax.swing.JSeparator jSeparator1; // End of variables declaration//GEN-END:variables diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/CustomAboutAction.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/CustomAboutAction.java index 32c6cbdb5a..3d5f94da89 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/CustomAboutAction.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/CustomAboutAction.java @@ -23,7 +23,7 @@ import org.openide.util.NbBundle; import org.netbeans.core.actions.AboutAction; import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; /** * Action to open custom implementation of the "About" window from the Help menu. @@ -32,7 +32,7 @@ public class CustomAboutAction extends AboutAction { @Override public void performAction() { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); DialogDescriptor descriptor = new DialogDescriptor( new ProductInformationPanel(), diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java index 324621bb84..721928e257 100755 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java @@ -22,7 +22,7 @@ import java.awt.Cursor; import java.beans.PropertyChangeEvent; import java.util.ArrayList; import java.util.List; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JTabbedPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java index 901f901446..11f39836cb 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerArtifact.java @@ -31,7 +31,7 @@ import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JMenuItem; import org.openide.nodes.Node; import org.openide.util.Lookup; diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java index 5e76c1b17c..98d9e019d1 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java @@ -23,7 +23,7 @@ import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JTextPane; diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerMedia.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerMedia.java index 86b5e330c1..b5d0cdc13c 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerMedia.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerMedia.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.concurrent.CancellationException; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.BoxLayout; import javax.swing.SwingWorker; import javax.swing.event.ChangeEvent; diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerPicture.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerPicture.java index 36ca063420..5d1491b6fc 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerPicture.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerPicture.java @@ -24,7 +24,7 @@ import java.awt.Image; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.imageio.ImageIO; import javax.swing.JPanel; import org.openide.nodes.Node; diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java index 4a05d7ac67..1a70860c53 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerString.java @@ -24,7 +24,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import org.openide.nodes.Node; diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java index e109078f9e..9cc8159068 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java @@ -30,7 +30,7 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JTable; import javax.swing.ListSelectionModel; import org.netbeans.swing.outline.DefaultOutlineModel; diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java index 9275d83353..2b25021161 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerThumbnail.java @@ -24,7 +24,7 @@ import java.awt.Cursor; import java.beans.PropertyVetoException; import java.io.IOException; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.ListSelectionModel; import org.openide.explorer.ExplorerManager; import org.openide.explorer.view.IconView; diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/Installer.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/Installer.java index 1f460b700e..e806614f09 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/Installer.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/Installer.java @@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.corecomponents; import java.awt.Color; import java.awt.Insets; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.BorderFactory; import javax.swing.UIManager; import javax.swing.UIManager.LookAndFeelInfo; diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/OptionsPanel.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/OptionsPanel.java new file mode 100644 index 0000000000..47f4edd848 --- /dev/null +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/OptionsPanel.java @@ -0,0 +1,23 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.sleuthkit.autopsy.corecomponents; + +/** + * + */ +public interface OptionsPanel { + + /** + * Store the current state of all options in this OptionsPanel. + */ + public void store(); + + /** + * Load the saved state of all options, and refresh this + * OptionsPanel accordingly. + */ + public void load(); + +} diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/ThumbnailViewNode.java b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/ThumbnailViewNode.java index e910f3942f..2f39262284 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/ThumbnailViewNode.java +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/ThumbnailViewNode.java @@ -34,7 +34,7 @@ import javax.swing.JFrame; import org.openide.nodes.FilterNode; import org.openide.nodes.Node; import org.sleuthkit.autopsy.casemodule.Case; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.TskException; @@ -116,7 +116,7 @@ class ThumbnailViewNode extends FilterNode { mTracker.waitForID(1); } catch (InterruptedException ex) { // TODO: maybe make bubble instead - Log.get(ThumbnailViewNode.class).log(Level.WARNING, "Error while trying to scale the icon.", ex); + Logger.getLogger(ThumbnailViewNode.class.getName()).log(Level.WARNING, "Error while trying to scale the icon.", ex); } int width = result.getWidth(null); int height = result.getHeight(null); @@ -137,7 +137,7 @@ class ThumbnailViewNode extends FilterNode { mTracker.waitForID(1); } catch (InterruptedException ex) { // TODO: maybe make bubble instead - Log.get(ThumbnailViewNode.class).log(Level.WARNING, "Error while trying to load the icon.", ex); + Logger.getLogger(ThumbnailViewNode.class.getName()).log(Level.WARNING, "Error while trying to load the icon.", ex); } // create 75x75 image for the icon with the icon on the center diff --git a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/layer.xml b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/layer.xml index babda5c026..46d643d77e 100644 --- a/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/layer.xml +++ b/CoreComponents/src/org/sleuthkit/autopsy/corecomponents/layer.xml @@ -1,55 +1,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CoreUtils/manifest.mf b/CoreUtils/manifest.mf index 2fd5a80363..2aa3cf5594 100644 --- a/CoreUtils/manifest.mf +++ b/CoreUtils/manifest.mf @@ -1,6 +1,7 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.coreutils/0 -OpenIDE-Module-Implementation-Version: 2 -OpenIDE-Module-Install: org/sleuthkit/autopsy/coreutils/Installer.class -OpenIDE-Module-Layer: org/sleuthkit/autopsy/coreutils/layer.xml -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/coreutils/Bundle.properties +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.coreutils/0 +OpenIDE-Module-Implementation-Version: 2 +OpenIDE-Module-Install: org/sleuthkit/autopsy/coreutils/Installer.class +OpenIDE-Module-Layer: org/sleuthkit/autopsy/coreutils/layer.xml +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/coreutils/Bundle.properties diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/AutopsyPropFile.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/AutopsyPropFile.java index 4a1f049b33..c33579fab3 100644 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/AutopsyPropFile.java +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/AutopsyPropFile.java @@ -22,7 +22,7 @@ package org.sleuthkit.autopsy.coreutils; import java.io.*; import java.util.Properties; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.modules.Places; /** * This class contains the framework to read, add, update, and remove diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/DecodeUtil.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/DecodeUtil.java index 5bc2342786..f3f4d1f238 100644 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/DecodeUtil.java +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/DecodeUtil.java @@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.coreutils; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; /** * Decoding utilities. diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/FileUtil.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/FileUtil.java index 88deab8f12..eca9b93c5e 100644 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/FileUtil.java +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/FileUtil.java @@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.coreutils; import java.io.File; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; /** * File and dir utilities diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Installer.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Installer.java index 3ab82b7095..0715e1a7be 100644 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Installer.java +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Installer.java @@ -20,11 +20,9 @@ package org.sleuthkit.autopsy.coreutils; import java.io.IOException; -import java.nio.charset.Charset; import java.util.logging.FileHandler; -import org.openide.modules.ModuleInstall; -import java.util.logging.Logger; import java.util.logging.Handler; +import org.openide.modules.ModuleInstall; import java.util.logging.Level; import java.util.logging.SimpleFormatter; import org.openide.modules.Places; @@ -36,26 +34,13 @@ import org.openide.modules.Places; */ public class Installer extends ModuleInstall { - static final Logger autopsyLogger = Logger.getLogger(""); - static final String LOG_FILENAME_PATTERN = Places.getUserDirectory().getAbsolutePath() + "/var/log/autopsy.log"; //%t is system temp dir, %g is log number - static final int LOG_SIZE = 0; // in bytes, zero is unlimited - static final int LOG_FILE_COUNT = 10; - static Handler logs; + static final Logger autopsyLogger = Logger.getLogger(""); //root logger + +static Handler logs; @Override public void restored() { - if (logs == null) { - try { - logs = new FileHandler(LOG_FILENAME_PATTERN, LOG_SIZE, LOG_FILE_COUNT); - logs.setEncoding(PlatformUtil.getLogFileEncoding()); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - logs.setFormatter(new SimpleFormatter()); - autopsyLogger.addHandler(logs); - } - - autopsyLogger.log(Level.INFO, "Using encoding for log files: " + logs.getEncoding()); + //Logger.init(); autopsyLogger.log(Level.INFO, "Default charset: " + PlatformUtil.getDefaultPlatformCharset()); autopsyLogger.log(Level.INFO, "Default file encoding: " + PlatformUtil.getDefaultPlatformFileEncoding()); @@ -63,15 +48,13 @@ public class Installer extends ModuleInstall { autopsyLogger.log(Level.INFO, "Netbeans Platform build: " + Version.getNetbeansBuild()); - autopsyLogger.log(Level.INFO, "Application name: " + Version.getName() + autopsyLogger.log(Level.INFO, "Application name: " + Version.getName() + ", version: " + Version.getVersion() + ", build: " + Version.getBuildType()); } @Override public void uninstalled() { - autopsyLogger.removeHandler(logs); - logs.close(); - logs = null; + } diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/JLnkParser.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/JLnkParser.java index 43e8f6f215..e004da65ab 100644 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/JLnkParser.java +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/JLnkParser.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.LnkEnums.CommonCLSIDS; import org.sleuthkit.autopsy.coreutils.LnkEnums.DriveType; import org.sleuthkit.autopsy.coreutils.LnkEnums.NetworkProviderType; diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Log.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Log.java deleted file mode 100644 index 4dfda17f84..0000000000 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Log.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.sleuthkit.autopsy.coreutils; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * Helper class to slightly simplify getting the logger for a class, and other - * common log tasks. - */ -public class Log { - static public void noteAction(Class actionClass) { - get(actionClass).log(Level.INFO, "Action performed: {0}", actionClass.getName()); - } - - - static public Logger get(Class clazz) { - return Logger.getLogger(clazz.getName()); - } - - static public Logger get(String loggerName) { - return Logger.getLogger(loggerName); - } -} diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Logger.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Logger.java new file mode 100644 index 0000000000..50a9f1842f --- /dev/null +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/Logger.java @@ -0,0 +1,179 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2012 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.coreutils; + +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.logging.*; +import org.openide.modules.Places; + +/** + * Custom Autopsy logger wrapper over java.util.logging.Logger with default file + * streams logging to autopsy.log (general high level messages), + * autopsy_traces.log (also including exception traces). + * In development build, those are also redirected to console / messages log. + * + * Contains a utility method to log user actions to autopsy_actions.log via noteAction() + * + * Use like java.util.logging.Logger API, get a + * org.sleuthkit.autopsy.coreutils.Logger handle using factory method + * org.sleuthkit.autopsy.coreutils.Logger.getLogger(String name) passing + * component/module/class name. + * + * If logging behavior is to be customized, you can add or remove handlers or + * filters from the provided Logger object. + */ +public class Logger extends java.util.logging.Logger { + + private static final String LOG_ENCODING = PlatformUtil.getLogFileEncoding(); + private static final String LOG_DIR = PlatformUtil.getLogDirectory(); + static final int LOG_SIZE = 0; // in bytes, zero is unlimited + static final int LOG_FILE_COUNT = 10; + + //File Handlers which point to the output logs + private static final FileHandler traces = initTraces(); + private static final FileHandler normal = initNormal(); + private static final Handler console = new java.util.logging.ConsoleHandler(); + private static final java.util.logging.Logger actionsLogger = initActionsLogger(); + + + /** + * Main messages log file name + */ + public static final String messagesLog = "autopsy.log"; + /** + * Detailed exception trace log file name + */ + public static final String tracesLog = "autopsy_traces.log"; + + /** + * Action logger file name + */ + public static final String actionsLog = "autopsy_actions.log"; + + /** + * Static blocks to get around compile errors such as "variable might not + * have been initialized + * + */ + // + private static FileHandler initTraces() { + + try { + + FileHandler f = new FileHandler(LOG_DIR + tracesLog, LOG_SIZE, LOG_FILE_COUNT); + f.setEncoding(LOG_ENCODING); + f.setFormatter(new SimpleFormatter()); + return f; + } catch (IOException e) { + throw new RuntimeException("Error initializing traces logger", e); + } + } + + private static FileHandler initNormal() { + try { + FileHandler f = new FileHandler(LOG_DIR + messagesLog, LOG_SIZE, LOG_FILE_COUNT); + f.setEncoding(LOG_ENCODING); + f.setFormatter(new SimpleFormatter()); + return f; + } catch (IOException e) { + throw new RuntimeException("Error initializing normal logger", e); + } + } + + private static java.util.logging.Logger initActionsLogger() { + try { + 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"); + _actionsLogger.setUseParentHandlers(false); + _actionsLogger.addHandler(f); + _actionsLogger.addHandler(console); + return _actionsLogger; + } catch (IOException e) { + throw new RuntimeException("Error initializing actions logger", e); + } + } + + // + private Logger(java.util.logging.Logger log) { + super(log.getName(), log.getResourceBundleName()); + //do forward to messages, so that IDE window shows them + if (Version.getBuildType() == Version.Type.DEVELOPMENT) { + addHandler(console); + } + setUseParentHandlers(false); //do not forward to parent logger, sharing static handlers anyway + //addHandler(new AutopsyExceptionHandler()); + addHandler(normal); + addHandler(traces); + } + + + + + /** + * Log an action to autopsy_actions.log + * @param actionClass class where user triggered action occurs + */ + public static void noteAction(Class actionClass) { + actionsLogger.log(Level.INFO, "Action performed: {0}", actionClass.getName()); + } + + /** + * Factory method to retrieve a org.sleuthkit.autopsy.coreutils.Logger + * instance The logger logs by default to autopsy.log and + * autopsy_traces.log. Add/remove handlers if the desired behavior should be + * different. + * + * @param name ID for the logger or empty string for a root logger + * @return org.sleuthkit.autopsy.coreutils.Logger instance + */ + public static Logger getLogger(String name) { + Logger l = new Logger(java.util.logging.Logger.getLogger(name)); + return l; + } + + /** + * Factory method to retrieve a org.sleuthkit.autopsy.coreutils.Logger + * instance + * + * @param name ID for the logger or empty string for a root logger + * @param resourceBundleName bundle name associated with the logger + * @return org.sleuthkit.autopsy.coreutils.Logger instance + */ + public static Logger getLogger(String name, String resourceBundleName) { + return new Logger(Logger.getLogger(name, resourceBundleName)); + } + + @Override + public void log(Level level, String message, Throwable thrown) { + super.log(level, message + "\nException: " + thrown.toString()); + removeHandler(normal); + super.log(level, message, thrown); + addHandler(normal); + } + + @Override + public void throwing(String sourceClass, String sourceMethod, Throwable thrown) { + removeHandler(normal); + super.throwing(sourceClass, sourceMethod, thrown); + addHandler(normal); + } +} diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java index 6c19479925..d7921b42d6 100644 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/PlatformUtil.java @@ -16,13 +16,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.sleuthkit.autopsy.coreutils; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.nio.charset.Charset; import java.util.logging.Level; -import java.util.logging.Logger; import org.openide.modules.InstalledFileLocator; import org.openide.modules.Places; @@ -31,59 +36,107 @@ import org.openide.modules.Places; * Platform utililities */ public class PlatformUtil { - private static final Logger logger = Logger.getLogger(PlatformUtil.class.getName()); - + private static String javaPath = null; - + /** - * get file path to the java executable binary - * use embedded java if available, otherwise use system java in PATH - * no validation is done if java exists in PATH + * get file path to the java executable binary use embedded java if + * available, otherwise use system java in PATH no validation is done if + * java exists in PATH + * * @return file path to java binary */ public synchronized static String getJavaPath() { - if (javaPath != null) + if (javaPath != null) { return javaPath; - + } + File coreFolder = InstalledFileLocator.getDefault().locate("core", PlatformUtil.class.getPackage().getName(), false); File rootPath = coreFolder.getParentFile().getParentFile(); File jrePath = new File(rootPath.getAbsolutePath() + File.separator + "jre6"); - + if (jrePath != null && jrePath.exists() && jrePath.isDirectory()) { - logger.log(Level.INFO, "Embedded jre6 directory found in: " + jrePath.getAbsolutePath()); + System.out.println("Embedded jre6 directory found in: " + jrePath.getAbsolutePath()); javaPath = jrePath.getAbsolutePath() + File.separator + "bin" + File.separator + "java"; - } - else { + } else { //else use system installed java in PATH env variable javaPath = "java"; - + } - - logger.log(Level.INFO, "Using java binary path: " + javaPath); - - + + System.out.println("Using java binary path: " + javaPath); + + return javaPath; } - + /** - * Get user directory where application wide user settings, cache, temp files are stored + * Get user directory where application wide user settings, cache, temp + * files are stored + * * @return File object representing user directory */ public static File getUserDirectory() { return Places.getUserDirectory(); } - + + public static String getLogDirectory() { + return Places.getUserDirectory().getAbsolutePath() + "/var/log/"; + } + public static String getDefaultPlatformFileEncoding() { return System.getProperty("file.encoding"); } - + public static String getDefaultPlatformCharset() { return Charset.defaultCharset().name(); } - + public static String getLogFileEncoding() { return Charset.forName("UTF-8").name(); } - - + + /** + * Utility to extract a resource file to a user directory, if it does not + * exist + * + * @param resourceClass class in the same package as the resourceFile to + * extract + * @param resourceFile resource file name to extract + * @return true if extracted, false otherwise (if file already exists) + * @throws IOException exception thrown if extract the file failed for IO + * reasons + */ + public static boolean extractResourceToUserDir(final Class resourceClass, final String resourceFile) throws IOException { + final File userDir = getUserDirectory(); + + final File resourceFileF = new File(userDir + File.separator + resourceFile); + if (resourceFileF.exists()) { + return false; + } + + InputStream inputStream = resourceClass.getResourceAsStream(resourceFile); + + OutputStream out = null; + InputStream in = null; + try { + + in = new BufferedInputStream(inputStream); + OutputStream outFile = new FileOutputStream(resourceFileF); + out = new BufferedOutputStream(outFile); + int readBytes = 0; + while ((readBytes = in.read()) != -1) { + out.write(readBytes); + } + } finally { + if (in != null) { + in.close(); + } + if (out != null) { + out.flush(); + out.close(); + } + } + return true; + } } diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/StringExtract.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/StringExtract.java index 1063f7570d..014a26c794 100644 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/StringExtract.java +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/StringExtract.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.Properties; import java.util.StringTokenizer; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractUnicodeTable.SCRIPT; /** diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/TestLogger.java b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/TestLogger.java index d233f6b753..08942f3221 100644 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/TestLogger.java +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/TestLogger.java @@ -22,7 +22,7 @@ package org.sleuthkit.autopsy.coreutils; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.logging.Formatter; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import java.util.logging.Level; /* diff --git a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/layer.xml b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/layer.xml index a11becd877..733111b739 100644 --- a/CoreUtils/src/org/sleuthkit/autopsy/coreutils/layer.xml +++ b/CoreUtils/src/org/sleuthkit/autopsy/coreutils/layer.xml @@ -1,10 +1,4 @@ - - - - - - - - - - + + + + diff --git a/DataModel/manifest.mf b/DataModel/manifest.mf index 65c31289e3..96d427757f 100644 --- a/DataModel/manifest.mf +++ b/DataModel/manifest.mf @@ -1,6 +1,7 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.datamodel/1 -OpenIDE-Module-Implementation-Version: 2 -OpenIDE-Module-Install: org/sleuthkit/autopsy/datamodel/Installer.class -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/datamodel/Bundle.properties - +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.datamodel/1 +OpenIDE-Module-Implementation-Version: 2 +OpenIDE-Module-Install: org/sleuthkit/autopsy/datamodel/Installer.class +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/datamodel/Bundle.properties + diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactStringContent.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactStringContent.java index e082b5fe24..1a6f272d28 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactStringContent.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactStringContent.java @@ -22,7 +22,7 @@ import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.TimeZone; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeChildren.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeChildren.java index 909c601614..3b66fd4b7c 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeChildren.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeChildren.java @@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.datamodel; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.ChildFactory; import org.openide.nodes.Node; import org.sleuthkit.datamodel.BlackboardArtifact; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeNode.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeNode.java index d198b3c22a..44be779baa 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeNode.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/ArtifactTypeNode.java @@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.datamodel; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Sheet; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java index f7b34405ea..2cb1607f64 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/BlackboardArtifactNode.java @@ -23,7 +23,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Sheet; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/Bookmarks.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/Bookmarks.java index cc043e0e99..40a286f535 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/Bookmarks.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/Bookmarks.java @@ -22,7 +22,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.ChildFactory; import org.openide.nodes.Children; import org.openide.nodes.Node; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/ContentHierarchyVisitor.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/ContentHierarchyVisitor.java index f4d726201a..5d3bb9fbac 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/ContentHierarchyVisitor.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/ContentHierarchyVisitor.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.ContentVisitor; import org.sleuthkit.datamodel.Directory; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java index 2e61d54f16..ddf0cc12eb 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/ContentUtils.java @@ -26,7 +26,7 @@ import java.util.LinkedList; import java.util.List; import java.util.TimeZone; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.SwingWorker; import org.netbeans.api.progress.ProgressHandle; import org.sleuthkit.datamodel.Content; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java index 135a4f4c68..6e4ab779a7 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/EmailExtracted.java @@ -26,7 +26,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.AbstractNode; import org.openide.nodes.ChildFactory; import org.openide.nodes.Children; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/FileSearchFilterChildren.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/FileSearchFilterChildren.java index 6757227fd3..33829c1513 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/FileSearchFilterChildren.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/FileSearchFilterChildren.java @@ -24,7 +24,7 @@ import java.sql.Statement; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.AbstractNode; import org.openide.nodes.ChildFactory; import org.openide.nodes.Node; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java index b780160b3c..ac2eddf0d4 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/HashsetHits.java @@ -28,7 +28,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.AbstractNode; import org.openide.nodes.ChildFactory; import org.openide.nodes.Children; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/Installer.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/Installer.java index ed06522396..1af1d3d486 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/Installer.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/Installer.java @@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.datamodel; import java.awt.Component; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JOptionPane; import org.openide.LifecycleManager; import org.openide.modules.ModuleInstall; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java index f507d9da67..49eba6305c 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/KeywordHits.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.AbstractNode; import org.openide.nodes.ChildFactory; import org.openide.nodes.Children; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesChildren.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesChildren.java index 80f9b634f4..1df31ce6f0 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesChildren.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesChildren.java @@ -25,7 +25,7 @@ import java.util.Arrays; import java.util.Calendar; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.ChildFactory; import org.openide.nodes.Node; import org.sleuthkit.datamodel.SleuthkitCase; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterChildren.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterChildren.java index fb5c0a8f6a..7e30b4ea8f 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterChildren.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterChildren.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.AbstractNode; import org.openide.nodes.ChildFactory; import org.openide.nodes.Node; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java index ede928a61d..54ae72dc74 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/RecentFilesFilterNode.java @@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.datamodel; import java.util.Calendar; import java.util.Locale; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Sheet; diff --git a/DataModel/src/org/sleuthkit/autopsy/datamodel/RootContentChildren.java b/DataModel/src/org/sleuthkit/autopsy/datamodel/RootContentChildren.java index 2a7c4c9849..8ec01979e1 100644 --- a/DataModel/src/org/sleuthkit/autopsy/datamodel/RootContentChildren.java +++ b/DataModel/src/org/sleuthkit/autopsy/datamodel/RootContentChildren.java @@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.datamodel; import java.util.Collection; import java.util.Collections; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.BlackboardArtifact; /** diff --git a/DirectoryTree/manifest.mf b/DirectoryTree/manifest.mf index 8b89b66bac..e4bff5d586 100644 --- a/DirectoryTree/manifest.mf +++ b/DirectoryTree/manifest.mf @@ -1,7 +1,8 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.directorytree/1 -OpenIDE-Module-Implementation-Version: 2 -OpenIDE-Module-Layer: org/sleuthkit/autopsy/directorytree/layer.xml -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/directorytree/Bundle.properties -OpenIDE-Module-Requires: org.openide.windows.WindowManager, org.netbeans.api.javahelp.Help - +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.directorytree/1 +OpenIDE-Module-Implementation-Version: 2 +OpenIDE-Module-Layer: org/sleuthkit/autopsy/directorytree/layer.xml +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/directorytree/Bundle.properties +OpenIDE-Module-Requires: org.openide.windows.WindowManager, org.netbeans.api.javahelp.Help + diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/Bundle.properties b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/Bundle.properties index de02dec972..12abeb5237 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/Bundle.properties +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/Bundle.properties @@ -1,7 +1,7 @@ CTL_DirectoryTreeAction=DirectoryTree CTL_DirectoryTreeExplorerAction=DirectoryTreeExplorer CTL_DirectoryTreeTopComponent=Directory Tree -CTL_FileBrowserAction=FileBrowser (new) +#CTL_FileBrowserAction=FileBrowser (new) HINT_DirectoryTreeTopComponent=This is a DirectoryTree window OpenIDE-Module-Name=DirectoryTree FileSystemDetailsPanel.imgOffsetLabel.text=Image Offset: diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ChangeViewAction.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ChangeViewAction.java index c4efd8d872..2b5b7d80a9 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ChangeViewAction.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ChangeViewAction.java @@ -27,7 +27,7 @@ import org.openide.util.actions.Presenter; import org.sleuthkit.autopsy.corecomponents.DataContentTopComponent; import org.sleuthkit.autopsy.corecomponents.DataContentViewerHex; import org.sleuthkit.autopsy.corecomponents.DataContentViewerString; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; /** * The actions to change between the "Hex View" and "String View". @@ -56,7 +56,7 @@ public class ChangeViewAction extends AbstractAction implements Presenter.Popup */ @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); DataContentTopComponent dctc = DataContentTopComponent.findInstance(); int totalTabs = dctc.getTabPanels().getTabCount(); diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/CollapseAction.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/CollapseAction.java index 9d2c25c698..9d27a8a20d 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/CollapseAction.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/CollapseAction.java @@ -24,7 +24,7 @@ import org.openide.explorer.ExplorerManager; import org.openide.explorer.view.BeanTreeView; import org.openide.nodes.Children; import org.openide.nodes.Node; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.coreutils.Logger; /** * @@ -38,7 +38,7 @@ class CollapseAction extends AbstractAction { @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); ExplorerManager em = DirectoryTreeTopComponent.findInstance().getExplorerManager(); Node[] selectedNode = em.getSelectedNodes(); diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java index 8456d0f72a..94ab2e7a30 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DataResultFilterNode.java @@ -25,7 +25,7 @@ import java.util.List; import org.sleuthkit.autopsy.datamodel.VolumeNode; import org.sleuthkit.autopsy.datamodel.DirectoryNode; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.AbstractAction; import javax.swing.Action; import org.openide.explorer.ExplorerManager; diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterChildren.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterChildren.java index 5742a39c62..6ae74ce9a8 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterChildren.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeFilterChildren.java @@ -19,7 +19,7 @@ package org.sleuthkit.autopsy.directorytree; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.nodes.Children; import org.sleuthkit.autopsy.datamodel.DirectoryNode; import org.openide.nodes.FilterNode; diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java index 48c71eb89c..c701e393e0 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java @@ -29,7 +29,7 @@ import java.beans.PropertyChangeSupport; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.Action; import javax.swing.JOptionPane; import javax.swing.JPanel; diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java index e0e0749ca1..51dd62a6e6 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ExternalViewerAction.java @@ -23,12 +23,12 @@ import java.awt.event.ActionEvent; import java.io.File; import java.io.IOException; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.AbstractAction; import org.openide.nodes.Node; import org.sleuthkit.autopsy.casemodule.Case; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.ContentUtils; -import org.sleuthkit.autopsy.coreutils.Log; + /** * Extracts a File object to a temporary file in the case directory, and then @@ -70,7 +70,7 @@ public class ExternalViewerAction extends AbstractAction { @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); // Get the temp folder path of the case String tempPath = Case.getCurrentCase().getTempDirectory(); diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java index 0195cd7c5c..1e1768d2b5 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ExtractAction.java @@ -23,7 +23,7 @@ import java.awt.event.ActionEvent; import java.io.File; import java.util.concurrent.CancellationException; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.AbstractAction; import javax.swing.JFileChooser; import javax.swing.JOptionPane; diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/FileBookmarkAction.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/FileBookmarkAction.java index 7a51ffb91f..120439d2a6 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/FileBookmarkAction.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/FileBookmarkAction.java @@ -22,7 +22,7 @@ import java.awt.event.ActionEvent; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.AbstractAction; import org.openide.nodes.Node; import org.sleuthkit.autopsy.datamodel.Bookmarks; diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/NewWindowViewAction.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/NewWindowViewAction.java index 54e3d953a1..a848711566 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/NewWindowViewAction.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/NewWindowViewAction.java @@ -25,10 +25,10 @@ import javax.swing.AbstractAction; import org.openide.nodes.Node; import org.openide.windows.Mode; import org.openide.windows.WindowManager; -import org.sleuthkit.autopsy.datamodel.DataConversion; import org.sleuthkit.autopsy.corecomponents.DataContentTopComponent; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.ContentUtils; -import org.sleuthkit.autopsy.coreutils.Log; +import org.sleuthkit.autopsy.datamodel.DataConversion; import org.sleuthkit.datamodel.Content; /** @@ -45,7 +45,7 @@ public class NewWindowViewAction extends AbstractAction{ @Override public void actionPerformed(ActionEvent e) { - Log.noteAction(this.getClass()); + Logger.noteAction(this.getClass()); String name = "DataContent"; Content c = contentNode.getLookup().lookup(Content.class); diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ResultDeleteAction.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ResultDeleteAction.java index b90cd0e951..aad956f577 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ResultDeleteAction.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ResultDeleteAction.java @@ -23,7 +23,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.AbstractAction; import javax.swing.JOptionPane; import org.sleuthkit.autopsy.casemodule.Case; diff --git a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ShowDetailActionVisitor.java b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ShowDetailActionVisitor.java index 8936cbf213..c539f9b0de 100644 --- a/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ShowDetailActionVisitor.java +++ b/DirectoryTree/src/org/sleuthkit/autopsy/directorytree/ShowDetailActionVisitor.java @@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.directorytree; -import javax.swing.*; import java.awt.Toolkit; import java.awt.Dimension; import java.awt.Font; @@ -31,17 +30,18 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.logging.Level; +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; -import org.sleuthkit.autopsy.coreutils.Log; -import org.sleuthkit.datamodel.ContentVisitor; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.ContentVisitor; import org.sleuthkit.datamodel.FileSystem; import org.sleuthkit.datamodel.Image; -import org.sleuthkit.datamodel.TskException; import org.sleuthkit.datamodel.Volume; /** @@ -86,7 +86,7 @@ class ShowDetailActionVisitor extends ContentVisitor.Default - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ExifParser/manifest.mf b/ExifParser/manifest.mf index 1c48182980..4d76da9d1c 100644 --- a/ExifParser/manifest.mf +++ b/ExifParser/manifest.mf @@ -1,5 +1,6 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.exifparser -OpenIDE-Module-Layer: org/sleuthkit/autopsy/exifparser/layer.xml -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/exifparser/Bundle.properties -OpenIDE-Module-Specification-Version: 1.0 +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.exifparser +OpenIDE-Module-Layer: org/sleuthkit/autopsy/exifparser/layer.xml +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/exifparser/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 diff --git a/ExifParser/nbproject/project.xml b/ExifParser/nbproject/project.xml index 5bd575c669..34872f6afc 100644 --- a/ExifParser/nbproject/project.xml +++ b/ExifParser/nbproject/project.xml @@ -6,6 +6,15 @@ org.sleuthkit.autopsy.exifparser + + org.sleuthkit.autopsy.coreutils + + + + 0-1 + 0.0 + + org.sleuthkit.autopsy.datamodel diff --git a/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java b/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java index 5194f343ee..33aa0a9a8a 100644 --- a/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java +++ b/ExifParser/src/org/sleuthkit/autopsy/exifparser/ExifParserFileIngestModule.java @@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.exifparser; import com.drew.imaging.ImageMetadataReader; import com.drew.imaging.ImageProcessingException; +import com.drew.imaging.jpeg.JpegProcessingException; import com.drew.metadata.Metadata; import com.drew.metadata.exif.ExifIFD0Directory; import com.drew.metadata.exif.ExifSubIFDDirectory; @@ -31,7 +32,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; @@ -152,9 +153,9 @@ public final class ExifParserFileIngestModule implements IngestModuleAbstractFil } catch (TskCoreException ex) { Logger.getLogger(ExifParserFileIngestModule.class.getName()).log(Level.SEVERE, null, ex); } catch (ImageProcessingException ex) { - logger.log(Level.WARNING, "Failed to process the image.", ex); + logger.log(Level.WARNING, "Failed to process the image file: " + f.getName()); } catch (IOException ex) { - logger.log(Level.WARNING, "IOException when parsing image file.", ex); + logger.log(Level.WARNING, "IOException when parsing image file: " + f.getName(), ex); } finally { try { if(in!=null) { in.close(); } diff --git a/FileSearch/manifest.mf b/FileSearch/manifest.mf index 47c3c1544d..01896c1faf 100644 --- a/FileSearch/manifest.mf +++ b/FileSearch/manifest.mf @@ -1,7 +1,8 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.filesearch/1 -OpenIDE-Module-Implementation-Version: 2 -OpenIDE-Module-Layer: org/sleuthkit/autopsy/filesearch/layer.xml -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/filesearch/Bundle.properties -OpenIDE-Module-Requires: org.openide.windows.WindowManager, org.netbeans.api.javahelp.Help - +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.filesearch/1 +OpenIDE-Module-Implementation-Version: 2 +OpenIDE-Module-Layer: org/sleuthkit/autopsy/filesearch/layer.xml +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/filesearch/Bundle.properties +OpenIDE-Module-Requires: org.openide.windows.WindowManager, org.netbeans.api.javahelp.Help + diff --git a/FileSearch/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java b/FileSearch/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java index 125b9c62a8..08414f9f58 100644 --- a/FileSearch/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java +++ b/FileSearch/src/org/sleuthkit/autopsy/filesearch/FileSearchPanel.java @@ -40,7 +40,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; diff --git a/FileSearch/src/org/sleuthkit/autopsy/filesearch/FileSearchTopComponent.java b/FileSearch/src/org/sleuthkit/autopsy/filesearch/FileSearchTopComponent.java index 22bba8aee0..2a4d188c76 100644 --- a/FileSearch/src/org/sleuthkit/autopsy/filesearch/FileSearchTopComponent.java +++ b/FileSearch/src/org/sleuthkit/autopsy/filesearch/FileSearchTopComponent.java @@ -34,7 +34,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; diff --git a/FileSearch/src/org/sleuthkit/autopsy/filesearch/layer.xml b/FileSearch/src/org/sleuthkit/autopsy/filesearch/layer.xml index daabeca52f..c75b11a20c 100644 --- a/FileSearch/src/org/sleuthkit/autopsy/filesearch/layer.xml +++ b/FileSearch/src/org/sleuthkit/autopsy/filesearch/layer.xml @@ -1,34 +1,29 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HashDatabase/manifest.mf b/HashDatabase/manifest.mf index 896d3ff7a6..89301ef550 100644 --- a/HashDatabase/manifest.mf +++ b/HashDatabase/manifest.mf @@ -1,6 +1,7 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.hashdatabase -OpenIDE-Module-Layer: org/sleuthkit/autopsy/hashdatabase/layer.xml -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/hashdatabase/Bundle.properties -OpenIDE-Module-Specification-Version: 1.0 - +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.hashdatabase +OpenIDE-Module-Layer: org/sleuthkit/autopsy/hashdatabase/layer.xml +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/hashdatabase/Bundle.properties +OpenIDE-Module-Specification-Version: 1.0 + diff --git a/HashDatabase/nbproject/project.xml b/HashDatabase/nbproject/project.xml index d5b6fbd052..368833af6f 100644 --- a/HashDatabase/nbproject/project.xml +++ b/HashDatabase/nbproject/project.xml @@ -15,6 +15,15 @@ 1.24.1 + + org.netbeans.modules.options.api + + + + 1 + 1.26.1 + + org.openide.awt diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/Bundle.properties b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/Bundle.properties index 1246c408d4..f79a4f62fe 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/Bundle.properties +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/Bundle.properties @@ -1,33 +1,9 @@ OpenIDE-Module-Name=HashDatabase -HashDatabaseManagementPanel.okayButton.text=Okay -HashDbPanel.fileSelectButton.text=Select...\n HashDbSimplePanel.knownLabel.text=NSRL Database: HashDbSimplePanel.notableLabel.text=Known Bad Database(s): HashDbSimplePanel.knownValLabel.text=- HashDbSimplePanel.notableValLabel.text=- -HashDbMgmtPanel.addNotableButton.text=Add Known Bad Database -HashDbMgmtPanel.removeNotableButton.text=Remove Selected HashDbSimplePanel.jLabel1.text=Enable known bad databases for ingest: -HashDbMgmtPanel.nsrlNameLabel.text=Not Configured -HashDbMgmtPanel.setNSRLButton.text=Change -HashDbMgmtPanel.jLabel1.text=Known Bad Database(s): -HashDbMgmtPanel.jLabel2.text=NSRL Database: -HashDbMgmtPanel.indexNSRLButton.text=Index -HashDbMgmtPanel.removeNSRLButton.text=Remove -HashDbMgmtPanel.ingestRunningLabel.text=\ -HashDbManagementPanel.nameLabel.text=Hash DB Name: -HashDbManagementPanel.hashDbNameLabel.text=No database selected -HashDbManagementPanel.locationLabel.text=Location: -HashDbManagementPanel.hashDbLocationLabel.text=No database selected -HashDbManagementPanel.deleteButton.text=Delete -HashDbManagementPanel.useForIngestCheckbox.text=Enable for ingest -HashDbManagementPanel.showInboxMessagesCheckBox.text=Enable sending messages to inbox during ingest -HashDbManagementPanel.indexLabel.text=Index Status: -HashDbManagementPanel.indexButton.text=Index -HashDbManagementPanel.ingestRunningLabel.text= -HashDbManagementPanel.hashDbIndexStatusLabel.text=No database selected -HashDbManagementPanel.typeLabel.text=Type: -HashDbManagementPanel.hashDbTypeLabel.text=No database selected HashDbAddDatabaseDialog.cancelButton.text=Cancel HashDbAddDatabaseDialog.okButton.text=OK HashDbAddDatabaseDialog.nsrlRadioButton.text=NSRL @@ -39,7 +15,6 @@ HashDbAddDatabaseDialog.databaseNameTextField.text= HashDbAddDatabaseDialog.jLabel2.text=Select the type of database: HashDbAddDatabaseDialog.useForIngestCheckbox.text=Enable for ingest HashDbAddDatabaseDialog.sendInboxMessagesCheckbox.text=Enable sending messages to inbox during ingest -HashDbManagementPanel.importButton.text=Import HashDbSearchPanel.hashTable.columnModel.title0=MD5 Hashes HashDbSearchPanel.hashTable.columnModel.title3=Title 4 HashDbSearchPanel.hashTable.columnModel.title2=Title 3 @@ -56,3 +31,24 @@ HashDbSearchPanel.cancelButton.text=Cancel HashDbSimplePanel.calcHashesButton.text=Calculate hashes even if no hash database is selected HashDbSimplePanel.nsrlDbLabel.text=NSRL Database: HashDbSimplePanel.nsrlDbLabelVal.text=- +HashDbManagementPanel.hashDbIndexStatusLabel.text=No database selected +HashDbManagementPanel.jLabel2.text=Name: +HashDbManagementPanel.showInboxMessagesCheckBox.text=Enable sending messages to inbox during ingest +HashDbManagementPanel.useForIngestCheckbox.text=Enable for ingest +HashDbManagementPanel.indexButton.text=Index +HashDbManagementPanel.indexLabel.text=Index Status: +HashDbManagementPanel.optionsLabel.text=Options +HashDbManagementPanel.jLabel4.text=Location: +HashDbManagementPanel.jLabel6.text=Type: +HashDbManagementPanel.ingestWarningLabel.text=Ingest is ongoing, some settings will be unavailable until it finishes. +HashDbManagementPanel.hashDbTypeLabel.text=No database selected +HashDbManagementPanel.typeLabel.text=Type: +HashDbManagementPanel.deleteButton.text=Delete Database +HashDbManagementPanel.importButton.text=Import Database +HashDbManagementPanel.hashDbNameLabel.text=No database selected +HashDbManagementPanel.nameLabel.text=Name: +HashDbManagementPanel.jButton3.text=Import Database +HashDbManagementPanel.locationLabel.text=Location: +HashDbManagementPanel.hashDbLocationLabel.text=No database selected +HashDbManagementPanel.informationLabel.text=Information +HashDbManagementPanel.hashDatabasesLabel.text=Hash Databases: diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDatabaseOptionsPanelController.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDatabaseOptionsPanelController.java new file mode 100644 index 0000000000..922fc02d44 --- /dev/null +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDatabaseOptionsPanelController.java @@ -0,0 +1,104 @@ +/* + * Autopsy Forensic Browser + * + * Copyright 2011 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.sleuthkit.autopsy.hashdatabase; + +import java.beans.PropertyChangeListener; +import java.beans.PropertyChangeSupport; +import javax.swing.JComponent; +import org.netbeans.spi.options.OptionsPanelController; +import org.openide.util.HelpCtx; +import org.openide.util.Lookup; + +@OptionsPanelController.TopLevelRegistration( + categoryName = "#OptionsCategory_Name_HashDatabase", +iconBase = "org/sleuthkit/autopsy/hashdatabase/options_icon.png", +keywords = "#OptionsCategory_Keywords_HashDatabase", +keywordsCategory = "HashDatabase", +id = "HashDatabase") +@org.openide.util.NbBundle.Messages({"OptionsCategory_Name_HashDatabase=Hash Database", "OptionsCategory_Keywords_HashDatabase=Hash Database"}) +public final class HashDatabaseOptionsPanelController extends OptionsPanelController { + + private HashDbManagementPanel panel; + private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); + private boolean changed; + + @Override + public void update() { + getPanel().load(); + changed = false; + } + + @Override + public void applyChanges() { + getPanel().store(); + changed = false; + } + + @Override + public void cancel() { + // Reset the XML on cancel + HashDbXML.getCurrent().reload(); + } + + @Override + public boolean isValid() { + return getPanel().valid(); + } + + @Override + public boolean isChanged() { + return changed; + } + + @Override + public HelpCtx getHelpCtx() { + return null; // new HelpCtx("...ID") if you have a help set + } + + @Override + public JComponent getComponent(Lookup masterLookup) { + return getPanel(); + } + + @Override + public void addPropertyChangeListener(PropertyChangeListener l) { + pcs.addPropertyChangeListener(l); + } + + @Override + public void removePropertyChangeListener(PropertyChangeListener l) { + pcs.removePropertyChangeListener(l); + } + + private HashDbManagementPanel getPanel() { + if (panel == null) { + panel = new HashDbManagementPanel(); + } + return panel; + } + + void changed() { + if (!changed) { + changed = true; + pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true); + } + pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null); + } +} diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDb.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDb.java index 76aefa2b70..a178b4f0a9 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDb.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDb.java @@ -1,289 +1,285 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.hashdatabase; - -import java.io.File; -import java.util.List; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutionException; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.SwingUtilities; -import javax.swing.SwingWorker; -import org.netbeans.api.progress.ProgressHandle; -import org.netbeans.api.progress.ProgressHandleFactory; -import org.openide.util.Cancellable; -import org.sleuthkit.autopsy.coreutils.Log; -import org.sleuthkit.datamodel.SleuthkitJNI; -import org.sleuthkit.datamodel.TskException; - -/** - * - * @author dfickling - */ -public class HashDb implements Comparable { - - public enum DBType{ - NSRL("NSRL"), KNOWN_BAD("Known Bad"); - - private String displayName; - - private DBType(String displayName) { - this.displayName = displayName; - } - - public String getDisplayName() { - return this.displayName; - } - } - - // Suffix added to the end of a database name to get its index file - private static final String INDEX_SUFFIX = "-md5.idx"; - - private String name; - private List databasePaths; // TODO: Length limited to one for now... - private boolean useForIngest; - private boolean showInboxMessages; - private boolean indexing; - private DBType type; - - public HashDb(String name, List databasePaths, boolean useForIngest, boolean showInboxMessages, DBType type) { - this.name = name; - this.databasePaths = databasePaths; - this.useForIngest = useForIngest; - this.showInboxMessages = showInboxMessages; - this.type = type; - this.indexing = false; - } - - boolean getUseForIngest() { - return useForIngest; - } - - boolean getShowInboxMessages() { - return showInboxMessages; - } - - DBType getDbType() { - return type; - } - - String getName() { - return name; - } - - List getDatabasePaths() { - return databasePaths; - } - - void setUseForIngest(boolean useForIngest) { - this.useForIngest = useForIngest; - } - - void setShowInboxMessages(boolean showInboxMessages) { - this.showInboxMessages = showInboxMessages; - } - - void setName(String name) { - this.name = name; - } - - void setDatabasePaths(List databasePaths) { - this.databasePaths = databasePaths; - } - - void setDbType(DBType type) { - this.type = type; - } - - /** - * Checks if the database exists. - * @return true if a file exists at the database path, else false - */ - boolean databaseExists() { - return databaseFile().exists(); - } - - /** - * Checks if Sleuth Kit can open the index for the database path. - * @return true if the index was found and opened successfully, else false - */ - boolean indexExists() { - try { - return hasIndex(databasePaths.get(0)); // TODO: support multiple paths - } catch (TskException ex) { - Log.get(this.getClass()).log(Level.WARNING, "Error checking if index exists.", ex); - return false; - } - } - - /** - * Gets the database file. - * @return a File initialized with the database path - */ - File databaseFile() { - return new File(databasePaths.get(0)); // TODO: support multiple paths - } - - /** - * Gets the index file - * @return a File initialized with an index path derived from the database - * path - */ - File indexFile() { - return new File(toIndexPath(databasePaths.get(0))); // TODO: support multiple paths - } - - /** - * Checks if the index file is older than the database file - * @return true if there is are files at the index path and the database - * path, and the index file has an older modified-time than the database - * file, else false - */ - boolean isOutdated() { - File i = indexFile(); - File db = databaseFile(); - - return i.exists() && db.exists() && isOlderThan(i, db); - } - - /** - * Checks if the database is being indexed - */ - boolean isIndexing() { - return indexing; - } - - /** - * Returns the status of the HashDb as determined from indexExists(), - * databaseExists(), and isOutdated() - * @return IndexStatus enum according to their definitions - */ - IndexStatus status() { - boolean i = this.indexExists(); - boolean db = this.databaseExists(); - - if(indexing) - return IndexStatus.INDEXING; - if (i) { - if (db) { - return this.isOutdated() ? IndexStatus.INDEX_OUTDATED : IndexStatus.INDEX_CURRENT; - } else { - return IndexStatus.NO_DB; - } - } else { - return db ? IndexStatus.NO_INDEX : IndexStatus.NONE; - } - } - - /** - * Tries to index the database (overwrites any existing index) - * @throws TskException if an error occurs in the SleuthKit bindings - */ - void createIndex() throws TskException { - indexing = true; - CreateIndex creator = new CreateIndex(); - creator.execute(); - } - - /** - * Checks if one file is older than an other - * @param a first file - * @param b second file - * @return true if the first file's last modified data is before the second - * file's last modified date - */ - private static boolean isOlderThan(File a, File b) { - return a.lastModified() < b.lastModified(); - } - - /** - * Determines if a path points to an index by checking the suffix - * @param path - * @return true if index - */ - static boolean isIndexPath(String path) { - return path.endsWith(INDEX_SUFFIX); - } - - /** - * Derives database path from an image path by removing the suffix. - * @param indexPath - * @return - */ - static String toDatabasePath(String indexPath) { - return indexPath.substring(0, indexPath.lastIndexOf(INDEX_SUFFIX)); - } - - /** - * Derives image path from an database path by appending the suffix. - * @param databasePath - * @return - */ - static String toIndexPath(String databasePath) { - return databasePath.concat(INDEX_SUFFIX); - } - - /** - * Calls Sleuth Kit method via JNI to determine whether there is an - * index for the given path - * @param databasePath path Path for the database the index is of - * (database doesn't have to actually exist)' - * @return true if index exists - * @throws TskException if there is an error in the JNI call - */ - static boolean hasIndex(String databasePath) throws TskException { - return SleuthkitJNI.lookupIndexExists(databasePath); - } - - @Override - public int compareTo(HashDb o) { - return this.name.compareTo(o.name); - } - - /* Thread that creates a database's index */ - private class CreateIndex extends SwingWorker { - - private ProgressHandle progress; - - CreateIndex(){}; - - @Override - protected Object doInBackground() throws Exception { - progress = ProgressHandleFactory.createHandle("Indexing " + name, new Cancellable() { - @Override - public boolean cancel() { - return CreateIndex.this.cancel(true); - } - }); - progress.start(); - progress.switchToIndeterminate(); - SleuthkitJNI.createLookupIndex(databasePaths.get(0)); - return null; - } - - /* clean up or start the worker threads */ - @Override - protected void done() { - indexing = false; - progress.finish(); - HashDbManagementPanel.getDefault().resync(); - } - } +/* + * Autopsy Forensic Browser + * + * Copyright 2011 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.hashdatabase; + +import java.io.File; +import java.util.List; +import java.util.logging.Level; +import javax.swing.SwingWorker; +import org.netbeans.api.progress.ProgressHandle; +import org.netbeans.api.progress.ProgressHandleFactory; +import org.openide.util.Cancellable; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.datamodel.SleuthkitJNI; +import org.sleuthkit.datamodel.TskException; + +/** + * + * @author dfickling + */ +public class HashDb implements Comparable { + + public enum DBType{ + NSRL("NSRL"), KNOWN_BAD("Known Bad"); + + private String displayName; + + private DBType(String displayName) { + this.displayName = displayName; + } + + public String getDisplayName() { + return this.displayName; + } + } + + // Suffix added to the end of a database name to get its index file + private static final String INDEX_SUFFIX = "-md5.idx"; + + private String name; + private List databasePaths; // TODO: Length limited to one for now... + private boolean useForIngest; + private boolean showInboxMessages; + private boolean indexing; + private DBType type; + + public HashDb(String name, List databasePaths, boolean useForIngest, boolean showInboxMessages, DBType type) { + this.name = name; + this.databasePaths = databasePaths; + this.useForIngest = useForIngest; + this.showInboxMessages = showInboxMessages; + this.type = type; + this.indexing = false; + } + + boolean getUseForIngest() { + return useForIngest; + } + + boolean getShowInboxMessages() { + return showInboxMessages; + } + + DBType getDbType() { + return type; + } + + String getName() { + return name; + } + + List getDatabasePaths() { + return databasePaths; + } + + void setUseForIngest(boolean useForIngest) { + this.useForIngest = useForIngest; + } + + void setShowInboxMessages(boolean showInboxMessages) { + this.showInboxMessages = showInboxMessages; + } + + void setName(String name) { + this.name = name; + } + + void setDatabasePaths(List databasePaths) { + this.databasePaths = databasePaths; + } + + void setDbType(DBType type) { + this.type = type; + } + + /** + * Checks if the database exists. + * @return true if a file exists at the database path, else false + */ + boolean databaseExists() { + return databaseFile().exists(); + } + + /** + * Checks if Sleuth Kit can open the index for the database path. + * @return true if the index was found and opened successfully, else false + */ + boolean indexExists() { + try { + return hasIndex(databasePaths.get(0)); // TODO: support multiple paths + } catch (TskException ex) { + Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "Error checking if index exists.", ex); + return false; + } + } + + /** + * Gets the database file. + * @return a File initialized with the database path + */ + File databaseFile() { + return new File(databasePaths.get(0)); // TODO: support multiple paths + } + + /** + * Gets the index file + * @return a File initialized with an index path derived from the database + * path + */ + File indexFile() { + return new File(toIndexPath(databasePaths.get(0))); // TODO: support multiple paths + } + + /** + * Checks if the index file is older than the database file + * @return true if there is are files at the index path and the database + * path, and the index file has an older modified-time than the database + * file, else false + */ + boolean isOutdated() { + File i = indexFile(); + File db = databaseFile(); + + return i.exists() && db.exists() && isOlderThan(i, db); + } + + /** + * Checks if the database is being indexed + */ + boolean isIndexing() { + return indexing; + } + + /** + * Returns the status of the HashDb as determined from indexExists(), + * databaseExists(), and isOutdated() + * @return IndexStatus enum according to their definitions + */ + IndexStatus status() { + boolean i = this.indexExists(); + boolean db = this.databaseExists(); + + if(indexing) + return IndexStatus.INDEXING; + if (i) { + if (db) { + return this.isOutdated() ? IndexStatus.INDEX_OUTDATED : IndexStatus.INDEX_CURRENT; + } else { + return IndexStatus.NO_DB; + } + } else { + return db ? IndexStatus.NO_INDEX : IndexStatus.NONE; + } + } + + /** + * Tries to index the database (overwrites any existing index) + * @throws TskException if an error occurs in the SleuthKit bindings + */ + void createIndex() throws TskException { + indexing = true; + CreateIndex creator = new CreateIndex(); + creator.execute(); + } + + /** + * Checks if one file is older than an other + * @param a first file + * @param b second file + * @return true if the first file's last modified data is before the second + * file's last modified date + */ + private static boolean isOlderThan(File a, File b) { + return a.lastModified() < b.lastModified(); + } + + /** + * Determines if a path points to an index by checking the suffix + * @param path + * @return true if index + */ + static boolean isIndexPath(String path) { + return path.endsWith(INDEX_SUFFIX); + } + + /** + * Derives database path from an image path by removing the suffix. + * @param indexPath + * @return + */ + static String toDatabasePath(String indexPath) { + return indexPath.substring(0, indexPath.lastIndexOf(INDEX_SUFFIX)); + } + + /** + * Derives image path from an database path by appending the suffix. + * @param databasePath + * @return + */ + static String toIndexPath(String databasePath) { + return databasePath.concat(INDEX_SUFFIX); + } + + /** + * Calls Sleuth Kit method via JNI to determine whether there is an + * index for the given path + * @param databasePath path Path for the database the index is of + * (database doesn't have to actually exist)' + * @return true if index exists + * @throws TskException if there is an error in the JNI call + */ + static boolean hasIndex(String databasePath) throws TskException { + return SleuthkitJNI.lookupIndexExists(databasePath); + } + + @Override + public int compareTo(HashDb o) { + return this.name.compareTo(o.name); + } + + /* Thread that creates a database's index */ + private class CreateIndex extends SwingWorker { + + private ProgressHandle progress; + + CreateIndex(){}; + + @Override + protected Object doInBackground() throws Exception { + progress = ProgressHandleFactory.createHandle("Indexing " + name, new Cancellable() { + @Override + public boolean cancel() { + return CreateIndex.this.cancel(true); + } + }); + progress.start(); + progress.switchToIndeterminate(); + SleuthkitJNI.createLookupIndex(databasePaths.get(0)); + return null; + } + + /* clean up or start the worker threads */ + @Override + protected void done() { + indexing = false; + progress.finish(); + // TODO: Fire property event telling to resync + } + } } \ No newline at end of file diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbAddDatabaseDialog.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbAddDatabaseDialog.java index fde152a6a2..190903862f 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbAddDatabaseDialog.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbAddDatabaseDialog.java @@ -1,7 +1,22 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2011 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.sleuthkit.autopsy.hashdatabase; import java.awt.Dimension; @@ -10,7 +25,7 @@ import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.filechooser.FileNameExtensionFilter; diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java index 7aed58ea4b..42246b4e74 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbIngestModule.java @@ -23,7 +23,9 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.netbeans.api.options.OptionsDisplayer; +import org.netbeans.spi.options.OptionsPanelController; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.ingest.IngestMessage; @@ -64,6 +66,7 @@ public class HashDbIngestModule implements IngestModuleAbstractFile { static long calctime = 0; static long lookuptime = 0; private Map knownBadSets = new HashMap(); + private HashDbManagementPanel panel; private HashDbIngestModule() { @@ -81,8 +84,9 @@ public class HashDbIngestModule implements IngestModuleAbstractFile { @Override public void init(IngestModuleInit initContext) { services = IngestServices.getDefault(); - HashDbManagementPanel.getDefault().setIngestRunning(true); + getPanel().setIngestRunning(true); HashDbSimplePanel.setIngestRunning(true); + HashDbSearchPanel.getDefault().setIngestRunning(true); this.services.postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, this, "Started")); this.skCase = Case.getCurrentCase().getSleuthkitCase(); try { @@ -150,8 +154,9 @@ public class HashDbIngestModule implements IngestModuleAbstractFile { detailsSb.append(""); services.postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, this, "Hash Ingest Complete", detailsSb.toString())); - HashDbManagementPanel.getDefault().setIngestRunning(false); + getPanel().setIngestRunning(false); HashDbSimplePanel.setIngestRunning(false); + HashDbSearchPanel.getDefault().setIngestRunning(false); } /** @@ -160,8 +165,9 @@ public class HashDbIngestModule implements IngestModuleAbstractFile { @Override public void stop() { //manager.postMessage(IngestMessage.createMessage(++messageId, IngestMessage.MessageType.INFO, this, "STOP")); - HashDbManagementPanel.getDefault().setIngestRunning(false); + getPanel().setIngestRunning(false); HashDbSimplePanel.setIngestRunning(false); + HashDbSearchPanel.getDefault().setIngestRunning(false); } /** @@ -213,20 +219,32 @@ public class HashDbIngestModule implements IngestModuleAbstractFile { @Override public javax.swing.JPanel getSimpleConfiguration() { + HashDbXML.getCurrent().reload(); return new HashDbSimplePanel(); } @Override public javax.swing.JPanel getAdvancedConfiguration() { - return HashDbManagementPanel.getDefault(); + //return HashDbManagementPanel.getDefault(); + getPanel().load(); + return getPanel(); } @Override public void saveAdvancedConfiguration() { + getPanel().store(); + } + + private HashDbManagementPanel getPanel() { + if (panel == null) { + panel = new HashDbManagementPanel(); + } + return panel; } @Override public void saveSimpleConfiguration() { + HashDbXML.getCurrent().save(); } private void processBadFile(AbstractFile abstractFile, String md5Hash, String hashSetName, boolean showInboxMessage) { diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManagementPanel.form b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManagementPanel.form index 0d9daa6e96..d6ae762c3f 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManagementPanel.form +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManagementPanel.form @@ -1,11 +1,49 @@ -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -16,299 +54,318 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - + - + - + - + - + - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManagementPanel.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManagementPanel.java index 523ceeaf37..e1b924e559 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManagementPanel.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbManagementPanel.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * + * * Copyright 2011 Basis Technology Corp. * Contact: carrier sleuthkit org - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,60 +17,37 @@ * limitations under the License. */ -/* - * HashDbManagementPanel.java - * - * Created on Jun 18, 2012, 12:13:03 PM - */ package org.sleuthkit.autopsy.hashdatabase; import java.awt.event.KeyEvent; import java.io.File; -import java.io.IOException; -import java.util.Arrays; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JButton; -import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JOptionPane; -import javax.swing.JTextField; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.table.AbstractTableModel; -import org.sleuthkit.autopsy.hashdatabase.HashDb.DBType; -import org.sleuthkit.datamodel.SleuthkitJNI; +import org.sleuthkit.autopsy.corecomponents.OptionsPanel; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.TskException; -/** - * - * @author dfickling - */ -public class HashDbManagementPanel extends javax.swing.JPanel { +final class HashDbManagementPanel extends javax.swing.JPanel implements OptionsPanel { private HashSetTableModel hashSetTableModel; private static final Logger logger = Logger.getLogger(HashDbManagementPanel.class.getName()); - private static HashDbManagementPanel instance; private static boolean ingestRunning = false; - public static HashDbManagementPanel getDefault() { - if (instance == null) { - instance = new HashDbManagementPanel(); - } - return instance; - } - - /** Creates new form HashDbManagementPanel */ - private HashDbManagementPanel() { - setName(HashDbMgmtAction.ACTION_NAME); + HashDbManagementPanel() { this.hashSetTableModel = new HashSetTableModel(); initComponents(); customizeComponents(); } - + private void customizeComponents() { + setName("Hash Database Configuration"); + this.ingestWarningLabel.setVisible(false); this.hashSetTable.setModel(hashSetTableModel); this.hashSetTable.setTableHeader(null); hashSetTable.getParent().setBackground(hashSetTable.getBackground()); @@ -96,7 +73,7 @@ public class HashDbManagementPanel extends javax.swing.JPanel { private void initUI(HashDb db) { boolean useForIngestEnabled = db != null && !ingestRunning; boolean useForIngestSelected = db != null && db.getUseForIngest(); - boolean showInboxMessagesEnabled = db != null && !ingestRunning && useForIngestSelected && db.getDbType().equals(DBType.KNOWN_BAD); + boolean showInboxMessagesEnabled = db != null && !ingestRunning && useForIngestSelected && db.getDbType().equals(HashDb.DBType.KNOWN_BAD); boolean showInboxMessagesSelected = db != null && db.getShowInboxMessages(); boolean deleteButtonEnabled = db != null && !ingestRunning; boolean importButtonEnabled = !ingestRunning; @@ -124,6 +101,8 @@ public class HashDbManagementPanel extends javax.swing.JPanel { this.showInboxMessagesCheckBox.setEnabled(showInboxMessagesEnabled); this.deleteButton.setEnabled(deleteButtonEnabled); this.importButton.setEnabled(importButtonEnabled); + this.optionsLabel.setEnabled(useForIngestEnabled || showInboxMessagesEnabled); + this.optionsSeparator.setEnabled(useForIngestEnabled || showInboxMessagesEnabled); } /** @@ -131,11 +110,7 @@ public class HashDbManagementPanel extends javax.swing.JPanel { */ void setIngestRunning(boolean running) { ingestRunning = running; - if(running) { - ingestRunningLabel.setText("Ingest is ongoing; some settings will be unavailable until it finishes."); - } else { - ingestRunningLabel.setText(""); - } + ingestWarningLabel.setVisible(running); int selection = getSelection(); if(selection != -1) { @@ -143,36 +118,53 @@ public class HashDbManagementPanel extends javax.swing.JPanel { } } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ - @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents private void initComponents() { - jSplitPane1 = new javax.swing.JSplitPane(); - leftPanel = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jButton3 = new javax.swing.JButton(); + ingestWarningLabel = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); hashSetTable = new javax.swing.JTable(); + deleteButton = new javax.swing.JButton(); importButton = new javax.swing.JButton(); - rightPanel = new javax.swing.JPanel(); + hashDatabasesLabel = new javax.swing.JLabel(); nameLabel = new javax.swing.JLabel(); hashDbNameLabel = new javax.swing.JLabel(); - locationLabel = new javax.swing.JLabel(); hashDbLocationLabel = new javax.swing.JLabel(); - useForIngestCheckbox = new javax.swing.JCheckBox(); - showInboxMessagesCheckBox = new javax.swing.JCheckBox(); - indexLabel = new javax.swing.JLabel(); - indexButton = new javax.swing.JButton(); - ingestRunningLabel = new javax.swing.JLabel(); - hashDbIndexStatusLabel = new javax.swing.JLabel(); + locationLabel = new javax.swing.JLabel(); typeLabel = new javax.swing.JLabel(); hashDbTypeLabel = new javax.swing.JLabel(); - deleteButton = new javax.swing.JButton(); + hashDbIndexStatusLabel = new javax.swing.JLabel(); + indexLabel = new javax.swing.JLabel(); + indexButton = new javax.swing.JButton(); + useForIngestCheckbox = new javax.swing.JCheckBox(); + showInboxMessagesCheckBox = new javax.swing.JCheckBox(); + informationLabel = new javax.swing.JLabel(); + optionsLabel = new javax.swing.JLabel(); + informationSeparator = new javax.swing.JSeparator(); + optionsSeparator = new javax.swing.JSeparator(); - jScrollPane1.setBackground(new java.awt.Color(255, 255, 255)); + org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.jLabel2.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.jLabel4.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.jLabel6.text")); // NOI18N + + jButton3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(jButton3, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.jButton3.text")); // NOI18N + + setMinimumSize(new java.awt.Dimension(385, 500)); + + ingestWarningLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/warning16.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(ingestWarningLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.ingestWarningLabel.text")); // NOI18N hashSetTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -182,8 +174,6 @@ public class HashDbManagementPanel extends javax.swing.JPanel { } )); - hashSetTable.setShowHorizontalLines(false); - hashSetTable.setShowVerticalLines(false); hashSetTable.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { hashSetTableKeyPressed(evt); @@ -191,60 +181,47 @@ public class HashDbManagementPanel extends javax.swing.JPanel { }); jScrollPane1.setViewportView(hashSetTable); - importButton.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.importButton.text")); // NOI18N + deleteButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/delete16.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(deleteButton, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.deleteButton.text")); // NOI18N + deleteButton.setMaximumSize(new java.awt.Dimension(140, 25)); + deleteButton.setMinimumSize(new java.awt.Dimension(140, 25)); + deleteButton.setPreferredSize(new java.awt.Dimension(140, 25)); + deleteButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + deleteButtonActionPerformed(evt); + } + }); + + importButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/hashdatabase/import16.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(importButton, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.importButton.text")); // NOI18N + importButton.setMaximumSize(new java.awt.Dimension(140, 25)); + importButton.setMinimumSize(new java.awt.Dimension(140, 25)); + importButton.setPreferredSize(new java.awt.Dimension(140, 25)); importButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { importButtonActionPerformed(evt); } }); - javax.swing.GroupLayout leftPanelLayout = new javax.swing.GroupLayout(leftPanel); - leftPanel.setLayout(leftPanelLayout); - leftPanelLayout.setHorizontalGroup( - leftPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, leftPanelLayout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(importButton) - .addGap(55, 55, 55)) - ); - leftPanelLayout.setVerticalGroup( - leftPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, leftPanelLayout.createSequentialGroup() - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE) - .addGap(0, 0, 0) - .addComponent(importButton)) - ); + org.openide.awt.Mnemonics.setLocalizedText(hashDatabasesLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.hashDatabasesLabel.text")); // NOI18N - jSplitPane1.setLeftComponent(leftPanel); + org.openide.awt.Mnemonics.setLocalizedText(nameLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.nameLabel.text")); // NOI18N - nameLabel.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.nameLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(hashDbNameLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.hashDbNameLabel.text")); // NOI18N - hashDbNameLabel.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.hashDbNameLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(hashDbLocationLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.hashDbLocationLabel.text")); // NOI18N - locationLabel.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.locationLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(locationLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.locationLabel.text")); // NOI18N - hashDbLocationLabel.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.hashDbLocationLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(typeLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.typeLabel.text")); // NOI18N - useForIngestCheckbox.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.useForIngestCheckbox.text")); // NOI18N - useForIngestCheckbox.setEnabled(false); - useForIngestCheckbox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - useForIngestCheckboxActionPerformed(evt); - } - }); + org.openide.awt.Mnemonics.setLocalizedText(hashDbTypeLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.hashDbTypeLabel.text")); // NOI18N - showInboxMessagesCheckBox.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.showInboxMessagesCheckBox.text")); // NOI18N - showInboxMessagesCheckBox.setEnabled(false); - showInboxMessagesCheckBox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - showInboxMessagesCheckBoxActionPerformed(evt); - } - }); + org.openide.awt.Mnemonics.setLocalizedText(hashDbIndexStatusLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.hashDbIndexStatusLabel.text")); // NOI18N - indexLabel.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.indexLabel.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(indexLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.indexLabel.text")); // NOI18N - indexButton.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.indexButton.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(indexButton, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.indexButton.text")); // NOI18N indexButton.setEnabled(false); indexButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -252,108 +229,136 @@ public class HashDbManagementPanel extends javax.swing.JPanel { } }); - ingestRunningLabel.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.ingestRunningLabel.text")); // NOI18N - - hashDbIndexStatusLabel.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.hashDbIndexStatusLabel.text")); // NOI18N - - typeLabel.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.typeLabel.text")); // NOI18N - - hashDbTypeLabel.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.hashDbTypeLabel.text")); // NOI18N - - deleteButton.setText(org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.deleteButton.text")); // NOI18N - deleteButton.setEnabled(false); - deleteButton.addActionListener(new java.awt.event.ActionListener() { + org.openide.awt.Mnemonics.setLocalizedText(useForIngestCheckbox, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.useForIngestCheckbox.text")); // NOI18N + useForIngestCheckbox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { - deleteButtonActionPerformed(evt); + useForIngestCheckboxActionPerformed(evt); } }); - javax.swing.GroupLayout rightPanelLayout = new javax.swing.GroupLayout(rightPanel); - rightPanel.setLayout(rightPanelLayout); - rightPanelLayout.setHorizontalGroup( - rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(rightPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(rightPanelLayout.createSequentialGroup() - .addGroup(rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(rightPanelLayout.createSequentialGroup() - .addComponent(nameLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(hashDbNameLabel)) - .addGroup(rightPanelLayout.createSequentialGroup() - .addComponent(locationLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(hashDbLocationLabel)) - .addGroup(rightPanelLayout.createSequentialGroup() - .addComponent(ingestRunningLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(useForIngestCheckbox)) - .addGroup(rightPanelLayout.createSequentialGroup() - .addComponent(typeLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(hashDbTypeLabel)) - .addGroup(rightPanelLayout.createSequentialGroup() - .addGap(10, 10, 10) - .addComponent(indexButton)) - .addGroup(rightPanelLayout.createSequentialGroup() - .addComponent(indexLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(hashDbIndexStatusLabel))) - .addGap(0, 0, Short.MAX_VALUE)) - .addGroup(rightPanelLayout.createSequentialGroup() - .addComponent(showInboxMessagesCheckBox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE) - .addComponent(deleteButton))) - .addContainerGap()) - ); - rightPanelLayout.setVerticalGroup( - rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(rightPanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(nameLabel) - .addComponent(hashDbNameLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(locationLabel) - .addComponent(hashDbLocationLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(typeLabel) - .addComponent(hashDbTypeLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(indexLabel) - .addComponent(hashDbIndexStatusLabel)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(indexButton) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 138, Short.MAX_VALUE) - .addComponent(ingestRunningLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 36, Short.MAX_VALUE) - .addComponent(useForIngestCheckbox) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(rightPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(deleteButton) - .addComponent(showInboxMessagesCheckBox))) - ); + org.openide.awt.Mnemonics.setLocalizedText(showInboxMessagesCheckBox, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.showInboxMessagesCheckBox.text")); // NOI18N + showInboxMessagesCheckBox.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + showInboxMessagesCheckBoxActionPerformed(evt); + } + }); - jSplitPane1.setRightComponent(rightPanel); + org.openide.awt.Mnemonics.setLocalizedText(informationLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.informationLabel.text")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(optionsLabel, org.openide.util.NbBundle.getMessage(HashDbManagementPanel.class, "HashDbManagementPanel.optionsLabel.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jSplitPane1) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(importButton, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(ingestWarningLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 358, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(indexButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(nameLabel, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(locationLabel, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(typeLabel, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(indexLabel)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(hashDbTypeLabel) + .addComponent(hashDbLocationLabel) + .addComponent(hashDbNameLabel) + .addComponent(hashDbIndexStatusLabel))) + .addComponent(useForIngestCheckbox) + .addComponent(showInboxMessagesCheckBox))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addComponent(informationLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(informationSeparator)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() + .addComponent(optionsLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(optionsSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addComponent(hashDatabasesLabel)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jSplitPane1) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(hashDatabasesLabel) + .addGap(6, 6, 6) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(informationLabel) + .addGroup(layout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(informationSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(7, 7, 7) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(nameLabel) + .addComponent(hashDbNameLabel)) + .addGap(5, 5, 5) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(locationLabel) + .addComponent(hashDbLocationLabel)) + .addGap(5, 5, 5) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(typeLabel) + .addComponent(hashDbTypeLabel)) + .addGap(5, 5, 5) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(indexLabel) + .addComponent(hashDbIndexStatusLabel)) + .addGap(5, 5, 5) + .addComponent(indexButton) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(optionsLabel) + .addGroup(layout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(optionsSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(useForIngestCheckbox) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(showInboxMessagesCheckBox) + .addGap(18, 18, 18) + .addComponent(ingestWarningLabel) + .addGap(0, 0, Short.MAX_VALUE)) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 422, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(importButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) ); }// //GEN-END:initComponents + private void indexButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_indexButtonActionPerformed + int selected = getSelection(); + HashDb current = HashDbXML.getCurrent().getAllSets().get(selected); + try { + current.createIndex(); + } catch (TskException ex) { + logger.log(Level.WARNING, "Error creating index", ex); + } + setButtonFromIndexStatus(indexButton, this.hashDbIndexStatusLabel, current.status()); + }//GEN-LAST:event_indexButtonActionPerformed + private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed - if (JOptionPane.showConfirmDialog(null, "This will remove the hash database entry globally (for all Cases).", + if (JOptionPane.showConfirmDialog(null, "This will remove the hash database entry globally (for all Cases). Do you want to proceed? ", "Deleting a Hash Database Entry", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION) { @@ -432,23 +437,29 @@ public class HashDbManagementPanel extends javax.swing.JPanel { } }//GEN-LAST:event_showInboxMessagesCheckBoxActionPerformed - private void indexButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_indexButtonActionPerformed - int selected = getSelection(); - HashDb current = HashDbXML.getCurrent().getAllSets().get(selected); - try { - current.createIndex(); - } catch (TskException ex) { - logger.log(Level.WARNING, "Error creating index", ex); - } - setButtonFromIndexStatus(indexButton, this.hashDbIndexStatusLabel, current.status()); - }//GEN-LAST:event_indexButtonActionPerformed - private void importButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importButtonActionPerformed importHashSet(evt); }//GEN-LAST:event_importButtonActionPerformed + @Override + public void load() { + hashSetTable.clearSelection(); // Deselect all rows + HashDbXML.getCurrent().reload(); // Reload XML + initUI(null); // Update the UI + } + + @Override + public void store() { + HashDbXML.getCurrent().save(); + } + + boolean valid() { + // TODO check whether form is consistent and complete + return true; + } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton deleteButton; + private javax.swing.JLabel hashDatabasesLabel; private javax.swing.JLabel hashDbIndexStatusLabel; private javax.swing.JLabel hashDbLocationLabel; private javax.swing.JLabel hashDbNameLabel; @@ -457,18 +468,22 @@ public class HashDbManagementPanel extends javax.swing.JPanel { private javax.swing.JButton importButton; private javax.swing.JButton indexButton; private javax.swing.JLabel indexLabel; - private javax.swing.JLabel ingestRunningLabel; + private javax.swing.JLabel informationLabel; + private javax.swing.JSeparator informationSeparator; + private javax.swing.JLabel ingestWarningLabel; + private javax.swing.JButton jButton3; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel6; private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JSplitPane jSplitPane1; - private javax.swing.JPanel leftPanel; private javax.swing.JLabel locationLabel; private javax.swing.JLabel nameLabel; - private javax.swing.JPanel rightPanel; + private javax.swing.JLabel optionsLabel; + private javax.swing.JSeparator optionsSeparator; private javax.swing.JCheckBox showInboxMessagesCheckBox; private javax.swing.JLabel typeLabel; private javax.swing.JCheckBox useForIngestCheckbox; // End of variables declaration//GEN-END:variables - private void importHashSet(java.awt.event.ActionEvent evt) { new HashDbAddDatabaseDialog().display(); hashSetTableModel.resync(); @@ -569,6 +584,7 @@ public class HashDbManagementPanel extends javax.swing.JPanel { } } void resync() { + // TODO: call this function from property event listener int index = getSelection(); this.hashSetTableModel.resync(); setSelection(index); diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbMgmtAction.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbMgmtAction.java deleted file mode 100644 index 62d6be6e7c..0000000000 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbMgmtAction.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.hashdatabase; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import org.openide.util.HelpCtx; -import org.openide.util.actions.CallableSystemAction; -import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; -import org.sleuthkit.autopsy.coreutils.Log; - -/** - * The HashDbMgmtAction opens the HashDbMgmtPanel in a dialog, and saves the - * settings of the panel if the Apply button is clicked. - * @author pmartel - */ -class HashDbMgmtAction extends CallableSystemAction { - - static final String ACTION_NAME = "Hash Database Configuration"; - - @Override - public void performAction() { - final HashDbManagementPanel panel = HashDbManagementPanel.getDefault(); - final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(); - dialog.addApplyButtonListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - dialog.close(); - } - }); - dialog.display(panel); - } - - @Override - public String getName() { - return ACTION_NAME; - } - - @Override - public HelpCtx getHelpCtx() { - return HelpCtx.DEFAULT_HELP; - } - - @Override - protected boolean asynchronous() { - return false; - } -} diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchPanel.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchPanel.java index 26e20f8a21..cc79736d54 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchPanel.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchPanel.java @@ -24,7 +24,7 @@ import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.ArrayList; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import javax.swing.text.AttributeSet; @@ -121,6 +121,7 @@ public class HashDbSearchPanel extends javax.swing.JPanel implements ActionListe removeButton.setEnabled(!ingestRunning); hashTable.setEnabled(!ingestRunning); hashLabel.setEnabled(!ingestRunning); + saveBox.setEnabled(!ingestRunning); } /** diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchThread.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchThread.java index 8e3a02a1ff..d0de68c86d 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchThread.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSearchThread.java @@ -23,7 +23,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.CancellationException; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JOptionPane; import javax.swing.SwingWorker; import org.netbeans.api.progress.ProgressHandle; diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSimplePanel.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSimplePanel.java index 74f1e35fc9..fec6893777 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSimplePanel.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbSimplePanel.java @@ -27,7 +27,7 @@ package org.sleuthkit.autopsy.hashdatabase; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JOptionPane; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableColumn; diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbXML.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbXML.java index 87b3e607dc..8e783f92e6 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbXML.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbXML.java @@ -1,413 +1,413 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.hashdatabase; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Result; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import org.sleuthkit.autopsy.coreutils.AutopsyPropFile; -import org.sleuthkit.autopsy.hashdatabase.HashDb.DBType; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -/** - * - * @author dfickling - */ -public class HashDbXML { - private static final String ROOT_EL = "hash_sets"; - private static final String SET_EL = "hash_set"; - private static final String SET_NAME_ATTR = "name"; - private static final String SET_TYPE_ATTR = "type"; - private static final String SET_USE_FOR_INGEST_ATTR = "use_for_ingest"; - private static final String SET_SHOW_INBOX_MESSAGES = "show_inbox_messages"; - private static final String PATH_EL = "hash_set_path"; - private static final String PATH_NUMBER_ATTR = "number"; - private static final String CUR_HASHSETS_FILE_NAME = "hashsets.xml"; - private static final String ENCODING = "UTF-8"; - private static final String CUR_HASHSET_FILE = AutopsyPropFile.getUserDirPath() + File.separator + CUR_HASHSETS_FILE_NAME; - private static final String SET_CALC = "hash_calculate"; - private static final String SET_VALUE = "value"; - private static final Logger logger = Logger.getLogger(HashDbXML.class.getName()); - private static HashDbXML currentInstance; - - private List knownBadSets; - private HashDb nsrlSet; - private String xmlFile; - private boolean calculate; - - private HashDbXML(String xmlFile) { - knownBadSets = new ArrayList(); - this.xmlFile = xmlFile; - } - - /** - * get instance for managing the current keyword list of the application - */ - static synchronized HashDbXML getCurrent() { - if (currentInstance == null) { - currentInstance = new HashDbXML(CUR_HASHSET_FILE); - currentInstance.reload(); - } - return currentInstance; - } - - /** - * Get the hash sets - */ - public List getAllSets() { - List ret = new ArrayList(); - if(nsrlSet != null) { - ret.add(nsrlSet); - } - ret.addAll(knownBadSets); - return ret; - } - - /** - * Get the Known Bad sets - */ - public List getKnownBadSets() { - return knownBadSets; - } - - /** - * Get the NSRL set - */ - public HashDb getNSRLSet() { - return nsrlSet; - } - - /** - * Add a known bad hash set - */ - public void addKnownBadSet(HashDb set) { - knownBadSets.add(set); - save(); - } - - /** - * Add a known bad hash set - */ - public void addKnownBadSet(int index, HashDb set) { - knownBadSets.add(index, set); - save(); - } - - /** - * Set the NSRL hash set (override old set) - */ - public void setNSRLSet(HashDb set) { - this.nsrlSet = set; - save(); - } - - /** - * Remove a hash known bad set - */ - public void removeKnownBadSetAt(int index) { - knownBadSets.remove(index); - save(); - } - - /** - * Remove the NSRL database - */ - public void removeNSRLSet() { - this.nsrlSet = null; - save(); - } - - /** - * load the file or create new - */ - public void reload() { - boolean created = false; - - knownBadSets.clear(); - nsrlSet = null; - - if (!this.setsFileExists()) { - //create new if it doesn't exist - save(); - created = true; - } - - //load, if fails to load create new - if (!load() && !created) { - //create new if failed to load - save(); - } - } - - /** - * Sets the local variable calculate to the given boolean. - * @param set the state to make calculate - */ - public void setCalculate(boolean set) { - this.calculate = set; - save(); - } - - /** - * Returns the value of the local boolean calculate. - * @return true if calculate is true, false otherwise - */ - public boolean getCalculate() { - return this.calculate; - } - - /** - * writes out current sets file replacing the last one - */ - private boolean save() { - boolean success = false; - - DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); - - try { - DocumentBuilder docBuilder = dbfac.newDocumentBuilder(); - Document doc = docBuilder.newDocument(); - - Element rootEl = doc.createElement(ROOT_EL); - doc.appendChild(rootEl); - - for (HashDb set : knownBadSets) { - String useForIngest = Boolean.toString(set.getUseForIngest()); - String showInboxMessages = Boolean.toString(set.getShowInboxMessages()); - List paths = set.getDatabasePaths(); - String type = DBType.KNOWN_BAD.toString(); - - Element setEl = doc.createElement(SET_EL); - setEl.setAttribute(SET_NAME_ATTR, set.getName()); - setEl.setAttribute(SET_TYPE_ATTR, type); - setEl.setAttribute(SET_USE_FOR_INGEST_ATTR, useForIngest); - setEl.setAttribute(SET_SHOW_INBOX_MESSAGES, showInboxMessages); - - for (int i = 0; i < paths.size(); i++) { - String path = paths.get(i); - Element pathEl = doc.createElement(PATH_EL); - pathEl.setAttribute(PATH_NUMBER_ATTR, Integer.toString(i)); - pathEl.setTextContent(path); - setEl.appendChild(pathEl); - } - rootEl.appendChild(setEl); - } - - if(nsrlSet != null) { - String useForIngest = Boolean.toString(nsrlSet.getUseForIngest()); - String showInboxMessages = Boolean.toString(nsrlSet.getShowInboxMessages()); - List paths = nsrlSet.getDatabasePaths(); - String type = DBType.NSRL.toString(); - - Element setEl = doc.createElement(SET_EL); - setEl.setAttribute(SET_NAME_ATTR, nsrlSet.getName()); - setEl.setAttribute(SET_TYPE_ATTR, type); - setEl.setAttribute(SET_USE_FOR_INGEST_ATTR, useForIngest); - setEl.setAttribute(SET_SHOW_INBOX_MESSAGES, showInboxMessages); - - for (int i = 0; i < paths.size(); i++) { - String path = paths.get(i); - Element pathEl = doc.createElement(PATH_EL); - pathEl.setAttribute(PATH_NUMBER_ATTR, Integer.toString(i)); - pathEl.setTextContent(path); - setEl.appendChild(pathEl); - } - rootEl.appendChild(setEl); - } - - String calcValue = Boolean.toString(calculate); - Element setCalc = doc.createElement(SET_CALC); - setCalc.setAttribute(SET_VALUE, calcValue); - rootEl.appendChild(setCalc); - - success = saveDoc(doc); - } catch (ParserConfigurationException e) { - logger.log(Level.SEVERE, "Error saving hash sets: can't initialize parser.", e); - } - return success; - } - - /** - * load and parse XML, then dispose - */ - public boolean load() { - final Document doc = loadDoc(); - if (doc == null) { - return false; - } - - Element root = doc.getDocumentElement(); - if (root == null) { - logger.log(Level.SEVERE, "Error loading hash sets: invalid file format."); - return false; - } - NodeList setsNList = root.getElementsByTagName(SET_EL); - int numSets = setsNList.getLength(); - if(numSets==0) { - logger.log(Level.WARNING, "No element hash_set exists."); - } - for (int i = 0; i < numSets; ++i) { - Element setEl = (Element) setsNList.item(i); - final String name = setEl.getAttribute(SET_NAME_ATTR); - final String type = setEl.getAttribute(SET_TYPE_ATTR); - final String useForIngest = setEl.getAttribute(SET_USE_FOR_INGEST_ATTR); - final String showInboxMessages = setEl.getAttribute(SET_SHOW_INBOX_MESSAGES); - Boolean useForIngestBool = Boolean.parseBoolean(useForIngest); - Boolean showInboxMessagesBool = Boolean.parseBoolean(showInboxMessages); - List paths = new ArrayList(); - - //parse all words - NodeList pathsNList = setEl.getElementsByTagName(PATH_EL); - final int numPaths = pathsNList.getLength(); - if(numPaths==0) { - logger.log(Level.WARNING, "No paths have been given for the hash_set at index " + i + "."); - } - for (int j = 0; j < numPaths; ++j) { - Element pathEl = (Element) pathsNList.item(j); - String number = pathEl.getAttribute(PATH_NUMBER_ATTR); - String path = pathEl.getTextContent(); - paths.add(path); - } - - // Check everything was properly set - if(name.isEmpty()) { - logger.log(Level.WARNING, "Name was not set for hash_set at index " + i + "."); - } if(type.isEmpty()) { - logger.log(Level.SEVERE, "Type was not set for hash_set at index " + i + ", cannot make instance of HashDb class."); - return false; // exit because this causes a fatal error - } if(useForIngest.isEmpty()) { - logger.log(Level.WARNING, "UseForIngest was not set for hash_set at index " + i + "."); - } if(showInboxMessages.isEmpty()) { - logger.log(Level.WARNING, "ShowInboxMessages was not set for hash_set at index " + i + "."); - } - - DBType typeDBType = DBType.valueOf(type); - HashDb set = new HashDb(name, paths, useForIngestBool, showInboxMessagesBool, typeDBType); - - if(typeDBType == DBType.KNOWN_BAD) { - knownBadSets.add(set); - } else if(typeDBType == DBType.NSRL) { - this.nsrlSet = set; - } - } - - NodeList calcList = root.getElementsByTagName(SET_CALC); - int numCalc = calcList.getLength(); // Shouldn't be more than 1 - if(numCalc==0) { - logger.log(Level.WARNING, "No element hash_calculate exists."); - } - for(int i=0; i sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.hashdatabase; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import org.sleuthkit.autopsy.coreutils.Logger; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Result; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import org.sleuthkit.autopsy.coreutils.AutopsyPropFile; +import org.sleuthkit.autopsy.hashdatabase.HashDb.DBType; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +/** + * + * @author dfickling + */ +public class HashDbXML { + private static final String ROOT_EL = "hash_sets"; + private static final String SET_EL = "hash_set"; + private static final String SET_NAME_ATTR = "name"; + private static final String SET_TYPE_ATTR = "type"; + private static final String SET_USE_FOR_INGEST_ATTR = "use_for_ingest"; + private static final String SET_SHOW_INBOX_MESSAGES = "show_inbox_messages"; + private static final String PATH_EL = "hash_set_path"; + private static final String PATH_NUMBER_ATTR = "number"; + private static final String CUR_HASHSETS_FILE_NAME = "hashsets.xml"; + private static final String ENCODING = "UTF-8"; + private static final String CUR_HASHSET_FILE = AutopsyPropFile.getUserDirPath() + File.separator + CUR_HASHSETS_FILE_NAME; + private static final String SET_CALC = "hash_calculate"; + private static final String SET_VALUE = "value"; + private static final Logger logger = Logger.getLogger(HashDbXML.class.getName()); + private static HashDbXML currentInstance; + + private List knownBadSets; + private HashDb nsrlSet; + private String xmlFile; + private boolean calculate; + + private HashDbXML(String xmlFile) { + knownBadSets = new ArrayList(); + this.xmlFile = xmlFile; + } + + /** + * get instance for managing the current keyword list of the application + */ + static synchronized HashDbXML getCurrent() { + if (currentInstance == null) { + currentInstance = new HashDbXML(CUR_HASHSET_FILE); + currentInstance.reload(); + } + return currentInstance; + } + + /** + * Get the hash sets + */ + public List getAllSets() { + List ret = new ArrayList(); + if(nsrlSet != null) { + ret.add(nsrlSet); + } + ret.addAll(knownBadSets); + return ret; + } + + /** + * Get the Known Bad sets + */ + public List getKnownBadSets() { + return knownBadSets; + } + + /** + * Get the NSRL set + */ + public HashDb getNSRLSet() { + return nsrlSet; + } + + /** + * Add a known bad hash set + */ + public void addKnownBadSet(HashDb set) { + knownBadSets.add(set); + //save(); + } + + /** + * Add a known bad hash set + */ + public void addKnownBadSet(int index, HashDb set) { + knownBadSets.add(index, set); + //save(); + } + + /** + * Set the NSRL hash set (override old set) + */ + public void setNSRLSet(HashDb set) { + this.nsrlSet = set; + //save(); + } + + /** + * Remove a hash known bad set + */ + public void removeKnownBadSetAt(int index) { + knownBadSets.remove(index); + //save(); + } + + /** + * Remove the NSRL database + */ + public void removeNSRLSet() { + this.nsrlSet = null; + //save(); + } + + /** + * load the file or create new + */ + public void reload() { + boolean created = false; + + knownBadSets.clear(); + nsrlSet = null; + + if (!this.setsFileExists()) { + //create new if it doesn't exist + save(); + created = true; + } + + //load, if fails to load create new + if (!load() && !created) { + //create new if failed to load + save(); + } + } + + /** + * Sets the local variable calculate to the given boolean. + * @param set the state to make calculate + */ + public void setCalculate(boolean set) { + this.calculate = set; + //save(); + } + + /** + * Returns the value of the local boolean calculate. + * @return true if calculate is true, false otherwise + */ + public boolean getCalculate() { + return this.calculate; + } + + /** + * writes out current sets file replacing the last one + */ + public boolean save() { + boolean success = false; + + DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); + + try { + DocumentBuilder docBuilder = dbfac.newDocumentBuilder(); + Document doc = docBuilder.newDocument(); + + Element rootEl = doc.createElement(ROOT_EL); + doc.appendChild(rootEl); + + for (HashDb set : knownBadSets) { + String useForIngest = Boolean.toString(set.getUseForIngest()); + String showInboxMessages = Boolean.toString(set.getShowInboxMessages()); + List paths = set.getDatabasePaths(); + String type = DBType.KNOWN_BAD.toString(); + + Element setEl = doc.createElement(SET_EL); + setEl.setAttribute(SET_NAME_ATTR, set.getName()); + setEl.setAttribute(SET_TYPE_ATTR, type); + setEl.setAttribute(SET_USE_FOR_INGEST_ATTR, useForIngest); + setEl.setAttribute(SET_SHOW_INBOX_MESSAGES, showInboxMessages); + + for (int i = 0; i < paths.size(); i++) { + String path = paths.get(i); + Element pathEl = doc.createElement(PATH_EL); + pathEl.setAttribute(PATH_NUMBER_ATTR, Integer.toString(i)); + pathEl.setTextContent(path); + setEl.appendChild(pathEl); + } + rootEl.appendChild(setEl); + } + + if(nsrlSet != null) { + String useForIngest = Boolean.toString(nsrlSet.getUseForIngest()); + String showInboxMessages = Boolean.toString(nsrlSet.getShowInboxMessages()); + List paths = nsrlSet.getDatabasePaths(); + String type = DBType.NSRL.toString(); + + Element setEl = doc.createElement(SET_EL); + setEl.setAttribute(SET_NAME_ATTR, nsrlSet.getName()); + setEl.setAttribute(SET_TYPE_ATTR, type); + setEl.setAttribute(SET_USE_FOR_INGEST_ATTR, useForIngest); + setEl.setAttribute(SET_SHOW_INBOX_MESSAGES, showInboxMessages); + + for (int i = 0; i < paths.size(); i++) { + String path = paths.get(i); + Element pathEl = doc.createElement(PATH_EL); + pathEl.setAttribute(PATH_NUMBER_ATTR, Integer.toString(i)); + pathEl.setTextContent(path); + setEl.appendChild(pathEl); + } + rootEl.appendChild(setEl); + } + + String calcValue = Boolean.toString(calculate); + Element setCalc = doc.createElement(SET_CALC); + setCalc.setAttribute(SET_VALUE, calcValue); + rootEl.appendChild(setCalc); + + success = saveDoc(doc); + } catch (ParserConfigurationException e) { + logger.log(Level.SEVERE, "Error saving hash sets: can't initialize parser.", e); + } + return success; + } + + /** + * load and parse XML, then dispose + */ + public boolean load() { + final Document doc = loadDoc(); + if (doc == null) { + return false; + } + + Element root = doc.getDocumentElement(); + if (root == null) { + logger.log(Level.SEVERE, "Error loading hash sets: invalid file format."); + return false; + } + NodeList setsNList = root.getElementsByTagName(SET_EL); + int numSets = setsNList.getLength(); + if(numSets==0) { + logger.log(Level.WARNING, "No element hash_set exists."); + } + for (int i = 0; i < numSets; ++i) { + Element setEl = (Element) setsNList.item(i); + final String name = setEl.getAttribute(SET_NAME_ATTR); + final String type = setEl.getAttribute(SET_TYPE_ATTR); + final String useForIngest = setEl.getAttribute(SET_USE_FOR_INGEST_ATTR); + final String showInboxMessages = setEl.getAttribute(SET_SHOW_INBOX_MESSAGES); + Boolean useForIngestBool = Boolean.parseBoolean(useForIngest); + Boolean showInboxMessagesBool = Boolean.parseBoolean(showInboxMessages); + List paths = new ArrayList(); + + //parse all words + NodeList pathsNList = setEl.getElementsByTagName(PATH_EL); + final int numPaths = pathsNList.getLength(); + if(numPaths==0) { + logger.log(Level.WARNING, "No paths have been given for the hash_set at index " + i + "."); + } + for (int j = 0; j < numPaths; ++j) { + Element pathEl = (Element) pathsNList.item(j); + String number = pathEl.getAttribute(PATH_NUMBER_ATTR); + String path = pathEl.getTextContent(); + paths.add(path); + } + + // Check everything was properly set + if(name.isEmpty()) { + logger.log(Level.WARNING, "Name was not set for hash_set at index " + i + "."); + } if(type.isEmpty()) { + logger.log(Level.SEVERE, "Type was not set for hash_set at index " + i + ", cannot make instance of HashDb class."); + return false; // exit because this causes a fatal error + } if(useForIngest.isEmpty()) { + logger.log(Level.WARNING, "UseForIngest was not set for hash_set at index " + i + "."); + } if(showInboxMessages.isEmpty()) { + logger.log(Level.WARNING, "ShowInboxMessages was not set for hash_set at index " + i + "."); + } + + DBType typeDBType = DBType.valueOf(type); + HashDb set = new HashDb(name, paths, useForIngestBool, showInboxMessagesBool, typeDBType); + + if(typeDBType == DBType.KNOWN_BAD) { + knownBadSets.add(set); + } else if(typeDBType == DBType.NSRL) { + this.nsrlSet = set; + } + } + + NodeList calcList = root.getElementsByTagName(SET_CALC); + int numCalc = calcList.getLength(); // Shouldn't be more than 1 + if(numCalc==0) { + logger.log(Level.WARNING, "No element hash_calculate exists."); + } + for(int i=0; i - - @@ -12,31 +10,15 @@ - - - + - - - - - - - - - - - - - - diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/options-icon.png b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/options-icon.png new file mode 100644 index 0000000000..c9ab657213 Binary files /dev/null and b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/options-icon.png differ diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/options_icon.png b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/options_icon.png new file mode 100644 index 0000000000..c9ab657213 Binary files /dev/null and b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/options_icon.png differ diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/warning16.png b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/warning16.png new file mode 100644 index 0000000000..f5ba881738 Binary files /dev/null and b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/warning16.png differ diff --git a/Ingest/manifest.mf b/Ingest/manifest.mf index 2df9e1e6c7..8067fb49fc 100644 --- a/Ingest/manifest.mf +++ b/Ingest/manifest.mf @@ -1,10 +1,11 @@ -Manifest-Version: 1.0 -Bundle-Localization: org/sleuthkit/autopsy/ingest/Bundle -Bundle-Name: %OpenIDE-Module-Name -Bundle-SymbolicName: org.sleuthkit.autopsy.ingest/1 -OpenIDE-Module-Implementation-Version: 1 -OpenIDE-Module-Layer: org/sleuthkit/autopsy/ingest/layer.xml -OpenIDE-Module-Requires: org.openide.windows.WindowManager -OpenIDE-Module: org.sleuthkit.autopsy.ingest/0 -OpenIDE-Module-Install: org/sleuthkit/autopsy/ingest/Installer.class - +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +Bundle-Localization: org/sleuthkit/autopsy/ingest/Bundle +Bundle-Name: %OpenIDE-Module-Name +Bundle-SymbolicName: org.sleuthkit.autopsy.ingest/1 +OpenIDE-Module-Implementation-Version: 1 +OpenIDE-Module-Layer: org/sleuthkit/autopsy/ingest/layer.xml +OpenIDE-Module-Requires: org.openide.windows.WindowManager +OpenIDE-Module: org.sleuthkit.autopsy.ingest/0 +OpenIDE-Module-Install: org/sleuthkit/autopsy/ingest/Installer.class + diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/Bundle.properties b/Ingest/src/org/sleuthkit/autopsy/ingest/Bundle.properties index 28d381ebd3..3645ac5b9e 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/Bundle.properties +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/Bundle.properties @@ -32,13 +32,5 @@ IngestMessagePanel.totalMessagesNameLabel.text=Total: IngestMessagePanel.totalMessagesNameVal.text=- IngestMessagePanel.totalUniqueMessagesNameLabel.text=Unique: IngestMessagePanel.totalUniqueMessagesNameVal.text=- -IngestDialogPanel.timeRadioButton3.text=5 minutes (longest ingest) -IngestDialogPanel.timeLabel.toolTipText=Choose the maximum time between updates from background tasks -IngestDialogPanel.timeLabel.text=Update Frequency -IngestDialogPanel.timeRadioButton1.toolTipText=20 mins. (fastest ingest time) -IngestDialogPanel.timeRadioButton1.text=20 minutes (fastest ingest) -IngestDialogPanel.timeRadioButton2.toolTipText=10 minutes (default ingest time) -IngestDialogPanel.timeRadioButton2.text=10 minutes (default) -IngestDialogPanel.timeRadioButton3.toolTipText=5 minutes (overall ingest time will be longest) IngestDialogPanel.processUnallocCheckbox.text=Process Unallocated Space IngestDialogPanel.processUnallocCheckbox.toolTipText=Processes unallocated space, such as deleted files. Produces more complete results, but it may take longer to process on large images. diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/GetAllFilesContentVisitor.java b/Ingest/src/org/sleuthkit/autopsy/ingest/GetAllFilesContentVisitor.java index 920b2fef49..c783614db5 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/GetAllFilesContentVisitor.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/GetAllFilesContentVisitor.java @@ -25,7 +25,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.datamodel.File; import org.sleuthkit.datamodel.FileSystem; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java b/Ingest/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java index f22969c2a0..b101db0c52 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/GetFilesContentVisitor.java @@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.ingest; import java.util.ArrayList; import java.util.Collection; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.ContentVisitor; import org.sleuthkit.datamodel.Directory; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialog.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialog.java index 7a9bf424f0..961101a326 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialog.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialog.java @@ -23,13 +23,14 @@ import java.awt.Dimension; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.logging.Logger; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.JSeparator; import org.sleuthkit.datamodel.Image; /** @@ -42,7 +43,7 @@ public class IngestDialog extends JDialog { private Image image = null; private IngestDialogPanel panel = null; - private static Logger logger = Logger.getLogger(IngestDialog.class.getName()); + private static final Logger logger = Logger.getLogger(IngestDialog.class.getName()); public IngestDialog(JFrame frame, String title, boolean modal) { super(frame, title, modal); @@ -70,6 +71,7 @@ public class IngestDialog extends JDialog { // set the location of the popUp Window on the center of the screen setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); + panel.reload(); // reload the simple panel add(panel, BorderLayout.PAGE_START); JButton startButton = new JButton("Start"); JButton closeButton = new JButton("Close"); @@ -92,6 +94,14 @@ public class IngestDialog extends JDialog { close(); } }); + this.addWindowListener(new WindowAdapter() { + + @Override + public void windowClosing(WindowEvent e) { + panel.save(); + close(); + } + }); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS)); buttonPanel.add(new javax.swing.Box.Filler(new Dimension(10,10), new Dimension(10,10), new Dimension(10,10))); diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.form b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.form index 1ed953087e..be92f86f70 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.form +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.form @@ -29,11 +29,10 @@ - - + @@ -43,13 +42,11 @@ - + - + - - - + @@ -105,10 +102,10 @@ - - + + - + @@ -117,7 +114,7 @@ - + @@ -163,94 +160,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -268,15 +177,16 @@ - + - + + - + diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java index 1cc0419ecd..a5a37ca619 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestDialogPanel.java @@ -19,28 +19,27 @@ package org.sleuthkit.autopsy.ingest; import java.awt.Component; -import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.ListSelectionModel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumn; import org.sleuthkit.autopsy.casemodule.IngestConfigurator; -import org.sleuthkit.autopsy.ingest.IngestManager.UpdateFrequency; +import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; import org.sleuthkit.datamodel.Image; /** @@ -86,33 +85,6 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi addModule(module); } - //time setting - timeGroup.add(timeRadioButton1); - timeGroup.add(timeRadioButton2); - timeGroup.add(timeRadioButton3); - - if (manager.isIngestRunning()) { - setTimeSettingEnabled(false); - } else { - setTimeSettingEnabled(true); - } - - //set default - final UpdateFrequency curFreq = manager.getUpdateFrequency(); - switch (curFreq) { - case FAST: - timeRadioButton1.setSelected(true); - break; - case AVG: - timeRadioButton2.setSelected(true); - break; - case SLOW: - timeRadioButton3.setSelected(true); - break; - default: - // - } - modulesTable.setTableHeader(null); modulesTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); @@ -141,7 +113,7 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi save(); int index = listSelectionModel.getMinSelectionIndex(); currentModule = modules.get(index); - reloadSimpleConfiguration(); + reload(); advancedButton.setEnabled(currentModule.hasAdvancedConfiguration()); } else { currentModule = null; @@ -153,11 +125,7 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi } - private void setTimeSettingEnabled(boolean enabled) { - timeRadioButton1.setEnabled(enabled); - timeRadioButton2.setEnabled(enabled); - timeRadioButton3.setEnabled(enabled); - } + private void setProcessUnallocSpaceEnabled(boolean enabled) { processUnallocCheckbox.setEnabled(enabled); @@ -167,11 +135,9 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi public void paint(Graphics g) { super.paint(g); if (manager.isIngestRunning()) { - setTimeSettingEnabled(false); setProcessUnallocSpaceEnabled(false); } else { - setTimeSettingEnabled(true); setProcessUnallocSpaceEnabled(true); } } @@ -199,11 +165,6 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi jSeparator2 = new javax.swing.JSeparator(); jScrollPane1 = new javax.swing.JScrollPane(); simplePanel = new javax.swing.JPanel(); - timePanel = new javax.swing.JPanel(); - timeRadioButton3 = new javax.swing.JRadioButton(); - timeRadioButton2 = new javax.swing.JRadioButton(); - timeLabel = new javax.swing.JLabel(); - timeRadioButton1 = new javax.swing.JRadioButton(); processUnallocPanel = new javax.swing.JPanel(); processUnallocCheckbox = new javax.swing.JCheckBox(); @@ -246,17 +207,17 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 336, Short.MAX_VALUE) - .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 336, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 326, Short.MAX_VALUE) + .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap(245, Short.MAX_VALUE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(advancedButton) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) @@ -264,52 +225,6 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi .addContainerGap()) ); - timePanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160))); - - timeRadioButton3.setText(org.openide.util.NbBundle.getMessage(IngestDialogPanel.class, "IngestDialogPanel.timeRadioButton3.text")); // NOI18N - timeRadioButton3.setToolTipText(org.openide.util.NbBundle.getMessage(IngestDialogPanel.class, "IngestDialogPanel.timeRadioButton3.toolTipText")); // NOI18N - - timeRadioButton2.setText(org.openide.util.NbBundle.getMessage(IngestDialogPanel.class, "IngestDialogPanel.timeRadioButton2.text")); // NOI18N - timeRadioButton2.setToolTipText(org.openide.util.NbBundle.getMessage(IngestDialogPanel.class, "IngestDialogPanel.timeRadioButton2.toolTipText")); // NOI18N - - timeLabel.setText(org.openide.util.NbBundle.getMessage(IngestDialogPanel.class, "IngestDialogPanel.timeLabel.text")); // NOI18N - timeLabel.setToolTipText(org.openide.util.NbBundle.getMessage(IngestDialogPanel.class, "IngestDialogPanel.timeLabel.toolTipText")); // NOI18N - - timeRadioButton1.setText(org.openide.util.NbBundle.getMessage(IngestDialogPanel.class, "IngestDialogPanel.timeRadioButton1.text")); // NOI18N - timeRadioButton1.setToolTipText(org.openide.util.NbBundle.getMessage(IngestDialogPanel.class, "IngestDialogPanel.timeRadioButton1.toolTipText")); // NOI18N - timeRadioButton1.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - timeRadioButton1ActionPerformed(evt); - } - }); - - javax.swing.GroupLayout timePanelLayout = new javax.swing.GroupLayout(timePanel); - timePanel.setLayout(timePanelLayout); - timePanelLayout.setHorizontalGroup( - timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(timePanelLayout.createSequentialGroup() - .addContainerGap() - .addGroup(timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(timeRadioButton1) - .addComponent(timeLabel) - .addComponent(timeRadioButton2) - .addComponent(timeRadioButton3)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - timePanelLayout.setVerticalGroup( - timePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(timePanelLayout.createSequentialGroup() - .addGap(0, 4, Short.MAX_VALUE) - .addComponent(timeLabel) - .addGap(0, 0, 0) - .addComponent(timeRadioButton1) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(timeRadioButton2) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(timeRadioButton3) - .addGap(2, 2, 2)) - ); - processUnallocPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(160, 160, 160))); processUnallocCheckbox.setText(org.openide.util.NbBundle.getMessage(IngestDialogPanel.class, "IngestDialogPanel.processUnallocCheckbox.text")); // NOI18N @@ -327,13 +242,14 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi .addGroup(processUnallocPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(processUnallocCheckbox) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(12, Short.MAX_VALUE)) ); processUnallocPanelLayout.setVerticalGroup( processUnallocPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(processUnallocPanelLayout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, processUnallocPanelLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(processUnallocCheckbox) - .addGap(0, 2, Short.MAX_VALUE)) + .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); @@ -344,10 +260,9 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(timePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(processUnallocPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 328, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); layout.setVerticalGroup( @@ -355,13 +270,11 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 235, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() - .addComponent(modulesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addComponent(modulesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(processUnallocPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(timePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(processUnallocPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addContainerGap()) ); }// //GEN-END:initComponents @@ -374,16 +287,21 @@ public class IngestDialogPanel extends javax.swing.JPanel implements IngestConfi public void actionPerformed(ActionEvent e) { dialog.close(); currentModule.saveAdvancedConfiguration(); - reloadSimpleConfiguration(); + reload(); } }); + dialog.addWindowListener(new WindowAdapter() { + + @Override + public void windowClosing(WindowEvent e) { + dialog.close(); + reload(); + } + }); + save(); // save the simple panel dialog.display(currentModule.getAdvancedConfiguration()); }//GEN-LAST:event_advancedButtonActionPerformed -private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeRadioButton1ActionPerformed -// TODO add your handling code here: -}//GEN-LAST:event_timeRadioButton1ActionPerformed - private void processUnallocCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_processUnallocCheckboxActionPerformed // TODO add your handling code here: }//GEN-LAST:event_processUnallocCheckboxActionPerformed @@ -399,11 +317,6 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// private javax.swing.JPanel processUnallocPanel; private javax.swing.JPanel simplePanel; private javax.swing.ButtonGroup timeGroup; - private javax.swing.JLabel timeLabel; - private javax.swing.JPanel timePanel; - private javax.swing.JRadioButton timeRadioButton1; - private javax.swing.JRadioButton timeRadioButton2; - private javax.swing.JRadioButton timeRadioButton3; // End of variables declaration//GEN-END:variables private class ModulesTableModel extends AbstractTableModel { @@ -458,32 +371,13 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// return modulesToStart; } - private boolean timeSelectionEnabled() { - return timeRadioButton1.isEnabled() && timeRadioButton2.isEnabled() && timeRadioButton3.isEnabled(); - } + private boolean processUnallocSpaceEnabled() { return processUnallocCheckbox.isEnabled(); } - private UpdateFrequency getSelectedTimeValue() { - if (timeRadioButton1.isSelected()) { - return UpdateFrequency.FAST; - } else if (timeRadioButton2.isSelected()) { - return UpdateFrequency.AVG; - } else { - return UpdateFrequency.SLOW; - } - } - private void reloadSimpleConfiguration() { - simplePanel.removeAll(); - if (currentModule.hasSimpleConfiguration()) { - simplePanel.add(currentModule.getSimpleConfiguration()); - } - simplePanel.revalidate(); - simplePanel.repaint(); - } /** * To be called whenever the next, close, or start buttons are pressed. @@ -495,6 +389,22 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// currentModule.saveSimpleConfiguration(); } } + + /** + * Called when the simple panel needs to be reloaded with more + * recent data. + */ + @Override + public void reload() { + if(this.modulesTable.getSelectedRow() != -1) { + simplePanel.removeAll(); + if (currentModule.hasSimpleConfiguration()) { + simplePanel.add(currentModule.getSimpleConfiguration()); + } + simplePanel.revalidate(); + simplePanel.repaint(); + } + } @Override public JPanel getIngestConfigPanel() { @@ -515,10 +425,7 @@ private void timeRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {// manager.execute(modulesToStart, image); } - //update ingest freq. refresh - if (timeSelectionEnabled()) { - manager.setUpdateFrequency(getSelectedTimeValue()); - } + //update ingest proc. unalloc space if (processUnallocSpaceEnabled() ) { manager.setProcessUnallocSpace(processUnallocCheckbox.isSelected()); diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestImageThread.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestImageThread.java index 9934aff955..d57e5e40d8 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestImageThread.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestImageThread.java @@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.ingest; //ingester worker for image queue import java.awt.EventQueue; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.SwingWorker; import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandleFactory; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java index e238483858..0e4e47dfcb 100755 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java @@ -34,7 +34,7 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.swing.SwingWorker; @@ -59,33 +59,8 @@ import org.sleuthkit.datamodel.TskData; */ public class IngestManager { - /** - * @Deprecated individual modules are be responsible for maintaining such settings - */ - enum UpdateFrequency { - - FAST(20), - AVG(10), - SLOW(5); - private final int time; - - /** - * @Deprecated individual modules are be responsible for maintaining such settings - */ - UpdateFrequency(int time) { - this.time = time; - } - - /** - * @Deprecated individual modules are be responsible for maintaining such settings - */ - int getTime() { - return time; - } - }; private static final Logger logger = Logger.getLogger(IngestManager.class.getName()); private IngestManagerStats stats; - private volatile UpdateFrequency updateFrequency = UpdateFrequency.AVG; private boolean processUnallocSpace = true; //queues private final ImageQueue imageQueue = new ImageQueue(); // list of modules and images to analyze @@ -531,23 +506,6 @@ public class IngestManager { } - /** - * returns the current minimal update frequency setting in minutes Modules - * should call this at init() to get current setting and use the setting to - * change notification and data refresh intervals - */ - UpdateFrequency getUpdateFrequency() { - return updateFrequency; - } - - /** - * set new minimal update frequency modules should use - * - * @param frequency to use in minutes - */ - void setUpdateFrequency(UpdateFrequency frequency) { - this.updateFrequency = frequency; - } /** * returns if manager is currently configured to process unalloc space diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java index 00997a81bf..9566ab1082 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessageMainPanel.java @@ -23,7 +23,7 @@ import java.awt.Dimension; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.BoxLayout; import javax.swing.JLayeredPane; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java index 67c3475caf..7557f2c5ea 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessagePanel.java @@ -33,7 +33,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java index 71752871e7..1a17dfe19a 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java @@ -22,7 +22,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.Action; import javax.swing.BoxLayout; import javax.swing.JOptionPane; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java index c66e198441..95ab451534 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java @@ -24,7 +24,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.Timer; import org.sleuthkit.autopsy.casemodule.Case; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServices.java b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServices.java index 504ccb1b9c..39bac94015 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServices.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/IngestServices.java @@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.ingest; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; /** @@ -87,18 +87,6 @@ public class IngestServices { } - /** - * Facility for the module to query the currently set recommended data update frequency in minutes - * Modules that post data in controlled time intervals, should obey this setting - * - * @return max. number of minutes before module posts new data, if data is available - * - * @Deprecated individual modules are be responsible for maintaining such settings - */ - public int getUpdateFrequency() { - return manager.getUpdateFrequency().getTime(); - } - /** * Facility for a file ingest module to check a return value from another file ingest module diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/Installer.java b/Ingest/src/org/sleuthkit/autopsy/ingest/Installer.java index cb24aa4ff4..b72e8fef2a 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/Installer.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/Installer.java @@ -19,7 +19,7 @@ package org.sleuthkit.autopsy.ingest; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.modules.ModuleInstall; import org.openide.windows.WindowManager; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestModule.java b/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestModule.java index 91917c13d8..e53a277921 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestModule.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleAbstractFileIngestModule.java @@ -19,7 +19,7 @@ package org.sleuthkit.autopsy.ingest.example; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestMessage.MessageType; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestModule.java b/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestModule.java index 018a2172cd..b22ed52442 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestModule.java +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/example/ExampleImageIngestModule.java @@ -19,7 +19,7 @@ package org.sleuthkit.autopsy.ingest.example; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.IngestImageWorkerController; import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.ingest.IngestMessage; diff --git a/Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml b/Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml index eae2ad2d6c..bec857b97b 100644 --- a/Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml +++ b/Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml @@ -1,87 +1,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KeywordSearch/manifest.mf b/KeywordSearch/manifest.mf index 08495144a6..9c1b47bef7 100644 --- a/KeywordSearch/manifest.mf +++ b/KeywordSearch/manifest.mf @@ -1,8 +1,9 @@ -Manifest-Version: 1.0 -OpenIDE-Module: org.sleuthkit.autopsy.keywordsearch/0 -OpenIDE-Module-Implementation-Version: 1 -OpenIDE-Module-Install: org/sleuthkit/autopsy/keywordsearch/Installer.class -OpenIDE-Module-Layer: org/sleuthkit/autopsy/keywordsearch/layer.xml -OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/keywordsearch/Bundle.properties -OpenIDE-Module-Requires: org.openide.windows.WindowManager - +Manifest-Version: 1.0 +AutoUpdate-Show-In-Client: false +OpenIDE-Module: org.sleuthkit.autopsy.keywordsearch/0 +OpenIDE-Module-Implementation-Version: 1 +OpenIDE-Module-Install: org/sleuthkit/autopsy/keywordsearch/Installer.class +OpenIDE-Module-Layer: org/sleuthkit/autopsy/keywordsearch/layer.xml +OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/keywordsearch/Bundle.properties +OpenIDE-Module-Requires: org.openide.windows.WindowManager + diff --git a/KeywordSearch/nbproject/project.xml b/KeywordSearch/nbproject/project.xml index 7ad84226c7..c10dc18136 100644 --- a/KeywordSearch/nbproject/project.xml +++ b/KeywordSearch/nbproject/project.xml @@ -1,333 +1,342 @@ - - - org.netbeans.modules.apisupport.project - - - org.sleuthkit.autopsy.keywordsearch - - - - org.netbeans.api.progress - - - - 1 - 1.24.1 - - - - org.netbeans.modules.javahelp - - - - 1 - 2.22.1 - - - - org.netbeans.modules.settings - - - - 1 - 1.31.1 - - - - org.openide.awt - - - - 7.31.1 - - - - org.openide.modules - - - - 7.23.1 - - - - org.openide.nodes - - - - 7.21.1 - - - - org.openide.util - - - - 8.15.1 - - - - org.openide.util.lookup - - - - 8.8.1 - - - - org.openide.windows - - - - 6.40.1 - - - - org.sleuthkit.autopsy.casemodule - - - - 1 - 1.0 - - - - org.sleuthkit.autopsy.corecomponentinterfaces - - - - 1 - 1.0 - - - - org.sleuthkit.autopsy.corecomponents - - - - 1 - 1.0 - - - - org.sleuthkit.autopsy.coreutils - - - - 0-1 - 0.0 - - - - org.sleuthkit.autopsy.datamodel - - - - 1 - 1.0 - - - - org.sleuthkit.autopsy.directorytree - - - - 1 - 1.0 - - - - org.sleuthkit.autopsy.ingest - - - - 0-1 - 1.0 - - - - - org.sleuthkit.autopsy.keywordsearch - - - ext/metadata-extractor-2.4.0-beta-1.jar - release/modules/ext/metadata-extractor-2.4.0-beta-1.jar - - - ext/jdom-1.0.jar - release/modules/ext/jdom-1.0.jar - - - ext/poi-3.8-beta4.jar - release/modules/ext/poi-3.8-beta4.jar - - - ext/commons-io-2.1.jar - release/modules/ext/commons-io-2.1.jar - - - ext/commons-logging-1.1.1.jar - release/modules/ext/commons-logging-1.1.1.jar - - - ext/tagsoup-1.2.1.jar - release/modules/ext/tagsoup-1.2.1.jar - - - ext/solr-solrj-3.6.1.jar - release/modules/ext/solr-solrj-3.6.1.jar - - - ext/poi-ooxml-3.8-beta4.jar - release/modules/ext/poi-ooxml-3.8-beta4.jar - - - ext/commons-lang-2.4.jar - release/modules/ext/commons-lang-2.4.jar - - - ext/jcl-over-slf4j-1.6.1.jar - release/modules/ext/jcl-over-slf4j-1.6.1.jar - - - ext/boilerpipe-1.1.0.jar - release/modules/ext/boilerpipe-1.1.0.jar - - - ext/fontbox-1.6.0.jar - release/modules/ext/fontbox-1.6.0.jar - - - ext/jericho-html-3.2.jar - release/modules/ext/jericho-html-3.2.jar - - - ext/slf4j-api-1.6.1.jar - release/modules/ext/slf4j-api-1.6.1.jar - - - ext/qdox-1.12.jar - release/modules/ext/qdox-1.12.jar - - - ext/org.osgi.compendium-4.0.0.jar - release/modules/ext/org.osgi.compendium-4.0.0.jar - - - ext/asm-all-3.1.jar - release/modules/ext/asm-all-3.1.jar - - - ext/org.apache.felix.scr.generator-1.1.2.jar - release/modules/ext/org.apache.felix.scr.generator-1.1.2.jar - - - ext/tika-parsers-1.0.jar - release/modules/ext/tika-parsers-1.0.jar - - - ext/tika-core-1.0.jar - release/modules/ext/tika-core-1.0.jar - - - ext/bcmail-jdk15-1.45.jar - release/modules/ext/bcmail-jdk15-1.45.jar - - - ext/commons-codec-1.6.jar - release/modules/ext/commons-codec-1.6.jar - - - ext/wstx-asl-3.2.7.jar - release/modules/ext/wstx-asl-3.2.7.jar - - - ext/netcdf-4.2-min.jar - release/modules/ext/netcdf-4.2-min.jar - - - ext/xmlbeans-2.3.0.jar - release/modules/ext/xmlbeans-2.3.0.jar - - - ext/httpmime-4.1.3.jar - release/modules/ext/httpmime-4.1.3.jar - - - ext/commons-compress-1.3.jar - release/modules/ext/commons-compress-1.3.jar - - - ext/org.osgi.core-4.0.0.jar - release/modules/ext/org.osgi.core-4.0.0.jar - - - ext/org.apache.felix.scr.annotations-1.6.0.jar - release/modules/ext/org.apache.felix.scr.annotations-1.6.0.jar - - - ext/commons-logging-api-1.1.jar - release/modules/ext/commons-logging-api-1.1.jar - - - ext/apache-mime4j-core-0.7.jar - release/modules/ext/apache-mime4j-core-0.7.jar - - - ext/httpcore-4.1.4.jar - release/modules/ext/httpcore-4.1.4.jar - - - ext/poi-scratchpad-3.8-beta4.jar - release/modules/ext/poi-scratchpad-3.8-beta4.jar - - - ext/commons-httpclient-3.1.jar - release/modules/ext/commons-httpclient-3.1.jar - - - ext/apache-mime4j-dom-0.7.jar - release/modules/ext/apache-mime4j-dom-0.7.jar - - - ext/poi-ooxml-schemas-3.8-beta4.jar - release/modules/ext/poi-ooxml-schemas-3.8-beta4.jar - - - ext/dom4j-1.6.1.jar - release/modules/ext/dom4j-1.6.1.jar - - - ext/log4j-1.2.16.jar - release/modules/ext/log4j-1.2.16.jar - - - ext/rome-0.9.jar - release/modules/ext/rome-0.9.jar - - - ext/bcprov-jdk15-1.45.jar - release/modules/ext/bcprov-jdk15-1.45.jar - - - ext/httpclient-4.1.3.jar - release/modules/ext/httpclient-4.1.3.jar - - - ext/pdfbox-1.6.0.jar - release/modules/ext/pdfbox-1.6.0.jar - - - ext/jempbox-1.6.0.jar - release/modules/ext/jempbox-1.6.0.jar - - - ext/asm-3.1.jar - release/modules/ext/asm-3.1.jar - - - ext/geronimo-stax-api_1.0_spec-1.0.1.jar - release/modules/ext/geronimo-stax-api_1.0_spec-1.0.1.jar - - - - + + + org.netbeans.modules.apisupport.project + + + org.sleuthkit.autopsy.keywordsearch + + + + org.netbeans.api.progress + + + + 1 + 1.24.1 + + + + org.netbeans.modules.javahelp + + + + 1 + 2.22.1 + + + + org.netbeans.modules.options.api + + + + 1 + 1.26.1 + + + + org.netbeans.modules.settings + + + + 1 + 1.31.1 + + + + org.openide.awt + + + + 7.31.1 + + + + org.openide.modules + + + + 7.23.1 + + + + org.openide.nodes + + + + 7.21.1 + + + + org.openide.util + + + + 8.15.1 + + + + org.openide.util.lookup + + + + 8.8.1 + + + + org.openide.windows + + + + 6.40.1 + + + + org.sleuthkit.autopsy.casemodule + + + + 1 + 1.0 + + + + org.sleuthkit.autopsy.corecomponentinterfaces + + + + 1 + 1.0 + + + + org.sleuthkit.autopsy.corecomponents + + + + 1 + 1.0 + + + + org.sleuthkit.autopsy.coreutils + + + + 0-1 + 0.0 + + + + org.sleuthkit.autopsy.datamodel + + + + 1 + 1.0 + + + + org.sleuthkit.autopsy.directorytree + + + + 1 + 1.0 + + + + org.sleuthkit.autopsy.ingest + + + + 0-1 + 1.0 + + + + + org.sleuthkit.autopsy.keywordsearch + + + ext/metadata-extractor-2.4.0-beta-1.jar + release/modules/ext/metadata-extractor-2.4.0-beta-1.jar + + + ext/jdom-1.0.jar + release/modules/ext/jdom-1.0.jar + + + ext/poi-3.8-beta4.jar + release/modules/ext/poi-3.8-beta4.jar + + + ext/commons-io-2.1.jar + release/modules/ext/commons-io-2.1.jar + + + ext/commons-logging-1.1.1.jar + release/modules/ext/commons-logging-1.1.1.jar + + + ext/tagsoup-1.2.1.jar + release/modules/ext/tagsoup-1.2.1.jar + + + ext/solr-solrj-3.6.1.jar + release/modules/ext/solr-solrj-3.6.1.jar + + + ext/poi-ooxml-3.8-beta4.jar + release/modules/ext/poi-ooxml-3.8-beta4.jar + + + ext/commons-lang-2.4.jar + release/modules/ext/commons-lang-2.4.jar + + + ext/jcl-over-slf4j-1.6.1.jar + release/modules/ext/jcl-over-slf4j-1.6.1.jar + + + ext/boilerpipe-1.1.0.jar + release/modules/ext/boilerpipe-1.1.0.jar + + + ext/fontbox-1.6.0.jar + release/modules/ext/fontbox-1.6.0.jar + + + ext/jericho-html-3.2.jar + release/modules/ext/jericho-html-3.2.jar + + + ext/slf4j-api-1.6.1.jar + release/modules/ext/slf4j-api-1.6.1.jar + + + ext/qdox-1.12.jar + release/modules/ext/qdox-1.12.jar + + + ext/org.osgi.compendium-4.0.0.jar + release/modules/ext/org.osgi.compendium-4.0.0.jar + + + ext/asm-all-3.1.jar + release/modules/ext/asm-all-3.1.jar + + + ext/org.apache.felix.scr.generator-1.1.2.jar + release/modules/ext/org.apache.felix.scr.generator-1.1.2.jar + + + ext/tika-parsers-1.0.jar + release/modules/ext/tika-parsers-1.0.jar + + + ext/tika-core-1.0.jar + release/modules/ext/tika-core-1.0.jar + + + ext/bcmail-jdk15-1.45.jar + release/modules/ext/bcmail-jdk15-1.45.jar + + + ext/commons-codec-1.6.jar + release/modules/ext/commons-codec-1.6.jar + + + ext/wstx-asl-3.2.7.jar + release/modules/ext/wstx-asl-3.2.7.jar + + + ext/netcdf-4.2-min.jar + release/modules/ext/netcdf-4.2-min.jar + + + ext/xmlbeans-2.3.0.jar + release/modules/ext/xmlbeans-2.3.0.jar + + + ext/httpmime-4.1.3.jar + release/modules/ext/httpmime-4.1.3.jar + + + ext/commons-compress-1.3.jar + release/modules/ext/commons-compress-1.3.jar + + + ext/org.osgi.core-4.0.0.jar + release/modules/ext/org.osgi.core-4.0.0.jar + + + ext/org.apache.felix.scr.annotations-1.6.0.jar + release/modules/ext/org.apache.felix.scr.annotations-1.6.0.jar + + + ext/commons-logging-api-1.1.jar + release/modules/ext/commons-logging-api-1.1.jar + + + ext/apache-mime4j-core-0.7.jar + release/modules/ext/apache-mime4j-core-0.7.jar + + + ext/httpcore-4.1.4.jar + release/modules/ext/httpcore-4.1.4.jar + + + ext/poi-scratchpad-3.8-beta4.jar + release/modules/ext/poi-scratchpad-3.8-beta4.jar + + + ext/commons-httpclient-3.1.jar + release/modules/ext/commons-httpclient-3.1.jar + + + ext/apache-mime4j-dom-0.7.jar + release/modules/ext/apache-mime4j-dom-0.7.jar + + + ext/poi-ooxml-schemas-3.8-beta4.jar + release/modules/ext/poi-ooxml-schemas-3.8-beta4.jar + + + ext/dom4j-1.6.1.jar + release/modules/ext/dom4j-1.6.1.jar + + + ext/log4j-1.2.16.jar + release/modules/ext/log4j-1.2.16.jar + + + ext/rome-0.9.jar + release/modules/ext/rome-0.9.jar + + + ext/bcprov-jdk15-1.45.jar + release/modules/ext/bcprov-jdk15-1.45.jar + + + ext/httpclient-4.1.3.jar + release/modules/ext/httpclient-4.1.3.jar + + + ext/pdfbox-1.6.0.jar + release/modules/ext/pdfbox-1.6.0.jar + + + ext/jempbox-1.6.0.jar + release/modules/ext/jempbox-1.6.0.jar + + + ext/asm-3.1.jar + release/modules/ext/asm-3.1.jar + + + ext/geronimo-stax-api_1.0_spec-1.0.1.jar + release/modules/ext/geronimo-stax-api_1.0_spec-1.0.1.jar + + + + diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileHtmlExtract.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileHtmlExtract.java index 183f60fa65..a3863ca6b7 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileHtmlExtract.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileHtmlExtract.java @@ -25,7 +25,7 @@ import java.nio.charset.Charset; import java.util.List; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractUnicodeTable.SCRIPT; import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException; import org.sleuthkit.datamodel.AbstractFile; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringContentStream.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringContentStream.java index 53147c37b6..a6e6c49900 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringContentStream.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringContentStream.java @@ -23,7 +23,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.Charset; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.apache.solr.common.util.ContentStream; import org.sleuthkit.datamodel.AbstractContent; import org.sleuthkit.datamodel.AbstractFile; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringExtract.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringExtract.java index 072442aac4..e5626ed066 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringExtract.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringExtract.java @@ -26,7 +26,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractUnicodeTable.SCRIPT; import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException; import org.sleuthkit.datamodel.AbstractFile; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringIntStream.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringIntStream.java index 388aef64d2..90c843d3b8 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringIntStream.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringIntStream.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.List; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.StringExtract; import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractResult; import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractUnicodeTable.SCRIPT; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringStream.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringStream.java index a3e4943383..0123bbe79a 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringStream.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileStringStream.java @@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.keywordsearch; import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.StringExtract; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskException; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileTikaTextExtract.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileTikaTextExtract.java index f443cf6822..cb61c7f087 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileTikaTextExtract.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/AbstractFileTikaTextExtract.java @@ -32,7 +32,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.ReadContentInputStream; @@ -54,7 +54,6 @@ import org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException; public class AbstractFileTikaTextExtract implements AbstractFileExtract { private static final Logger logger = Logger.getLogger(IngestModuleAbstractFile.class.getName()); - private static final Logger tikaLogger = KeywordSearch.getTikaLogger(); private static final Charset OUTPUT_CHARSET = Server.DEFAULT_INDEXED_TEXT_CHARSET; static final int MAX_EXTR_TEXT_CHARS = 512 * 1024; private static final int SINGLE_READ_CHARS = 1024; @@ -131,13 +130,13 @@ public class AbstractFileTikaTextExtract implements AbstractFileExtract { } catch (TimeoutException te) { tika = null; final String msg = "Tika parse timeout for content: " + sourceFile.getId() + ", " + sourceFile.getName(); - tikaLogger.log(Level.WARNING, msg, te); + KeywordSearch.getTikaLogger().log(Level.WARNING, msg, te); logger.log(Level.WARNING, msg); throw new IngesterException(msg); } catch (Exception ex) { tika = null; final String msg = "Unexpected exception from Tika parse task execution for file: " + sourceFile.getId() + ", " + sourceFile.getName(); - tikaLogger.log(Level.WARNING, msg, ex); + KeywordSearch.getTikaLogger().log(Level.WARNING, msg, ex); logger.log(Level.WARNING, msg); throw new IngesterException(msg); } @@ -231,12 +230,12 @@ public class AbstractFileTikaTextExtract implements AbstractFileExtract { } } catch (IOException ex) { final String msg = "Unable to read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(); - tikaLogger.log(Level.WARNING, msg, ex); + KeywordSearch.getTikaLogger().log(Level.WARNING, msg, ex); logger.log(Level.WARNING, msg); success = false; } catch (Exception ex) { final String msg = "Unexpected error, can't read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(); - tikaLogger.log(Level.WARNING, msg, ex); + KeywordSearch.getTikaLogger().log(Level.WARNING, msg, ex); logger.log(Level.WARNING, msg); success = false; } finally { @@ -302,12 +301,12 @@ public class AbstractFileTikaTextExtract implements AbstractFileExtract { try { reader = tika.parse(stream, meta); } catch (IOException ex) { - tikaLogger.log(Level.WARNING, "Unable to Tika parse the content" + sourceFile.getId() + ": " + sourceFile.getName(), ex); + KeywordSearch.getTikaLogger().log(Level.WARNING, "Unable to Tika parse the content" + sourceFile.getId() + ": " + sourceFile.getName(), ex); tika = null; reader = null; } catch (Exception ex) { - tikaLogger.log(Level.WARNING, "Unable to Tika parse the content" + sourceFile.getId() + ": " + sourceFile.getName(), ex); + KeywordSearch.getTikaLogger().log(Level.WARNING, "Unable to Tika parse the content" + sourceFile.getId() + ": " + sourceFile.getName(), ex); tika = null; reader = null; } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties index acfad3b516..df2f075d77 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Bundle.properties @@ -1,66 +1,79 @@ -OpenIDE-Module-Name=KeywordSearch -ListBundleName=Keyword Lists -ListBundleConfig=Keyword List Configuration -IndexProgressPanel.statusText.text=Status text -IndexProgressPanel.cancelButton.text=Cancel -ExtractedContentPanel.hitLabel.text=Matches on page: -ExtractedContentPanel.hitCountLabel.text=- -ExtractedContentPanel.hitOfLabel.text=of -ExtractedContentPanel.hitTotalLabel.text=- -ExtractedContentPanel.hitButtonsLabel.text=Match -ExtractedContentPanel.hitPreviousButton.text= -ExtractedContentPanel.hitNextButton.text= -ExtractedContentPanel.copyMenuItem.text=Copy -ExtractedContentPanel.selectAllMenuItem.text=Select All -KeywordSearchEditListPanel.saveListButton.text=Save As -KeywordSearchEditListPanel.addWordField.text= -KeywordSearchEditListPanel.addWordButton.text=Add -KeywordSearchEditListPanel.chRegex.text=Regular Expression -KeywordSearchEditListPanel.deleteWordButton.text=Remove Selected -KeywordSearchEditListPanel.cutMenuItem.text=Cut -KeywordSearchEditListPanel.selectAllMenuItem.text=Select All -KeywordSearchEditListPanel.pasteMenuItem.text=Paste -KeywordSearchEditListPanel.copyMenuItem.text=Copy -KeywordSearchEditListPanel.exportButton.text=Export List -KeywordSearchEditListPanel.deleteListButton.text=Delete List -KeywordSearchListsManagementPanel.newListButton.text=New List -KeywordSearchEditListPanel.useForIngestCheckbox.text=Enable for ingest -KeywordSearchListsManagementPanel.importButton.text=Import List -KeywordSearchPanel.searchBox.text=Search... -KeywordSearchPanel.regExCheckboxMenuItem.text=Use Regular Expressions -KeywordSearchPanel.settingsLabel.text= -KeywordSearchListsViewerPanel.searchAddButton.text=Search -KeywordSearchListsViewerPanel.manageListsButton.text=Manage Lists -KeywordSearchIngestSimplePanel.jLabel1.text=Select keyword lists to enable during ingest: -KeywordSearchListsViewerPanel.ingestIndexLabel.text=Files Indexed: -KeywordSearchEditListPanel.selectorsCombo.toolTipText=Regular Expression selector type (optional) -KeywordSearchPanel.searchButton.text= -KeywordSearchPanel.cutMenuItem.text=Cut -KeywordSearchPanel.copyMenuItem.text=Copy -KeywordSearchPanel.pasteMenuItem.text=Paste -KeywordSearchPanel.selectAllMenuItem.text=Select All -ExtractedContentPanel.pageButtonsLabel.text=Page -ExtractedContentPanel.pageNextButton.text= -ExtractedContentPanel.pagePreviousButton.actionCommand=pagePreviousButton -ExtractedContentPanel.pagePreviousButton.text= -ExtractedContentPanel.pagesLabel.text=Page: -ExtractedContentPanel.pageOfLabel.text=of -ExtractedContentPanel.pageCurLabel.text=- -ExtractedContentPanel.pageTotalLabel.text=- -ExtractedContentPanel.hitLabel.toolTipText= -KeywordSearchEditListPanel.ingestMessagesCheckbox.text=Enable sending messages to inbox during ingest -KeywordSearchEditListPanel.ingestMessagesCheckbox.toolTipText=Send messages during triage / ingest when hits on keyword from this list occur -KeywordSearchConfigurationPanel2.skipNSRLCheckBox.text=Do not add files in NSRL (known files) to keyword index during ingest -KeywordSearchConfigurationPanel2.skipNSRLCheckBox.toolTipText=Requires Hash DB service to had run previously, or be selected for next ingest. -KeywordSearchConfigurationPanel2.filesIndexedValue.text=- -KeywordSearchConfigurationPanel2.filesIndexedLabel.text=Files in keyword index: -KeywordSearchIngestSimplePanel.languagesLabel.text=Scripts enabled for string extraction from unknown file types: -KeywordSearchIngestSimplePanel.languagesValLabel.text=- -KeywordSearchIngestSimplePanel.languagesLabel.toolTipText=Scripts enabled for string extraction from unknown file types. Changes can be done in Advanced Settings. -KeywordSearchIngestSimplePanel.languagesValLabel.toolTipText= -KeywordSearchConfigurationPanel3.languagesLabel.text=Enabled scripts (languages): -KeywordSearchConfigurationPanel2.chunksLabel.text=Chunks in keyword index: -KeywordSearchConfigurationPanel2.chunksValLabel.text=- -KeywordSearchConfigurationPanel3.enableUTF8Checkbox.text=Enable UTF8 text extraction -KeywordSearchConfigurationPanel3.enableUTF16Checkbox.text=Enable UTF16LE and UTF16BE string extraction -KeywordSearchConfigurationPanel3.jLabel1.text=Ingest settings for string extraction from unknown file types (changes effective on next ingest) +OpenIDE-Module-Name=KeywordSearch +ListBundleName=Keyword Lists +ListBundleConfig=Keyword List Configuration +IndexProgressPanel.statusText.text=Status text +IndexProgressPanel.cancelButton.text=Cancel +ExtractedContentPanel.hitLabel.text=Matches on page: +ExtractedContentPanel.hitCountLabel.text=- +ExtractedContentPanel.hitOfLabel.text=of +ExtractedContentPanel.hitTotalLabel.text=- +ExtractedContentPanel.hitButtonsLabel.text=Match +ExtractedContentPanel.hitPreviousButton.text= +ExtractedContentPanel.hitNextButton.text= +ExtractedContentPanel.copyMenuItem.text=Copy +ExtractedContentPanel.selectAllMenuItem.text=Select All +KeywordSearchEditListPanel.saveListButton.text=Save As +KeywordSearchEditListPanel.addWordField.text= +KeywordSearchEditListPanel.addWordButton.text=Add +KeywordSearchEditListPanel.chRegex.text=Regular Expression +KeywordSearchEditListPanel.deleteWordButton.text=Remove Selected +KeywordSearchEditListPanel.cutMenuItem.text=Cut +KeywordSearchEditListPanel.selectAllMenuItem.text=Select All +KeywordSearchEditListPanel.pasteMenuItem.text=Paste +KeywordSearchEditListPanel.copyMenuItem.text=Copy +KeywordSearchEditListPanel.exportButton.text=Export List +KeywordSearchEditListPanel.deleteListButton.text=Delete List +KeywordSearchListsManagementPanel.newListButton.text=New List +KeywordSearchEditListPanel.useForIngestCheckbox.text=Enable for ingest +KeywordSearchListsManagementPanel.importButton.text=Import List +KeywordSearchPanel.searchBox.text=Search... +KeywordSearchPanel.regExCheckboxMenuItem.text=Use Regular Expressions +KeywordSearchPanel.settingsLabel.text= +KeywordSearchListsViewerPanel.searchAddButton.text=Search +KeywordSearchListsViewerPanel.manageListsButton.text=Manage Lists +KeywordSearchIngestSimplePanel.jLabel1.text=Select keyword lists to enable during ingest: +KeywordSearchListsViewerPanel.ingestIndexLabel.text=Files Indexed: +KeywordSearchEditListPanel.selectorsCombo.toolTipText=Regular Expression selector type (optional) +KeywordSearchPanel.searchButton.text= +KeywordSearchPanel.cutMenuItem.text=Cut +KeywordSearchPanel.copyMenuItem.text=Copy +KeywordSearchPanel.pasteMenuItem.text=Paste +KeywordSearchPanel.selectAllMenuItem.text=Select All +ExtractedContentPanel.pageButtonsLabel.text=Page +ExtractedContentPanel.pageNextButton.text= +ExtractedContentPanel.pagePreviousButton.actionCommand=pagePreviousButton +ExtractedContentPanel.pagePreviousButton.text= +ExtractedContentPanel.pagesLabel.text=Page: +ExtractedContentPanel.pageOfLabel.text=of +ExtractedContentPanel.pageCurLabel.text=- +ExtractedContentPanel.pageTotalLabel.text=- +ExtractedContentPanel.hitLabel.toolTipText= +KeywordSearchEditListPanel.ingestMessagesCheckbox.text=Enable sending messages to inbox during ingest +KeywordSearchEditListPanel.ingestMessagesCheckbox.toolTipText=Send messages during triage / ingest when hits on keyword from this list occur +KeywordSearchConfigurationPanel2.skipNSRLCheckBox.text=Do not add files in NSRL (known files) to keyword index during ingest +KeywordSearchConfigurationPanel2.skipNSRLCheckBox.toolTipText=Requires Hash DB service to had run previously, or be selected for next ingest. +KeywordSearchConfigurationPanel2.filesIndexedValue.text=- +KeywordSearchConfigurationPanel2.filesIndexedLabel.text=Files in keyword index: +KeywordSearchIngestSimplePanel.languagesLabel.text=Scripts enabled for string extraction from unknown file types: +KeywordSearchIngestSimplePanel.languagesValLabel.text=- +KeywordSearchIngestSimplePanel.languagesLabel.toolTipText=Scripts enabled for string extraction from unknown file types. Changes can be done in Advanced Settings. +KeywordSearchIngestSimplePanel.languagesValLabel.toolTipText= +KeywordSearchConfigurationPanel3.languagesLabel.text=Enabled scripts (languages): +KeywordSearchConfigurationPanel2.chunksLabel.text=Chunks in keyword index: +KeywordSearchConfigurationPanel2.chunksValLabel.text=- +KeywordSearchConfigurationPanel3.enableUTF8Checkbox.text=Enable UTF8 text extraction +KeywordSearchConfigurationPanel3.enableUTF16Checkbox.text=Enable UTF16LE and UTF16BE string extraction +KeywordSearchEditListPanel.keywordOptionsLabel.text=Keyword Options +KeywordSearchEditListPanel.listOptionsLabel.text=List Options +KeywordSearchConfigurationPanel3.ingestSettingsLabel.text=Ingest settings for string extraction from unknown file types (changes effective on next ingest): +KeywordSearchConfigurationPanel2.settingsLabel.text=Settings +KeywordSearchConfigurationPanel2.informationLabel.text=Information +KeywordSearchListsManagementPanel.keywordListsLabel.text=Keyword Lists: +KeywordSearchEditListPanel.keywordsLabel.text=Keywords: +KeywordSearchConfigurationPanel2.jLabel1.text=Results update frequency during ingest: +KeywordSearchConfigurationPanel2.timeRadioButton1.toolTipText=20 mins. (fastest ingest time) +KeywordSearchConfigurationPanel2.timeRadioButton1.text=20 minutes (fastest ingest) +KeywordSearchConfigurationPanel2.timeRadioButton2.toolTipText=10 minutes (default ingest time) +KeywordSearchConfigurationPanel2.timeRadioButton2.text=10 minutes (default) +KeywordSearchConfigurationPanel2.timeRadioButton3.toolTipText=5 minutes (overall ingest time will be longest) +KeywordSearchConfigurationPanel2.timeRadioButton3.text=5 minutes (longest ingest) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ByteContentStream.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ByteContentStream.java index 1385ecba6d..ab053273dd 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ByteContentStream.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ByteContentStream.java @@ -24,7 +24,7 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.Charset; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.apache.solr.common.util.ContentStream; import org.sleuthkit.datamodel.AbstractContent; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java index 7498dcbc8c..5af8f1b396 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentPanel.java @@ -25,7 +25,7 @@ import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JMenuItem; import javax.swing.text.AbstractDocument; import javax.swing.text.AttributeSet; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java index bd78ed1f03..741988aeaa 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/ExtractedContentViewer.java @@ -28,7 +28,7 @@ import java.util.Collection; import java.util.LinkedHashMap; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.apache.solr.client.solrj.SolrServerException; import org.openide.nodes.Node; import org.openide.util.lookup.ServiceProvider; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedMatchesSource.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedMatchesSource.java index cda5315530..1bc61a8459 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedMatchesSource.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedMatchesSource.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.Map; import java.util.TreeSet; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrRequest.METHOD; import org.apache.solr.client.solrj.SolrServerException; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Ingester.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Ingester.java index a6547ff586..4beff35564 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Ingester.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Ingester.java @@ -31,7 +31,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.apache.solr.client.solrj.SolrRequest.METHOD; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.request.AbstractUpdateRequest; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Installer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Installer.java index 61f968fc07..50efcd80ca 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Installer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Installer.java @@ -19,7 +19,7 @@ package org.sleuthkit.autopsy.keywordsearch; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.openide.modules.ModuleInstall; import org.sleuthkit.autopsy.casemodule.Case; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/JerichoParserWrapper.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/JerichoParserWrapper.java index d9de3a0537..aea91e3f5a 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/JerichoParserWrapper.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/JerichoParserWrapper.java @@ -24,7 +24,7 @@ import java.io.Reader; import java.io.StringReader; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import net.htmlparser.jericho.Attributes; import net.htmlparser.jericho.Source; import net.htmlparser.jericho.StartTag; diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationAction.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationAction.java index b5fcfece57..1024a8030f 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationAction.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationAction.java @@ -1,63 +1,84 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2011 Basis Technology Corp. - * Contact: carrier sleuthkit org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.sleuthkit.autopsy.keywordsearch; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import org.openide.util.HelpCtx; -import org.openide.util.actions.CallableSystemAction; -import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; - -/** - * - * @author dfickling - */ -class KeywordSearchConfigurationAction extends CallableSystemAction{ - - private static final String ACTION_NAME = org.openide.util.NbBundle.getMessage(KeywordSearchPanel.class, "ListBundleConfig"); - - @Override - public void performAction() { - final KeywordSearchConfigurationPanel panel = KeywordSearchConfigurationPanel.getDefault(); - final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(); - dialog.addApplyButtonListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - dialog.close(); - } - }); - dialog.display(panel); - } - - @Override - public String getName() { - return ACTION_NAME; - } - - @Override - public HelpCtx getHelpCtx() { - return HelpCtx.DEFAULT_HELP; - } - - @Override - protected boolean asynchronous() { - return false; - } -} +/* + * Autopsy Forensic Browser + * + * Copyright 2011 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.sleuthkit.autopsy.keywordsearch; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; +import org.openide.util.HelpCtx; +import org.openide.util.actions.CallableSystemAction; +import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; + +/** + * System action to open the KeywordSearch Options panel. + */ +class KeywordSearchConfigurationAction extends CallableSystemAction{ + + private static final String ACTION_NAME = org.openide.util.NbBundle.getMessage(KeywordSearchPanel.class, "ListBundleConfig"); + private KeywordSearchConfigurationPanel panel; + + @Override + public void performAction() { + final KeywordSearchConfigurationPanel panel = getPanel(); + panel.load(); + final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(); + dialog.addApplyButtonListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + panel.store(); + dialog.close(); + } + }); + WindowListener exitListener = new WindowAdapter() { + + @Override + public void windowClosing(WindowEvent e) { + dialog.close(); + KeywordSearchListsXML.getCurrent().reload(); + } + }; + dialog.addWindowListener(exitListener); + dialog.display(panel); + } + + private KeywordSearchConfigurationPanel getPanel() { + if(panel==null) { + panel = new KeywordSearchConfigurationPanel(); + } + return panel; + } + + @Override + public String getName() { + return ACTION_NAME; + } + + @Override + public HelpCtx getHelpCtx() { + return HelpCtx.DEFAULT_HELP; + } + + @Override + protected boolean asynchronous() { + return false; + } +} diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel.java index 18ef3cb92c..ccbd968384 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel.java @@ -1,15 +1,15 @@ /* * Autopsy Forensic Browser - * - * Copyright 2012 Basis Technology Corp. + * + * Copyright 2011 Basis Technology Corp. * Contact: carrier sleuthkit org - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,39 +19,41 @@ package org.sleuthkit.autopsy.keywordsearch; -/** - * Container for KeywordSearchConfigurationPanelX tabs - */ -public class KeywordSearchConfigurationPanel extends javax.swing.JPanel { - - private static KeywordSearchConfigurationPanel instance = null; +import java.util.logging.Level; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.corecomponents.OptionsPanel; - /** Creates new form KeywordSearchConfigurationPanel */ - public KeywordSearchConfigurationPanel() { +/** + * Container panel for keyword search advanced configuration options + */ +final class KeywordSearchConfigurationPanel extends javax.swing.JPanel implements OptionsPanel { + + private static final Logger logger = Logger.getLogger(KeywordSearchConfigurationPanel.class.getName()); + private KeywordSearchConfigurationPanel1 listsPanel; + private KeywordSearchConfigurationPanel3 languagesPanel; + private KeywordSearchConfigurationPanel2 generalPanel; + + KeywordSearchConfigurationPanel() { initComponents(); customizeComponents(); } - public static KeywordSearchConfigurationPanel getDefault() { - if(instance == null) - instance = new KeywordSearchConfigurationPanel(); - return instance; - } - private void customizeComponents() { setName("Advanced Keyword Search Configuration"); - tabbedPane.insertTab("Lists", null, KeywordSearchConfigurationPanel1.getDefault(), "List configuration", 0); - tabbedPane.insertTab("String Extraction", null, KeywordSearchConfigurationPanel3.getDefault(), "String extraction configuration for Keyword Search Ingest", 1); - tabbedPane.insertTab("General", null, KeywordSearchConfigurationPanel2.getDefault(), "General configuration", 2); + listsPanel = new KeywordSearchConfigurationPanel1(); + languagesPanel = new KeywordSearchConfigurationPanel3(); + generalPanel = new KeywordSearchConfigurationPanel2(); + tabbedPane.insertTab("Lists", null, listsPanel, "List configuration", 0); + tabbedPane.insertTab("String Extraction", null, languagesPanel, "String extraction configuration for Keyword Search Ingest", 1); + tabbedPane.insertTab("General", null, generalPanel, "General configuration", 2); } - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. */ - @SuppressWarnings("unchecked") // //GEN-BEGIN:initComponents private void initComponents() { @@ -61,13 +63,41 @@ public class KeywordSearchConfigurationPanel extends javax.swing.JPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) + .addComponent(tabbedPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 675, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) + .addComponent(tabbedPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 505, Short.MAX_VALUE) ); }// //GEN-END:initComponents + + /** + * Load each of the tabs and reload the XML. + */ + @Override + public void load() { + // Deselect all table rows + listsPanel.load(); + languagesPanel.load(); + generalPanel.load(); + // Reload the XML to avoid 'ghost' vars + KeywordSearchListsXML.getCurrent().reload(); + } + + /** + * Store each panel's settings. + */ + @Override + public void store() { + listsPanel.store(); + languagesPanel.store(); + generalPanel.store(); + } + + boolean valid() { + // TODO check whether form is consistent and complete + return true; + } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JTabbedPane tabbedPane; // End of variables declaration//GEN-END:variables diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.form b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.form index d88483b1ff..7dc3d615a9 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.form +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.form @@ -1,4 +1,4 @@ - +
@@ -16,17 +16,23 @@ - + - + + + + + + + @@ -40,12 +46,12 @@ - + - + @@ -60,12 +66,12 @@ - + - + diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java index f44355b7ff..99014be961 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel1.java @@ -24,38 +24,31 @@ */ package org.sleuthkit.autopsy.keywordsearch; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; +import org.sleuthkit.autopsy.corecomponents.OptionsPanel; import org.sleuthkit.autopsy.ingest.IngestManager; /** - * - * @author dfickling + * Panel containing all other Keyword search Options panels. */ -public class KeywordSearchConfigurationPanel1 extends javax.swing.JPanel { +public class KeywordSearchConfigurationPanel1 extends javax.swing.JPanel implements OptionsPanel { KeywordSearchListsManagementPanel listsManagementPanel; KeywordSearchEditListPanel editListPanel; private static final Logger logger = Logger.getLogger(KeywordSearchConfigurationPanel1.class.getName()); private static final String KEYWORD_CONFIG_NAME = org.openide.util.NbBundle.getMessage(KeywordSearchPanel.class, "ListBundleConfig"); - private static KeywordSearchConfigurationPanel1 instance; /** Creates new form KeywordSearchConfigurationPanel1 */ - private KeywordSearchConfigurationPanel1() { + KeywordSearchConfigurationPanel1() { initComponents(); customizeComponents(); setName(KEYWORD_CONFIG_NAME); } - - public static KeywordSearchConfigurationPanel1 getDefault() { - if(instance == null) - instance = new KeywordSearchConfigurationPanel1(); - return instance; - } private void customizeComponents() { - listsManagementPanel = KeywordSearchListsManagementPanel.getDefault(); - editListPanel = KeywordSearchEditListPanel.getDefault(); + listsManagementPanel = new KeywordSearchListsManagementPanel(); + editListPanel = new KeywordSearchEditListPanel(); listsManagementPanel.addListSelectionListener(editListPanel); @@ -64,6 +57,16 @@ public class KeywordSearchConfigurationPanel1 extends javax.swing.JPanel { mainSplitPane.revalidate(); mainSplitPane.repaint(); } + + @Override + public void store() { + KeywordSearchListsXML.getCurrent().save(); + } + + @Override + public void load() { + listsManagementPanel.load(); + } /** This method is called from within the constructor to * initialize the form. @@ -78,15 +81,18 @@ public class KeywordSearchConfigurationPanel1 extends javax.swing.JPanel { jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); + mainSplitPane.setBorder(null); + mainSplitPane.setDividerLocation(275); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 100, Short.MAX_VALUE) + .addGap(0, 275, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 242, Short.MAX_VALUE) + .addGap(0, 327, Short.MAX_VALUE) ); mainSplitPane.setLeftComponent(jPanel1); @@ -95,11 +101,11 @@ public class KeywordSearchConfigurationPanel1 extends javax.swing.JPanel { jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 291, Short.MAX_VALUE) + .addGap(0, 318, Short.MAX_VALUE) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 242, Short.MAX_VALUE) + .addGap(0, 327, Short.MAX_VALUE) ); mainSplitPane.setRightComponent(jPanel2); @@ -108,11 +114,11 @@ public class KeywordSearchConfigurationPanel1 extends javax.swing.JPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(mainSplitPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(mainSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 598, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(mainSplitPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(mainSplitPane) ); }// //GEN-END:initComponents diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.form b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.form index c7507a5657..9d49c209e8 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.form +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.form @@ -2,7 +2,7 @@ - + @@ -20,24 +20,46 @@ - - + - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -45,9 +67,25 @@ - + + + + - + + + + + + + + + + + + + + @@ -58,7 +96,7 @@ - +
@@ -73,9 +111,6 @@ - - -
@@ -94,8 +129,6 @@ - - @@ -110,5 +143,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.java index 3b51d3933e..6bd240006a 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel2.java @@ -18,52 +18,53 @@ */ package org.sleuthkit.autopsy.keywordsearch; -import java.awt.Graphics; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.apache.solr.client.solrj.SolrServerException; -import org.openide.util.Exceptions; +import org.sleuthkit.autopsy.corecomponents.OptionsPanel; import org.sleuthkit.autopsy.ingest.IngestManager; +import org.sleuthkit.autopsy.keywordsearch.KeywordSearchIngestModule.UpdateFrequency; /** - * * General, not per list, keyword search configuration and status display widget */ -public class KeywordSearchConfigurationPanel2 extends javax.swing.JPanel { +public class KeywordSearchConfigurationPanel2 extends javax.swing.JPanel implements OptionsPanel { - private static KeywordSearchConfigurationPanel2 instance = null; private final Logger logger = Logger.getLogger(KeywordSearchConfigurationPanel2.class.getName()); /** * Creates new form KeywordSearchConfigurationPanel2 */ - public KeywordSearchConfigurationPanel2() { + KeywordSearchConfigurationPanel2() { initComponents(); customizeComponents(); } - public static KeywordSearchConfigurationPanel2 getDefault() { - if (instance == null) { - instance = new KeywordSearchConfigurationPanel2(); - } - return instance; - } - - @Override - public void paint(Graphics g) { - super.paint(g); - - activateWidgets(); - } - private void activateWidgets() { final KeywordSearchIngestModule service = KeywordSearchIngestModule.getDefault(); skipNSRLCheckBox.setSelected(service.getSkipKnown()); boolean enable = !IngestManager.getDefault().isIngestRunning() - && ! IngestManager.getDefault().isModuleRunning(KeywordSearchIngestModule.getDefault()); + && !IngestManager.getDefault().isModuleRunning(KeywordSearchIngestModule.getDefault()); skipNSRLCheckBox.setEnabled(enable); + setTimeSettingEnabled(enable); + + final UpdateFrequency curFreq = service.getUpdateFrequency(); + switch (curFreq) { + case FAST: + timeRadioButton1.setSelected(true); + break; + case AVG: + timeRadioButton2.setSelected(true); + break; + case SLOW: + timeRadioButton3.setSelected(true); + break; + default: + // + } + } /** @@ -75,21 +76,23 @@ public class KeywordSearchConfigurationPanel2 extends javax.swing.JPanel { // //GEN-BEGIN:initComponents private void initComponents() { - langButtonGroup = new javax.swing.ButtonGroup(); + timeGroup = new javax.swing.ButtonGroup(); skipNSRLCheckBox = new javax.swing.JCheckBox(); filesIndexedLabel = new javax.swing.JLabel(); filesIndexedValue = new javax.swing.JLabel(); - jSeparator2 = new javax.swing.JSeparator(); chunksLabel = new javax.swing.JLabel(); chunksValLabel = new javax.swing.JLabel(); + settingsLabel = new javax.swing.JLabel(); + informationLabel = new javax.swing.JLabel(); + settingsSeparator = new javax.swing.JSeparator(); + informationSeparator = new javax.swing.JSeparator(); + jLabel1 = new javax.swing.JLabel(); + timeRadioButton1 = new javax.swing.JRadioButton(); + timeRadioButton2 = new javax.swing.JRadioButton(); + timeRadioButton3 = new javax.swing.JRadioButton(); skipNSRLCheckBox.setText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.skipNSRLCheckBox.text")); // NOI18N skipNSRLCheckBox.setToolTipText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.skipNSRLCheckBox.toolTipText")); // NOI18N - skipNSRLCheckBox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - skipNSRLCheckBoxActionPerformed(evt); - } - }); filesIndexedLabel.setText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.filesIndexedLabel.text")); // NOI18N @@ -100,32 +103,78 @@ public class KeywordSearchConfigurationPanel2 extends javax.swing.JPanel { chunksValLabel.setText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.chunksValLabel.text")); // NOI18N + settingsLabel.setText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.settingsLabel.text")); // NOI18N + + informationLabel.setText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.informationLabel.text")); // NOI18N + + jLabel1.setText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.jLabel1.text")); // NOI18N + + timeRadioButton1.setText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.timeRadioButton1.text")); // NOI18N + timeRadioButton1.setToolTipText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.timeRadioButton1.toolTipText")); // NOI18N + + timeRadioButton2.setText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.timeRadioButton2.text")); // NOI18N + timeRadioButton2.setToolTipText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.timeRadioButton2.toolTipText")); // NOI18N + + timeRadioButton3.setText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.timeRadioButton3.text")); // NOI18N + timeRadioButton3.setToolTipText(org.openide.util.NbBundle.getMessage(KeywordSearchConfigurationPanel2.class, "KeywordSearchConfigurationPanel2.timeRadioButton3.toolTipText")); // NOI18N + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jSeparator2) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(skipNSRLCheckBox) .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(chunksLabel) - .addComponent(filesIndexedLabel)) + .addComponent(settingsLabel) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(filesIndexedValue, javax.swing.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE) - .addComponent(chunksValLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) - .addContainerGap(81, Short.MAX_VALUE)) + .addComponent(settingsSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 326, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(informationLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(informationSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 309, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(filesIndexedLabel) + .addGroup(layout.createSequentialGroup() + .addGap(141, 141, 141) + .addComponent(filesIndexedValue, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(skipNSRLCheckBox) + .addComponent(jLabel1) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(timeRadioButton2) + .addComponent(timeRadioButton1) + .addComponent(timeRadioButton3))) + .addGroup(layout.createSequentialGroup() + .addComponent(chunksLabel) + .addGap(18, 18, 18) + .addComponent(chunksValLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() - .addComponent(skipNSRLCheckBox) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(settingsLabel) + .addComponent(settingsSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(skipNSRLCheckBox) + .addGap(13, 13, 13) + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(timeRadioButton1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(timeRadioButton2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(timeRadioButton3) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(informationLabel) + .addComponent(informationSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 7, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(filesIndexedLabel) @@ -134,24 +183,64 @@ public class KeywordSearchConfigurationPanel2 extends javax.swing.JPanel { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(chunksLabel) .addComponent(chunksValLabel)) - .addContainerGap(31, Short.MAX_VALUE)) + .addContainerGap(37, Short.MAX_VALUE)) ); }// //GEN-END:initComponents -private void skipNSRLCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_skipNSRLCheckBoxActionPerformed - KeywordSearchIngestModule.getDefault().setSkipKnown(skipNSRLCheckBox.isSelected()); -}//GEN-LAST:event_skipNSRLCheckBoxActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel chunksLabel; private javax.swing.JLabel chunksValLabel; private javax.swing.JLabel filesIndexedLabel; private javax.swing.JLabel filesIndexedValue; - private javax.swing.JSeparator jSeparator2; - private javax.swing.ButtonGroup langButtonGroup; + private javax.swing.JLabel informationLabel; + private javax.swing.JSeparator informationSeparator; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel settingsLabel; + private javax.swing.JSeparator settingsSeparator; private javax.swing.JCheckBox skipNSRLCheckBox; + private javax.swing.ButtonGroup timeGroup; + private javax.swing.JRadioButton timeRadioButton1; + private javax.swing.JRadioButton timeRadioButton2; + private javax.swing.JRadioButton timeRadioButton3; // End of variables declaration//GEN-END:variables + @Override + public void store() { + final KeywordSearchIngestModule km = + KeywordSearchIngestModule.getDefault(); + + km.setSkipKnown(skipNSRLCheckBox.isSelected()); + km.setUpdateFrequency(getSelectedTimeValue()); + } + + @Override + public void load() { + activateWidgets(); + } + + private void setTimeSettingEnabled(boolean enabled) { + timeRadioButton1.setEnabled(enabled); + timeRadioButton2.setEnabled(enabled); + timeRadioButton3.setEnabled(enabled); + } + + + private UpdateFrequency getSelectedTimeValue() { + if (timeRadioButton1.isSelected()) { + return UpdateFrequency.FAST; + } else if (timeRadioButton2.isSelected()) { + return UpdateFrequency.AVG; + } else { + return UpdateFrequency.SLOW; + } + } + private void customizeComponents() { + + timeGroup.add(timeRadioButton1); + timeGroup.add(timeRadioButton2); + timeGroup.add(timeRadioButton3); + this.skipNSRLCheckBox.setSelected(KeywordSearchIngestModule.getDefault().getSkipKnown()); try { diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.form b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.form index 040d51dc49..828ee693cd 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.form +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.form @@ -16,36 +16,39 @@ - + + - - + + + - - - + + + + - + - - + + - + - - + + @@ -78,12 +81,12 @@ - + - + @@ -110,10 +113,10 @@
- + - + diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.java index 6864bb41f8..8e085976e2 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchConfigurationPanel3.java @@ -1,10 +1,24 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2012 Basis Technology Corp. + * Contact: carrier sleuthkit org + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package org.sleuthkit.autopsy.keywordsearch; -import java.awt.Graphics; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -12,8 +26,9 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import javax.swing.JCheckBox; +import org.sleuthkit.autopsy.corecomponents.OptionsPanel; import org.sleuthkit.autopsy.coreutils.StringExtract; import org.sleuthkit.autopsy.coreutils.StringExtract.StringExtractUnicodeTable.SCRIPT; import org.sleuthkit.autopsy.ingest.IngestManager; @@ -21,12 +36,13 @@ import org.sleuthkit.autopsy.ingest.IngestManager; /** * Advanced configuration panel handling languages config. */ -public class KeywordSearchConfigurationPanel3 extends javax.swing.JPanel { +public class KeywordSearchConfigurationPanel3 extends javax.swing.JPanel implements OptionsPanel { private static KeywordSearchConfigurationPanel3 instance = null; private final Logger logger = Logger.getLogger(KeywordSearchConfigurationPanel3.class.getName()); private final Map scripts = new HashMap(); private ActionListener updateLanguagesAction; + private List