From 6627dadd89a0000bffdef1305bcc0c0ba7af26db Mon Sep 17 00:00:00 2001 From: raman-bt Date: Fri, 18 Oct 2013 14:54:35 -0400 Subject: [PATCH] Added Copyright headers, added/cleaned up comments. --- .../autopsy/casemodule/AddImageTask.java | 28 +++++++++-- .../AddImageWizardIngestConfigPanel.java | 2 +- .../autopsy/casemodule/ImageDSProcessor.java | 38 +++++++-------- .../corecomponentinterfaces/DSPCallback.java | 25 ++++++++-- .../DSPProgressMonitor.java | 22 +++++++-- .../DataSourceProcessor.java | 47 +++++++++---------- 6 files changed, 105 insertions(+), 57 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java index def759ca5b..771d217eaa 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageTask.java @@ -1,7 +1,22 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2013 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 java.awt.EventQueue; @@ -23,6 +38,13 @@ import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskDataException; import org.sleuthkit.datamodel.TskException; +/* + * A background task (swingworker) that adds the given image to + * database using the Sleuthkit JNI interface. + * + * It updates the given ProgressMonitor as it works through adding the image, + * and et the end, calls the specified Callback. + */ public class AddImageTask extends SwingWorker { private Logger logger = Logger.getLogger(AddImageTask.class.getName()); @@ -275,7 +297,7 @@ public class AddImageTask extends SwingWorker { } /* - * Call the callback with proper parameters + * Call the callback with results, new content, and errors, if any */ private void doCallBack() { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java index a936b3294c..991e3fef5b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java @@ -296,7 +296,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel 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 java.awt.Color; -import java.awt.EventQueue; -import java.awt.Window; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; import java.util.logging.Level; import javax.swing.JPanel; -import javax.swing.JProgressBar; -import javax.swing.SwingUtilities; -import javax.swing.SwingWorker; -import org.openide.WizardDescriptor; import org.openide.util.lookup.ServiceProvider; -import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer; import org.sleuthkit.autopsy.coreutils.Logger; -import org.sleuthkit.autopsy.coreutils.PlatformUtil; -import org.sleuthkit.datamodel.Content; -import org.sleuthkit.datamodel.Image; -import org.sleuthkit.datamodel.SleuthkitCase; -import org.sleuthkit.datamodel.SleuthkitJNI; -import org.sleuthkit.datamodel.TskCoreException; -import org.sleuthkit.datamodel.TskDataException; -import org.sleuthkit.datamodel.TskException; import org.sleuthkit.autopsy.corecomponentinterfaces.DSPProgressMonitor; import org.sleuthkit.autopsy.corecomponentinterfaces.DSPCallback; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor; diff --git a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DSPCallback.java b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DSPCallback.java index b5c4b7cba9..f3bdf028da 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DSPCallback.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DSPCallback.java @@ -1,7 +1,22 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2013 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.corecomponentinterfaces; import java.awt.EventQueue; @@ -9,7 +24,11 @@ import java.util.List; import org.sleuthkit.datamodel.Content; /** - * Abstract class for a callback + * Abstract class for a callback for a DataSourceProcessor. + * + * Ensures that DSP invokes the caller overridden method, doneEDT(), + * in the EDT thread. + * */ public abstract class DSPCallback { diff --git a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DSPProgressMonitor.java b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DSPProgressMonitor.java index b375301aed..c68574eeb2 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DSPProgressMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DSPProgressMonitor.java @@ -1,13 +1,27 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Autopsy Forensic Browser + * + * Copyright 2013 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.corecomponentinterfaces; /* - * An GUI agnostic DSPProgressMonitor interface for DataSorceProcesssors to + * An GUI agnostic DSPProgressMonitor interface for DataSourceProcesssors to * indicate progress. - * It models after a JProgressbar though could use any underlying implementation + * It models after a JProgressbar though it could use any underlying implementation */ public interface DSPProgressMonitor { diff --git a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DataSourceProcessor.java b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DataSourceProcessor.java index 59fc291c6e..4abce176b7 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DataSourceProcessor.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponentinterfaces/DataSourceProcessor.java @@ -18,19 +18,31 @@ */ package org.sleuthkit.autopsy.corecomponentinterfaces; -import java.util.List; + import javax.swing.JPanel; -import org.openide.WizardDescriptor; import org.sleuthkit.datamodel.Content; +/* + * Defines an interface used by the Add DataSource wizard to discover different + * Data SourceProcessors. + * A data source for Autopsy may be: + * - Disk Image (Encase, Raw....) + * - Local Disk + * - Logical file(s) + * - Phone Image + * - A CellXML file with content extracted from phone. + * + * Each data source may have its unique attributes and may need to be processed + * differently. + * + * The DataSourceProcessor interface defines a uniform mechanism for thre Autopsy UI + * to: + * - collect details for the data source to be processed. + * - Process the data source in the background + * - Be notified when the processing is complete + */ public interface DataSourceProcessor { - - - - - // public DataSourceProcessor createInstance(); - - + /** * Returns the type of Data Source it handles. * This name gets displayed in the drop-down listbox @@ -59,27 +71,14 @@ public interface DataSourceProcessor { **/ void run(DSPProgressMonitor progressPanel, DSPCallback dspCallback); - /** - * Called after run() is done to get the new content added by the handler. - * Returns a list of content added by the data source handler - **/ - // List getNewContents(); - - - /** - * Called to get the list of errors. - **/ - // String[] getErrors(); /** * Called to cancel the background processing. - * - * TODO look into current use cases to see if this should wait until it has stopped or not. **/ void cancel(); - /** - * Called to reset/reinit the DSP. + /** + * Called to reset/reinitialize the DSP. * **/ void reset();