1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-06 02:24:30 +00:00

Merge remote-tracking branch 'upstream/develop' into UiChanges

This commit is contained in:
alexjacks92
2014-05-13 14:49:04 -04:00
23 changed files with 169 additions and 168 deletions

View File

@@ -31,19 +31,15 @@ import org.openide.awt.ActionRegistration;
import org.openide.modules.Places;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
@ActionID(
category = "Help",
id = "org.sleuthkit.autopsy.actions.OpenLogFolder")
@ActionRegistration(
displayName = "#CTL_OpenLogFolder")
@ActionReference(path = "Menu/Help", position = 1750)
// Move to Bundle for I18N
//@Messages("CTL_OpenLogFolder=Open Log Folder")
/**
* Action in menu to open the folder containing the log files
*/
@ActionRegistration(
displayName = "#CTL_OpenLogFolder", iconInMenu = true)
@ActionReference(path = "Menu/Help", position = 1750)
@ActionID(id = "org.sleuthkit.autopsy.actions.OpenLogFolderAction", category = "Help")
public final class OpenLogFolderAction implements ActionListener {
@Override

View File

@@ -130,16 +130,6 @@
<folder name="Help">
<file name="org-netbeans-core-actions-AboutAction.instance_hidden"/>
<file name="org-sleuthkit-autopsy-actions-OpenLogFolder.instance_hidden"/>
<file name="org-sleuthkit-autopsy-actions-OpenLogFolderAction.instance">
<attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
<attr name="noIconInMenu" boolvalue="false"/>
</file>
<file name="org-sleuthkit-autopsy-corecomponents-AboutWindowAction.instance">
<attr name="delegate" newvalue="org.sleuthkit.autopsy.corecomponents.AboutWindowAction"/>
<attr name="displayName" bundlevalue="org.sleuthkit.autopsy.corecomponents.Bundle#CTL_CustomAboutAction"/>
<attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
<attr name="noIconInMenu" boolvalue="false"/>
</file>
</folder>
<folder name="Toolbars">
<folder name="QuickSearch_hidden"/>
@@ -271,10 +261,6 @@
<file name="org-netbeans-core-actions-AboutAction.shadow_hidden"/>
<file name="org-netbeans-modules-autoupdate-ui-actions-CheckForUpdatesAction.shadow_hidden"/>
<attr name="master-help.xml/org-sleuthkit-autopsy-corecomponents-CustomAboutAction.shadow" boolvalue="true"/>
<file name="org-sleuthkit-autopsy-corecomponents-CustomAboutAction.shadow">
<attr name="originalFile" stringvalue="Actions/Help/org-sleuthkit-autopsy-corecomponents-AboutWindowAction.instance"/>
<attr name="position" intvalue="3000"/>
</file>
</folder>
</folder>

View File

@@ -23,11 +23,17 @@ import org.openide.util.NbBundle;
import org.netbeans.core.actions.AboutAction;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
/**
* Action to open custom implementation of the "About" window from the Help menu.
*/
class AboutWindowAction extends AboutAction {
@ActionID(id = "org.sleuthkit.autopsy.corecomponents.AboutWindowAction", category = "Help")
@ActionRegistration(displayName = "#CTL_CustomAboutAction", iconInMenu = true)
@ActionReference(path = "Menu/Help", name = "org-sleuthkit-autopsy-corecomponents-CustomAboutAction", position = 3000)
public class AboutWindowAction extends AboutAction {
@Override
public void performAction() {

View File

@@ -24,17 +24,18 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Writer;
import java.util.logging.Level;
import org.sleuthkit.autopsy.coreutils.Logger;
/**
* Takes care of forking a process and reading output / error streams to either a
* string buffer or directly to a file writer
* BC: @@@ This code scares me in a multi-threaded env. I think the arguments should be passed into the constructor
* and different run methods that either return the string or use the redirected writer.
*/
public final class ExecUtil {
private static final Logger logger = Logger.getLogger(ExecUtil.class.getName());
private Process proc = null;
private String command = null;
private final String command = null;
private ExecUtil.StreamToStringRedirect errorStringRedirect = null;
private ExecUtil.StreamToStringRedirect outputStringRedirect = null;
private ExecUtil.StreamToWriterRedirect outputWriterRedirect = null;
@@ -49,8 +50,6 @@ import org.sleuthkit.autopsy.coreutils.Logger;
* @return string buffer with captured stdout
*/
public synchronized String execute(final String aCommand, final String... params) throws IOException, InterruptedException {
String output = "";
// build command array
String[] arrayCommand = new String[params.length + 1];
arrayCommand[0] = aCommand;
@@ -70,29 +69,21 @@ import org.sleuthkit.autopsy.coreutils.Logger;
//stderr redirect
errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR"); //NON-NLS
errorStringRedirect.start();
//stdout redirect
outputStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getInputStream(), "OUTPUT"); //NON-NLS
//start redurectors
errorStringRedirect.start();
outputStringRedirect.start();
//wait for process to complete and capture error core
final int exitVal = proc.waitFor();
logger.log(Level.INFO, aCommand + " exit value: " + exitVal); //NON-NLS
errorStringRedirect.stopRun();
errorStringRedirect = null;
outputStringRedirect.stopRun();
output = outputStringRedirect.getOutput();
outputStringRedirect = null;
//gc process with its streams
//proc = null;
return output;
// wait for output redirectors to finish writing / reading
outputWriterRedirect.join();
errorStringRedirect.join();
return outputStringRedirect.getOutput();
}
/**
@@ -125,20 +116,26 @@ import org.sleuthkit.autopsy.coreutils.Logger;
//stderr redirect
errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR"); //NON-NLS
errorStringRedirect.start();
//stdout redirect
outputWriterRedirect = new ExecUtil.StreamToWriterRedirect(proc.getInputStream(), stdoutWriter);
//start redurectors
errorStringRedirect.start();
outputWriterRedirect.start();
//wait for process to complete and capture error core
final int exitVal = proc.waitFor();
logger.log(Level.INFO, aCommand + " exit value: " + exitVal); //NON-NLS
// wait for them to finish writing / reading
outputWriterRedirect.join();
errorStringRedirect.join();
//gc process with its streams
//proc = null;
}
/**
* Interrupt the running process and stop its stream redirect threads
@@ -173,7 +170,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
* managed in this thread.
*
*/
public static class StreamToStringRedirect extends Thread {
private static class StreamToStringRedirect extends Thread {
private static final Logger logger = Logger.getLogger(StreamToStringRedirect.class.getName());
private InputStream is;
@@ -243,7 +240,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
* Any exception during execution of the command is managed in this thread.
*
*/
public static class StreamToWriterRedirect extends Thread {
private static class StreamToWriterRedirect extends Thread {
private static final Logger logger = Logger.getLogger(StreamToStringRedirect.class.getName());
private InputStream is;

View File

@@ -282,13 +282,13 @@ public class EmailExtracted implements AutopsyVisitableItem {
public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestEvent.DATA.toString())) {
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
if (((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG) {
emailResults.update();
}
}
else if (eventType.equals(IngestManager.IngestEvent.INGEST_JOB_COMPLETED.toString())
|| eventType.equals(IngestManager.IngestEvent.INGEST_JOB_CANCELLED.toString())) {
else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
emailResults.update();
}
}
@@ -296,14 +296,16 @@ public class EmailExtracted implements AutopsyVisitableItem {
@Override
protected void addNotify() {
IngestManager.addPropertyChangeListener(pcl);
IngestManager.getInstance().addIngestJobEventListener(pcl);
IngestManager.getInstance().addIngestModuleEventListener(pcl);
emailResults.update();
emailResults.addObserver(this);
}
@Override
protected void removeNotify() {
IngestManager.removePropertyChangeListener(pcl);
IngestManager.getInstance().removeIngestJobEventListener(pcl);
IngestManager.getInstance().removeIngestModuleEventListener(pcl);
emailResults.deleteObserver(this);
}

View File

@@ -152,13 +152,13 @@ public class ExtractedContent implements AutopsyVisitableItem {
public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestEvent.DATA.toString())) {
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue();
if (doNotShow.contains(event.getArtifactType()) == false) {
refresh(true);
}
} else if (eventType.equals(IngestManager.IngestEvent.INGEST_JOB_COMPLETED.toString())
|| eventType.equals(IngestManager.IngestEvent.INGEST_JOB_CANCELLED.toString())) {
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
refresh(true);
}
}
@@ -166,12 +166,14 @@ public class ExtractedContent implements AutopsyVisitableItem {
@Override
protected void addNotify() {
IngestManager.addPropertyChangeListener(pcl);
IngestManager.getInstance().addIngestJobEventListener(pcl);
IngestManager.getInstance().addIngestModuleEventListener(pcl);
}
@Override
protected void removeNotify() {
IngestManager.removePropertyChangeListener(pcl);
IngestManager.getInstance().removeIngestJobEventListener(pcl);
IngestManager.getInstance().removeIngestModuleEventListener(pcl);
typeNodeList.clear();
}
@@ -347,13 +349,13 @@ public class ExtractedContent implements AutopsyVisitableItem {
public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestEvent.DATA.toString())) {
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue();
if (event.getArtifactType() == type) {
refresh(true);
}
} else if (eventType.equals(IngestManager.IngestEvent.INGEST_JOB_COMPLETED.toString())
|| eventType.equals(IngestManager.IngestEvent.INGEST_JOB_CANCELLED.toString())) {
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
refresh(true);
}
}
@@ -361,12 +363,14 @@ public class ExtractedContent implements AutopsyVisitableItem {
@Override
protected void addNotify() {
IngestManager.addPropertyChangeListener(pcl);
IngestManager.getInstance().addIngestJobEventListener(pcl);
IngestManager.getInstance().addIngestModuleEventListener(pcl);
}
@Override
protected void removeNotify() {
IngestManager.removePropertyChangeListener(pcl);
IngestManager.getInstance().removeIngestJobEventListener(pcl);
IngestManager.getInstance().removeIngestModuleEventListener(pcl);
}
@Override

View File

@@ -23,7 +23,6 @@ import java.beans.PropertyChangeListener;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
@@ -57,8 +56,8 @@ public class HashsetHits implements AutopsyVisitableItem {
private static final String HASHSET_HITS = BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getLabel();
private static final String DISPLAY_NAME = BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getDisplayName();
private static final Logger logger = Logger.getLogger(HashsetHits.class.getName());
private SleuthkitCase skCase;
private HashsetResults hashsetResults;
private final SleuthkitCase skCase;
private final HashsetResults hashsetResults;
public HashsetHits(SleuthkitCase skCase) {
this.skCase = skCase;
@@ -183,13 +182,13 @@ public class HashsetHits implements AutopsyVisitableItem {
public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestEvent.DATA.toString())) {
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
if (((ModuleDataEvent) evt.getOldValue()).getArtifactType() == ARTIFACT_TYPE.TSK_HASHSET_HIT) {
hashsetResults.update();
}
}
else if (eventType.equals(IngestManager.IngestEvent.INGEST_JOB_COMPLETED.toString())
|| eventType.equals(IngestManager.IngestEvent.INGEST_JOB_CANCELLED.toString())) {
else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
hashsetResults.update();
}
}
@@ -197,14 +196,16 @@ public class HashsetHits implements AutopsyVisitableItem {
@Override
protected void addNotify() {
IngestManager.addPropertyChangeListener(pcl);
IngestManager.getInstance().addIngestJobEventListener(pcl);
IngestManager.getInstance().addIngestModuleEventListener(pcl);
hashsetResults.update();
hashsetResults.addObserver(this);
}
@Override
protected void removeNotify() {
IngestManager.removePropertyChangeListener(pcl);
IngestManager.getInstance().removeIngestJobEventListener(pcl);
IngestManager.getInstance().removeIngestModuleEventListener(pcl);
hashsetResults.deleteObserver(this);
}
@@ -229,7 +230,7 @@ public class HashsetHits implements AutopsyVisitableItem {
* Node for a hash set name
*/
public class HashsetNameNode extends DisplayableItemNode implements Observer {
private String hashSetName;
private final String hashSetName;
public HashsetNameNode(String hashSetName) {
super(Children.create(new HitFactory(hashSetName), true), Lookups.singleton(hashSetName));
super.setName(hashSetName);

View File

@@ -178,14 +178,14 @@ public class InterestingHits implements AutopsyVisitableItem {
public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestEvent.DATA.toString())) {
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
if ((((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT) ||
(((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT)) {
interestingResults.update();
}
}
else if (eventType.equals(IngestManager.IngestEvent.INGEST_JOB_COMPLETED.toString())
|| eventType.equals(IngestManager.IngestEvent.INGEST_JOB_CANCELLED.toString())) {
else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
interestingResults.update();
}
}
@@ -193,14 +193,16 @@ public class InterestingHits implements AutopsyVisitableItem {
@Override
protected void addNotify() {
IngestManager.addPropertyChangeListener(pcl);
IngestManager.getInstance().addIngestJobEventListener(pcl);
IngestManager.getInstance().addIngestModuleEventListener(pcl);
interestingResults.update();
interestingResults.addObserver(this);
}
@Override
protected void removeNotify() {
IngestManager.removePropertyChangeListener(pcl);
IngestManager.getInstance().removeIngestJobEventListener(pcl);
IngestManager.getInstance().removeIngestModuleEventListener(pcl);
interestingResults.deleteObserver(this);
}

View File

@@ -236,13 +236,13 @@ public class KeywordHits implements AutopsyVisitableItem {
public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestEvent.DATA.toString())) {
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
if (((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT) {
keywordResults.update();
}
}
else if (eventType.equals(IngestManager.IngestEvent.INGEST_JOB_COMPLETED.toString())
|| eventType.equals(IngestManager.IngestEvent.INGEST_JOB_CANCELLED.toString())) {
else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
keywordResults.update();
}
}
@@ -250,14 +250,16 @@ public class KeywordHits implements AutopsyVisitableItem {
@Override
protected void addNotify() {
IngestManager.addPropertyChangeListener(pcl);
IngestManager.getInstance().addIngestJobEventListener(pcl);
IngestManager.getInstance().addIngestModuleEventListener(pcl);
keywordResults.update();
keywordResults.addObserver(this);
}
@Override
protected void removeNotify() {
IngestManager.removePropertyChangeListener(pcl);
IngestManager.getInstance().removeIngestJobEventListener(pcl);
IngestManager.getInstance().removeIngestModuleEventListener(pcl);
keywordResults.deleteObserver(this);
}

View File

@@ -121,12 +121,12 @@ public class Tags implements AutopsyVisitableItem {
@Override
public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestEvent.DATA.toString())) {
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
if ((((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_ARTIFACT) || ((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_FILE) {
refresh(true);
tagResults.update();
}
} else if (eventType.equals(IngestManager.IngestEvent.INGEST_JOB_COMPLETED.toString()) || eventType.equals(IngestManager.IngestEvent.INGEST_JOB_CANCELLED.toString())) {
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()) || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
refresh(true);
tagResults.update();
}
@@ -135,14 +135,16 @@ public class Tags implements AutopsyVisitableItem {
@Override
protected void addNotify() {
IngestManager.addPropertyChangeListener(pcl);
IngestManager.getInstance().addIngestJobEventListener(pcl);
IngestManager.getInstance().addIngestModuleEventListener(pcl);
tagResults.update();
tagResults.addObserver(this);
}
@Override
protected void removeNotify() {
IngestManager.removePropertyChangeListener(pcl);
IngestManager.getInstance().removeIngestJobEventListener(pcl);
IngestManager.getInstance().removeIngestModuleEventListener(pcl);
tagResults.deleteObserver(this);
}

View File

@@ -56,7 +56,6 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.BlackboardResultViewer;
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
import org.sleuthkit.autopsy.corecomponents.TableFilterNode;
import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode;
import org.sleuthkit.autopsy.datamodel.ExtractedContent.RootNode;
import org.sleuthkit.autopsy.datamodel.DataSources;
import org.sleuthkit.autopsy.datamodel.DataSourcesNode;
import org.sleuthkit.autopsy.datamodel.KeywordHits;
@@ -67,8 +66,6 @@ import org.sleuthkit.autopsy.datamodel.RootContentChildren;
import org.sleuthkit.autopsy.datamodel.Views;
import org.sleuthkit.autopsy.datamodel.ViewsNode;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestEvent;
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.Content;
@@ -578,18 +575,18 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
else if (changed.equals(ExplorerManager.PROP_SELECTED_NODES)) {
respondSelection((Node[]) oldValue, (Node[]) newValue);
}
else if (changed.equals(IngestEvent.DATA.toString())) {
else if (changed.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
// nothing to do here.
// all nodes should be listening for these events and update accordingly.
} else if (changed.equals(IngestEvent.INGEST_JOB_COMPLETED.toString())
|| changed.equals(IngestEvent.INGEST_JOB_CANCELLED.toString())) {
} else if (changed.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| changed.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
refreshDataSourceTree();
}
});
} else if (changed.equals(IngestEvent.CONTENT_CHANGED.toString())) {
} else if (changed.equals(IngestManager.IngestModuleEvent.CONTENT_CHANGED.toString())) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {

View File

@@ -37,6 +37,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
*/
public class SampleModuleIngestJobSettings implements IngestModuleIngestJobSettings {
private static final long serialVersionUID = 1L;
private boolean skipKnownFiles = true;
SampleModuleIngestJobSettings() {
@@ -47,8 +48,8 @@ public class SampleModuleIngestJobSettings implements IngestModuleIngestJobSetti
}
@Override
public String getVersionNumber() {
return "1.0"; //NON-NLS
public long getVersionNumber() {
return serialVersionUID;
}
void setSkipKnownFiles(boolean enabled) {

View File

@@ -230,45 +230,55 @@ public class IngestManager {
}
/**
* Ingest events.
* Ingest job events.
*/
public enum IngestEvent {
public enum IngestJobEvent {
/**
* Property change event fired when an ingest job is started. The old
* value of the PropertyChangeEvent object is set to the ingest job id,
* and the new value is set to null.
*/
INGEST_JOB_STARTED,
STARTED,
/**
* Property change event fired when an ingest job is completed. The old
* value of the PropertyChangeEvent object is set to the ingest job id,
* and the new value is set to null.
*/
INGEST_JOB_COMPLETED,
COMPLETED,
/**
* Property change event fired when an ingest job is canceled. The old
* value of the PropertyChangeEvent object is set to the ingest job id,
* and the new value is set to null.
*/
INGEST_JOB_CANCELLED,
CANCELLED,
};
/**
* Ingest module events.
*/
public enum IngestModuleEvent {
/**
* Event sent when an ingest module posts new data to blackboard or
* somewhere else. Second argument of the property change fired contains
* ModuleDataEvent object and third argument is null. The object can
* contain encapsulated new data created by the module. Listener can
* also query new data as needed.
* Property change event fired when an ingest module adds new data to a
* case, usually by posting to the blackboard. The old value of the
* PropertyChangeEvent is a ModuleDataEvent object, and the new value is
* set to null.
*/
DATA,
DATA_ADDED,
/**
* Event send when content changed, either its attributes changed, or
* new content children have been added. I.e. from ZIP files or Carved
* files
* Property change event fired when an ingest module adds new content to
* a case or changes a recorded attribute of existing content. For
* example, if a module adds an extracted or carved file to a case, the
* module should fire this event. The old value of the
* PropertyChangeEvent is a ModuleContentEvent object, and the new value
* is set to null.
*/
CONTENT_CHANGED,
/**
* Event sent when a file has finished going through a pipeline of
* modules. Second argument is the object ID. Third argument is null
* Property change event fired when the ingest of a file is completed.
* The old value of the PropertyChangeEvent is the Autopsy object ID of
* the file, and the new value is set to null.
*/
FILE_DONE,
};
@@ -309,35 +319,13 @@ public class IngestManager {
ingestModuleEventPublisher.removePropertyChangeListener(listener);
}
/**
* Add an ingest module event property change listener.
*
* @deprecated
* @param listener The PropertyChangeListener to register.
*/
public static void addPropertyChangeListener(final PropertyChangeListener listener) {
instance.ingestJobEventPublisher.addPropertyChangeListener(listener);
instance.ingestModuleEventPublisher.addPropertyChangeListener(listener);
}
/**
* Remove an ingest module event property change listener.
*
* @deprecated
* @param listener The PropertyChangeListener to unregister.
*/
public static void removePropertyChangeListener(final PropertyChangeListener listener) {
instance.ingestJobEventPublisher.removePropertyChangeListener(listener);
instance.ingestModuleEventPublisher.removePropertyChangeListener(listener);
}
/**
* Fire an ingest event signifying an ingest job started.
*
* @param ingestJobId The ingest job id.
*/
void fireIngestJobStarted(long ingestJobId) {
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestJobEventPublisher, IngestEvent.INGEST_JOB_STARTED, ingestJobId, null));
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestJobEventPublisher, IngestJobEvent.STARTED, ingestJobId, null));
}
/**
@@ -346,7 +334,7 @@ public class IngestManager {
* @param ingestJobId The ingest job id.
*/
void fireIngestJobCompleted(long ingestJobId) {
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestJobEventPublisher, IngestEvent.INGEST_JOB_COMPLETED, ingestJobId, null));
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestJobEventPublisher, IngestJobEvent.COMPLETED, ingestJobId, null));
}
/**
@@ -355,7 +343,7 @@ public class IngestManager {
* @param ingestJobId The ingest job id.
*/
void fireIngestJobCancelled(long ingestJobId) {
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestJobEventPublisher, IngestEvent.INGEST_JOB_CANCELLED, ingestJobId, null));
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestJobEventPublisher, IngestJobEvent.CANCELLED, ingestJobId, null));
}
/**
@@ -364,7 +352,7 @@ public class IngestManager {
* @param fileId The object id of file.
*/
void fireFileIngestDone(long fileId) {
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestModuleEventPublisher, IngestEvent.FILE_DONE, fileId, null));
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestModuleEventPublisher, IngestModuleEvent.FILE_DONE, fileId, null));
}
/**
@@ -373,7 +361,7 @@ public class IngestManager {
* @param moduleDataEvent A ModuleDataEvent with the details of the posting.
*/
void fireIngestModuleDataEvent(ModuleDataEvent moduleDataEvent) {
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestModuleEventPublisher, IngestEvent.DATA, moduleDataEvent, null));
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestModuleEventPublisher, IngestModuleEvent.DATA_ADDED, moduleDataEvent, null));
}
/**
@@ -384,7 +372,7 @@ public class IngestManager {
* content.
*/
void fireIngestModuleContentEvent(ModuleContentEvent moduleContentEvent) {
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestModuleEventPublisher, IngestEvent.CONTENT_CHANGED, moduleContentEvent, null));
fireIngestEventsThreadPool.submit(new FireIngestEventThread(ingestModuleEventPublisher, IngestModuleEvent.CONTENT_CHANGED, moduleContentEvent, null));
}
/**
@@ -534,13 +522,23 @@ public class IngestManager {
private static class FireIngestEventThread implements Runnable {
private final PropertyChangeSupport publisher;
private final IngestEvent event;
private final IngestJobEvent jobEvent;
private final IngestModuleEvent moduleEvent;
private final Object oldValue;
private final Object newValue;
FireIngestEventThread(PropertyChangeSupport publisher, IngestEvent event, Object oldValue, Object newValue) {
FireIngestEventThread(PropertyChangeSupport publisher, IngestJobEvent event, Object oldValue, Object newValue) {
this.publisher = publisher;
this.event = event;
this.jobEvent = event;
this.moduleEvent = null;
this.oldValue = oldValue;
this.newValue = newValue;
}
FireIngestEventThread(PropertyChangeSupport publisher, IngestModuleEvent event, Object oldValue, Object newValue) {
this.publisher = publisher;
this.jobEvent = null;
this.moduleEvent = event;
this.oldValue = oldValue;
this.newValue = newValue;
}
@@ -548,7 +546,7 @@ public class IngestManager {
@Override
public void run() {
try {
publisher.firePropertyChange(event.toString(), oldValue, newValue);
publisher.firePropertyChange((jobEvent != null ? jobEvent.toString() : moduleEvent.toString()), oldValue, newValue);
} catch (Exception e) {
logger.log(Level.SEVERE, "Ingest manager listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(NbBundle.getMessage(IngestManager.class, "IngestManager.moduleErr"),

View File

@@ -28,9 +28,11 @@ import java.io.Serializable;
public interface IngestModuleIngestJobSettings extends Serializable {
/**
* Returns the version number of the settings object.
* Returns the version number of the settings object. The version number
* should be a private final static long per the documentation of the
* Serializable interface.
*
* @return A version number string.
* @return A serialization version number.
*/
String getVersionNumber();
long getVersionNumber();
}

View File

@@ -24,11 +24,12 @@ package org.sleuthkit.autopsy.ingest;
*/
public final class NoIngestModuleIngestJobSettings implements IngestModuleIngestJobSettings {
private static final long serialVersionUID = 1L;
private final String setting = "None"; //NON-NLS
@Override
public String getVersionNumber() {
return "1.0"; //NON-NLS
public long getVersionNumber() {
return serialVersionUID;
}
/**

View File

@@ -25,6 +25,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
*/
final class FileExtMismatchDetectorModuleSettings implements IngestModuleIngestJobSettings {
private static final long serialVersionUID = 1L;
private boolean skipFilesWithNoExtension = true;
private boolean skipFilesWithTextPlainMimeType = false;
@@ -37,8 +38,8 @@ final class FileExtMismatchDetectorModuleSettings implements IngestModuleIngestJ
}
@Override
public String getVersionNumber() {
return "1.0"; //NON-NLS
public long getVersionNumber() {
return serialVersionUID;
}
void setSkipFilesWithNoExtension(boolean enabled) {

View File

@@ -25,6 +25,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
*/
public class FileTypeIdModuleSettings implements IngestModuleIngestJobSettings {
private static final long serialVersionUID = 1L;
private volatile boolean skipKnownFiles = true;
FileTypeIdModuleSettings() {
@@ -35,8 +36,8 @@ public class FileTypeIdModuleSettings implements IngestModuleIngestJobSettings {
}
@Override
public String getVersionNumber() {
return "1.0"; //NON-NLS
public long getVersionNumber() {
return serialVersionUID;
}
void setSkipKnownFiles(boolean enabled) {

View File

@@ -28,6 +28,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
*/
final class HashLookupModuleSettings implements IngestModuleIngestJobSettings {
private static final long serialVersionUID = 1L;
private final HashSet<String> namesOfEnabledKnownHashSets = new HashSet<>();
private final HashSet<String> namesOfEnabledKnownBadHashSets = new HashSet<>();
private boolean shouldCalculateHashes = true;
@@ -39,8 +40,8 @@ final class HashLookupModuleSettings implements IngestModuleIngestJobSettings {
}
@Override
public String getVersionNumber() {
return "1.0"; //NON-NLS
public long getVersionNumber() {
return serialVersionUID;
}
boolean shouldCalculateHashes() {

View File

@@ -231,9 +231,9 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
}
private boolean isIngestJobEvent(PropertyChangeEvent evt) {
return evt.getPropertyName().equals(IngestManager.IngestEvent.INGEST_JOB_STARTED.toString())
|| evt.getPropertyName().equals(IngestManager.IngestEvent.INGEST_JOB_COMPLETED.toString())
|| evt.getPropertyName().equals(IngestManager.IngestEvent.INGEST_JOB_CANCELLED.toString());
return evt.getPropertyName().equals(IngestManager.IngestJobEvent.STARTED.toString())
|| evt.getPropertyName().equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| evt.getPropertyName().equals(IngestManager.IngestJobEvent.CANCELLED.toString());
}
@Override

View File

@@ -80,7 +80,7 @@ class AbstractFileTikaTextExtract implements AbstractFileExtract {
for (MediaType mt : mediaTypes) {
TIKA_SUPPORTED_TYPES.add(mt.getType() + "/" + mt.getSubtype());
}
logger.log(Level.INFO, "Tika supported media types: {0}", TIKA_SUPPORTED_TYPES); //NON-NLS
//logger.log(Level.INFO, "Tika supported media types: {0}", TIKA_SUPPORTED_TYPES); //NON-NLS
}
@Override

View File

@@ -43,7 +43,7 @@ import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableColumn;
import org.sleuthkit.autopsy.corecomponents.OptionsPanel;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestEvent;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestJobEvent;
/**
* KeywordSearchEditListPanel widget to manage keywords in lists
@@ -130,9 +130,9 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
@Override
public void propertyChange(PropertyChangeEvent evt) {
String changed = evt.getPropertyName();
if (changed.equals(IngestEvent.INGEST_JOB_STARTED.toString())
|| changed.equals(IngestEvent.INGEST_JOB_COMPLETED.toString())
|| changed.equals(IngestEvent.INGEST_JOB_CANCELLED.toString())) {
if (changed.equals(IngestJobEvent.STARTED.toString())
|| changed.equals(IngestJobEvent.COMPLETED.toString())
|| changed.equals(IngestJobEvent.CANCELLED.toString())) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {

View File

@@ -28,6 +28,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
*/
final class KeywordSearchJobSettings implements IngestModuleIngestJobSettings {
private static final long serialVersionUID = 1L;
private final HashSet<String> namesOfEnabledKeywordLists = new HashSet<>();
KeywordSearchJobSettings(List<String> namesOfEnabledKeywordLists) {
@@ -35,8 +36,8 @@ final class KeywordSearchJobSettings implements IngestModuleIngestJobSettings {
}
@Override
public String getVersionNumber() {
return "1.0"; //NON-NLS
public long getVersionNumber() {
return serialVersionUID;
}
boolean isKeywordListEnabled(String keywordListName) {

View File

@@ -42,7 +42,7 @@ import org.openide.util.NbBundle;
import org.openide.util.actions.SystemAction;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestEvent;
import org.sleuthkit.autopsy.ingest.IngestManager.IngestJobEvent;
/**
* Viewer panel widget for keyword lists that is used in the ingest config and options area.
@@ -122,9 +122,9 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
@Override
public void propertyChange(PropertyChangeEvent evt) {
String changed = evt.getPropertyName();
if (changed.equals(IngestEvent.INGEST_JOB_STARTED.toString())
|| changed.equals(IngestEvent.INGEST_JOB_COMPLETED.toString())
|| changed.equals(IngestEvent.INGEST_JOB_CANCELLED.toString())) {
if (changed.equals(IngestJobEvent.STARTED.toString())
|| changed.equals(IngestJobEvent.COMPLETED.toString())
|| changed.equals(IngestJobEvent.CANCELLED.toString())) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {