Added Copyright headers, added/cleaned up comments.

This commit is contained in:
raman-bt 2013-10-18 14:54:35 -04:00
parent 1f7e98f28e
commit 6627dadd89
6 changed files with 105 additions and 57 deletions

View File

@ -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 <at> sleuthkit <dot> 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<Integer, Integer> {
private Logger logger = Logger.getLogger(AddImageTask.class.getName());
@ -275,7 +297,7 @@ public class AddImageTask extends SwingWorker<Integer, Integer> {
}
/*
* Call the callback with proper parameters
* Call the callback with results, new content, and errors, if any
*/
private void doCallBack()
{

View File

@ -296,7 +296,7 @@ class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel<WizardDe
//if errors, display them on the progress panel
for ( String err: errList ) {
// RAMANM TBD: there probably should be an error level for each error
// RAMAN TBD: there probably should be an error level for each error
progressPanel.addErrors(err, false);
}

View File

@ -1,34 +1,28 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* Autopsy Forensic Browser
*
* Copyright 2013 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> 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;

View File

@ -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 <at> sleuthkit <dot> 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 {

View File

@ -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 <at> sleuthkit <dot> 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 {

View File

@ -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<Content> 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();