mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
702c0f08de
@ -67,7 +67,7 @@ public class AddBlackboardArtifactTagAction extends AddTagAction {
|
|||||||
Case.getCurrentCase().getServices().getTagsManager().addBlackboardArtifactTag(artifact, tagName, comment);
|
Case.getCurrentCase().getServices().getTagsManager().addBlackboardArtifactTag(artifact, tagName, comment);
|
||||||
}
|
}
|
||||||
catch (TskCoreException ex) {
|
catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex);
|
Logger.getLogger(AddBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS
|
||||||
JOptionPane.showMessageDialog(null,
|
JOptionPane.showMessageDialog(null,
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"AddBlackboardArtifactTagAction.unableToTag.msg",
|
"AddBlackboardArtifactTagAction.unableToTag.msg",
|
||||||
|
@ -113,7 +113,7 @@ public class AddContentTagAction extends AddTagAction {
|
|||||||
Case.getCurrentCase().getServices().getTagsManager().addContentTag(file, tagName, comment);
|
Case.getCurrentCase().getServices().getTagsManager().addContentTag(file, tagName, comment);
|
||||||
}
|
}
|
||||||
catch (TskCoreException ex) {
|
catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex);
|
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS
|
||||||
JOptionPane.showMessageDialog(null,
|
JOptionPane.showMessageDialog(null,
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"AddContentTagAction.unableToTag.msg2",
|
"AddContentTagAction.unableToTag.msg2",
|
||||||
|
@ -83,7 +83,7 @@ abstract class AddTagAction extends TagAction implements Presenter.Popup {
|
|||||||
tagNames = tagsManager.getAllTagNames();
|
tagNames = tagsManager.getAllTagNames();
|
||||||
}
|
}
|
||||||
catch (TskCoreException ex) {
|
catch (TskCoreException ex) {
|
||||||
Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
|
Logger.getLogger(TagsManager.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a "Quick Tag" sub-menu.
|
// Create a "Quick Tag" sub-menu.
|
||||||
|
@ -61,7 +61,7 @@ public class DeleteBlackboardArtifactTagAction extends TagAction {
|
|||||||
Case.getCurrentCase().getServices().getTagsManager().deleteBlackboardArtifactTag(tag);
|
Case.getCurrentCase().getServices().getTagsManager().deleteBlackboardArtifactTag(tag);
|
||||||
}
|
}
|
||||||
catch (TskCoreException ex) {
|
catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex);
|
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS
|
||||||
JOptionPane.showMessageDialog(null,
|
JOptionPane.showMessageDialog(null,
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"DeleteBlackboardArtifactTagAction.unableToDelTag.msg",
|
"DeleteBlackboardArtifactTagAction.unableToDelTag.msg",
|
||||||
|
@ -61,7 +61,7 @@ public class DeleteContentTagAction extends TagAction {
|
|||||||
Case.getCurrentCase().getServices().getTagsManager().deleteContentTag(tag);
|
Case.getCurrentCase().getServices().getTagsManager().deleteContentTag(tag);
|
||||||
}
|
}
|
||||||
catch (TskCoreException ex) {
|
catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex);
|
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS
|
||||||
JOptionPane.showMessageDialog(null,
|
JOptionPane.showMessageDialog(null,
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"DeleteContentTagAction.unableToDelTag.msg",
|
"DeleteContentTagAction.unableToDelTag.msg",
|
||||||
|
@ -94,7 +94,7 @@ public class GetTagNameAndCommentDialog extends JDialog {
|
|||||||
currentTagNames = tagsManager.getAllTagNames();
|
currentTagNames = tagsManager.getAllTagNames();
|
||||||
}
|
}
|
||||||
catch (TskCoreException ex) {
|
catch (TskCoreException ex) {
|
||||||
Logger.getLogger(GetTagNameAndCommentDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
|
Logger.getLogger(GetTagNameAndCommentDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
if (null != currentTagNames && currentTagNames.isEmpty()) {
|
if (null != currentTagNames && currentTagNames.isEmpty()) {
|
||||||
tagCombo.addItem(NO_TAG_NAMES_MESSAGE);
|
tagCombo.addItem(NO_TAG_NAMES_MESSAGE);
|
||||||
|
@ -43,7 +43,7 @@ import org.sleuthkit.datamodel.TagName;
|
|||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
|
||||||
public class GetTagNameDialog extends JDialog {
|
public class GetTagNameDialog extends JDialog {
|
||||||
private static final String TAG_ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png";
|
private static final String TAG_ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png"; //NON-NLS
|
||||||
private final HashMap<String, TagName> tagNames = new HashMap<>();
|
private final HashMap<String, TagName> tagNames = new HashMap<>();
|
||||||
private TagName tagName = null;
|
private TagName tagName = null;
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ public class GetTagNameDialog extends JDialog {
|
|||||||
currentTagNames = tagsManager.getAllTagNames();
|
currentTagNames = tagsManager.getAllTagNames();
|
||||||
}
|
}
|
||||||
catch (TskCoreException ex) {
|
catch (TskCoreException ex) {
|
||||||
Logger.getLogger(GetTagNameDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
|
Logger.getLogger(GetTagNameDialog.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); //NON-NLS
|
||||||
}
|
}
|
||||||
if (null != currentTagNames) {
|
if (null != currentTagNames) {
|
||||||
for (TagName name : currentTagNames) {
|
for (TagName name : currentTagNames) {
|
||||||
@ -299,7 +299,7 @@ public class GetTagNameDialog extends JDialog {
|
|||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
catch (TskCoreException ex) {
|
catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex);
|
Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex); //NON-NLS
|
||||||
JOptionPane.showMessageDialog(null,
|
JOptionPane.showMessageDialog(null,
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"GetTagNameDialog.unableToAddTagNameToCase.msg",
|
"GetTagNameDialog.unableToAddTagNameToCase.msg",
|
||||||
@ -309,7 +309,7 @@ public class GetTagNameDialog extends JDialog {
|
|||||||
tagName = null;
|
tagName = null;
|
||||||
}
|
}
|
||||||
catch (TagsManager.TagNameAlreadyExistsException ex) {
|
catch (TagsManager.TagNameAlreadyExistsException ex) {
|
||||||
Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex);
|
Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex); //NON-NLS
|
||||||
JOptionPane.showMessageDialog(null,
|
JOptionPane.showMessageDialog(null,
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
"GetTagNameDialog.tagNameAlreadyDef.msg",
|
"GetTagNameDialog.tagNameAlreadyDef.msg",
|
||||||
|
@ -71,7 +71,7 @@ class FileExtMismatchXML {
|
|||||||
* Singleton provides default configuration from user's directory; user CAN
|
* Singleton provides default configuration from user's directory; user CAN
|
||||||
* modify this file.
|
* modify this file.
|
||||||
*/
|
*/
|
||||||
public static FileExtMismatchXML getDefault() {
|
public static synchronized FileExtMismatchXML getDefault() {
|
||||||
if (defaultInstance == null) {
|
if (defaultInstance == null) {
|
||||||
final String FILTER_CONFIG_FILE = PlatformUtil.getUserConfigDirectory() + File.separator + DEFAULT_CONFIG_FILE_NAME;
|
final String FILTER_CONFIG_FILE = PlatformUtil.getUserConfigDirectory() + File.separator + DEFAULT_CONFIG_FILE_NAME;
|
||||||
defaultInstance = new FileExtMismatchXML(FILTER_CONFIG_FILE);
|
defaultInstance = new FileExtMismatchXML(FILTER_CONFIG_FILE);
|
||||||
|
@ -29,6 +29,9 @@ import org.sleuthkit.datamodel.AbstractFile;
|
|||||||
*/
|
*/
|
||||||
interface FileTypeDetectionInterface {
|
interface FileTypeDetectionInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instances of this data structure are not shared between threads
|
||||||
|
*/
|
||||||
public class FileIdInfo {
|
public class FileIdInfo {
|
||||||
|
|
||||||
public String type;
|
public String type;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.modules.filetypeid;
|
package org.sleuthkit.autopsy.modules.filetypeid;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.HashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -47,8 +47,8 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI
|
|||||||
private static final long MIN_FILE_SIZE = 512;
|
private static final long MIN_FILE_SIZE = 512;
|
||||||
private final FileTypeIdModuleSettings settings;
|
private final FileTypeIdModuleSettings settings;
|
||||||
private long jobId;
|
private long jobId;
|
||||||
private static AtomicLong matchTime = new AtomicLong(0);
|
|
||||||
private static AtomicLong numFiles = new AtomicLong(0);
|
private static final HashMap<Long, IngestJobTotals> totalsForIngestJobs = new HashMap<>();
|
||||||
private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter();
|
private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter();
|
||||||
|
|
||||||
// The detector. Swap out with a different implementation of FileTypeDetectionInterface as needed.
|
// The detector. Swap out with a different implementation of FileTypeDetectionInterface as needed.
|
||||||
@ -56,6 +56,27 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI
|
|||||||
// actually have a list of detectors which are called in order until a match is found.
|
// actually have a list of detectors which are called in order until a match is found.
|
||||||
private FileTypeDetectionInterface detector = new TikaFileTypeDetector();
|
private FileTypeDetectionInterface detector = new TikaFileTypeDetector();
|
||||||
|
|
||||||
|
private static class IngestJobTotals {
|
||||||
|
long matchTime = 0;
|
||||||
|
long numFiles = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static synchronized void initTotals(long ingestJobId) {
|
||||||
|
totalsForIngestJobs.put(ingestJobId, new IngestJobTotals());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the match time total and increment num of files for this job
|
||||||
|
* @param ingestJobId
|
||||||
|
* @param matchTimeInc amount of time to add
|
||||||
|
*/
|
||||||
|
private static synchronized void addToTotals(long ingestJobId, long matchTimeInc) {
|
||||||
|
IngestJobTotals ingestJobTotals = totalsForIngestJobs.get(ingestJobId);
|
||||||
|
ingestJobTotals.matchTime += matchTimeInc;
|
||||||
|
ingestJobTotals.numFiles++;
|
||||||
|
totalsForIngestJobs.put(ingestJobId, ingestJobTotals);
|
||||||
|
}
|
||||||
|
|
||||||
FileTypeIdIngestModule(FileTypeIdModuleSettings settings) {
|
FileTypeIdIngestModule(FileTypeIdModuleSettings settings) {
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
}
|
}
|
||||||
@ -63,7 +84,9 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI
|
|||||||
@Override
|
@Override
|
||||||
public void startUp(IngestJobContext context) throws IngestModuleException {
|
public void startUp(IngestJobContext context) throws IngestModuleException {
|
||||||
jobId = context.getJobId();
|
jobId = context.getJobId();
|
||||||
refCounter.incrementAndGet(jobId);
|
if (refCounter.incrementAndGet(jobId) == 1) {
|
||||||
|
initTotals(jobId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -86,8 +109,7 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI
|
|||||||
try {
|
try {
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
FileTypeDetectionInterface.FileIdInfo fileId = detector.attemptMatch(abstractFile);
|
FileTypeDetectionInterface.FileIdInfo fileId = detector.attemptMatch(abstractFile);
|
||||||
matchTime.getAndAdd(System.currentTimeMillis() - startTime);
|
addToTotals(jobId, (System.currentTimeMillis() - startTime)); //add match time
|
||||||
numFiles.getAndIncrement();
|
|
||||||
|
|
||||||
if (!fileId.type.isEmpty()) {
|
if (!fileId.type.isEmpty()) {
|
||||||
// add artifact
|
// add artifact
|
||||||
@ -111,15 +133,17 @@ public class FileTypeIdIngestModule extends IngestModuleAdapter implements FileI
|
|||||||
public void shutDown(boolean ingestJobCancelled) {
|
public void shutDown(boolean ingestJobCancelled) {
|
||||||
// We only need to post the summary msg from the last module per job
|
// We only need to post the summary msg from the last module per job
|
||||||
if (refCounter.decrementAndGet(jobId) == 0) {
|
if (refCounter.decrementAndGet(jobId) == 0) {
|
||||||
|
IngestJobTotals jobTotals = totalsForIngestJobs.remove(jobId);
|
||||||
|
|
||||||
StringBuilder detailsSb = new StringBuilder();
|
StringBuilder detailsSb = new StringBuilder();
|
||||||
detailsSb.append("<table border='0' cellpadding='4' width='280'>");
|
detailsSb.append("<table border='0' cellpadding='4' width='280'>");
|
||||||
detailsSb.append("<tr><td>").append(FileTypeIdModuleFactory.getModuleName()).append("</td></tr>");
|
detailsSb.append("<tr><td>").append(FileTypeIdModuleFactory.getModuleName()).append("</td></tr>");
|
||||||
detailsSb.append("<tr><td>")
|
detailsSb.append("<tr><td>")
|
||||||
.append(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.totalProcTime"))
|
.append(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.totalProcTime"))
|
||||||
.append("</td><td>").append(matchTime.get()).append("</td></tr>\n");
|
.append("</td><td>").append(jobTotals.matchTime).append("</td></tr>\n");
|
||||||
detailsSb.append("<tr><td>")
|
detailsSb.append("<tr><td>")
|
||||||
.append(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.totalFiles"))
|
.append(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.complete.totalFiles"))
|
||||||
.append("</td><td>").append(numFiles.get()).append("</td></tr>\n");
|
.append("</td><td>").append(jobTotals.numFiles).append("</td></tr>\n");
|
||||||
detailsSb.append("</table>");
|
detailsSb.append("</table>");
|
||||||
IngestServices.getInstance().postMessage(IngestMessage.createMessage(IngestMessage.MessageType.INFO, FileTypeIdModuleFactory.getModuleName(),
|
IngestServices.getInstance().postMessage(IngestMessage.createMessage(IngestMessage.MessageType.INFO, FileTypeIdModuleFactory.getModuleName(),
|
||||||
NbBundle.getMessage(this.getClass(),
|
NbBundle.getMessage(this.getClass(),
|
||||||
|
@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
|||||||
*/
|
*/
|
||||||
public class FileTypeIdModuleSettings implements IngestModuleIngestJobSettings {
|
public class FileTypeIdModuleSettings implements IngestModuleIngestJobSettings {
|
||||||
|
|
||||||
private boolean skipKnownFiles = true;
|
private volatile boolean skipKnownFiles = true;
|
||||||
|
|
||||||
FileTypeIdModuleSettings() {
|
FileTypeIdModuleSettings() {
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ import org.sleuthkit.datamodel.AbstractFile;
|
|||||||
|
|
||||||
class TikaFileTypeDetector implements FileTypeDetectionInterface {
|
class TikaFileTypeDetector implements FileTypeDetectionInterface {
|
||||||
|
|
||||||
private static Tika tikaInst = new Tika();
|
private static Tika tikaInst = new Tika(); //calling detect() with this should be thread-safe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FileTypeDetectionInterface.FileIdInfo attemptMatch(AbstractFile abstractFile) {
|
public FileTypeDetectionInterface.FileIdInfo attemptMatch(AbstractFile abstractFile) {
|
||||||
|
@ -187,7 +187,7 @@ public final class SevenZipIngestModule extends IngestModuleAdapter implements F
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shutDown(boolean ingestJobCancelled) {
|
public void shutDown(boolean ingestJobCancelled) {
|
||||||
// We don't need the value, but for cleanliness and consistency, -- it
|
// We don't need the value, but for cleanliness and consistency
|
||||||
refCounter.decrementAndGet(jobId);
|
refCounter.decrementAndGet(jobId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.keywordsearch;
|
package org.sleuthkit.autopsy.keywordsearch;
|
||||||
|
|
||||||
import java.awt.Cursor;
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.awt.event.FocusEvent;
|
import java.awt.event.FocusEvent;
|
||||||
|
@ -45,7 +45,6 @@ import javax.swing.text.html.HTMLEditorKit.HTMLFactory;
|
|||||||
import javax.swing.text.html.StyleSheet;
|
import javax.swing.text.html.StyleSheet;
|
||||||
import org.netbeans.api.progress.ProgressHandle;
|
import org.netbeans.api.progress.ProgressHandle;
|
||||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||||
import org.openide.util.Exceptions;
|
|
||||||
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||||
import org.sleuthkit.autopsy.coreutils.TextUtil;
|
import org.sleuthkit.autopsy.coreutils.TextUtil;
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@ import org.openide.util.NbBundle;
|
|||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.apache.solr.client.solrj.SolrQuery;
|
import org.apache.solr.client.solrj.SolrQuery;
|
||||||
import org.apache.solr.client.solrj.SolrRequest.METHOD;
|
import org.apache.solr.client.solrj.SolrRequest.METHOD;
|
||||||
import org.apache.solr.client.solrj.SolrServerException;
|
|
||||||
import org.apache.solr.client.solrj.response.QueryResponse;
|
import org.apache.solr.client.solrj.response.QueryResponse;
|
||||||
import org.sleuthkit.autopsy.coreutils.Version;
|
import org.sleuthkit.autopsy.coreutils.Version;
|
||||||
import org.sleuthkit.autopsy.datamodel.HighlightLookup;
|
import org.sleuthkit.autopsy.datamodel.HighlightLookup;
|
||||||
|
@ -22,9 +22,7 @@ import java.beans.PropertyChangeEvent;
|
|||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.beans.PropertyChangeSupport;
|
import java.beans.PropertyChangeSupport;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.SocketException;
|
|
||||||
import java.util.logging.FileHandler;
|
import java.util.logging.FileHandler;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.logging.SimpleFormatter;
|
import java.util.logging.SimpleFormatter;
|
||||||
import org.openide.util.Exceptions;
|
import org.openide.util.Exceptions;
|
||||||
@ -44,7 +42,7 @@ public class KeywordSearch {
|
|||||||
private static Server server;
|
private static Server server;
|
||||||
//we want a custom java.util.logging.Logger here for a reason
|
//we want a custom java.util.logging.Logger here for a reason
|
||||||
//a separate logger from framework logs
|
//a separate logger from framework logs
|
||||||
static final Logger TIKA_LOGGER = Logger.getLogger("Tika");
|
private static final Logger TIKA_LOGGER = Logger.getLogger("Tika");
|
||||||
private static final Logger logger = Logger.getLogger(Case.class.getName());
|
private static final Logger logger = Logger.getLogger(Case.class.getName());
|
||||||
public enum QueryType {
|
public enum QueryType {
|
||||||
LITERAL, REGEX
|
LITERAL, REGEX
|
||||||
@ -100,7 +98,7 @@ public class KeywordSearch {
|
|||||||
changeSupport.removePropertyChangeListener(l);
|
changeSupport.removePropertyChangeListener(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fireNumIndexedFilesChange(Integer oldNum, Integer newNum) {
|
public static void fireNumIndexedFilesChange(Integer oldNum, Integer newNum) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
changeSupport.firePropertyChange(NUM_FILES_CHANGE_EVT, oldNum, newNum);
|
changeSupport.firePropertyChange(NUM_FILES_CHANGE_EVT, oldNum, newNum);
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
package org.sleuthkit.autopsy.keywordsearch;
|
package org.sleuthkit.autopsy.keywordsearch;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
@ -37,6 +39,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel;
|
|||||||
@ServiceProvider(service = IngestModuleFactory.class)
|
@ServiceProvider(service = IngestModuleFactory.class)
|
||||||
public class KeywordSearchModuleFactory extends IngestModuleFactoryAdapter {
|
public class KeywordSearchModuleFactory extends IngestModuleFactoryAdapter {
|
||||||
|
|
||||||
|
private static final HashSet<String> defaultDisabledKeywordListNames = new HashSet<>(Arrays.asList("Phone Numbers", "IP Addresses", "URLs"));
|
||||||
private KeywordSearchJobSettingsPanel jobSettingsPanel = null;
|
private KeywordSearchJobSettingsPanel jobSettingsPanel = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -64,8 +67,9 @@ public class KeywordSearchModuleFactory extends IngestModuleFactoryAdapter {
|
|||||||
List<String> enabledKeywordLists = new ArrayList<>();
|
List<String> enabledKeywordLists = new ArrayList<>();
|
||||||
List<KeywordList> keywordLists = listManager.getListsL();
|
List<KeywordList> keywordLists = listManager.getListsL();
|
||||||
for (KeywordList keywordList : keywordLists) {
|
for (KeywordList keywordList : keywordLists) {
|
||||||
// All available keyword search lists are enabled by default.
|
if (!defaultDisabledKeywordListNames.contains(keywordList.getName())) {
|
||||||
enabledKeywordLists.add(keywordList.getName());
|
enabledKeywordLists.add(keywordList.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new KeywordSearchJobSettings(enabledKeywordLists);
|
return new KeywordSearchJobSettings(enabledKeywordLists);
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProcessResult process(AbstractFile abstractFile) {
|
public ProcessResult process(AbstractFile abstractFile) {
|
||||||
ScalpelCarver.init(); // RJCTODO: Is this ScalpelCarver class thread-safe?
|
ScalpelCarver.init();
|
||||||
|
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
return ProcessResult.OK;
|
return ProcessResult.OK;
|
||||||
|
@ -39,7 +39,7 @@ public class ScalpelCarver {
|
|||||||
|
|
||||||
private static final String SCALPEL_JNI_LIB = "libscalpel_jni";
|
private static final String SCALPEL_JNI_LIB = "libscalpel_jni";
|
||||||
private static final String SCALPEL_OUTPUT_FILE_NAME = "audit.txt";
|
private static final String SCALPEL_OUTPUT_FILE_NAME = "audit.txt";
|
||||||
private static boolean initialized = false;
|
private static volatile boolean initialized = false;
|
||||||
private static final Logger logger = Logger.getLogger(ScalpelCarver.class.getName());
|
private static final Logger logger = Logger.getLogger(ScalpelCarver.class.getName());
|
||||||
|
|
||||||
private static native void carveNat(String carverInputId, ReadContentInputStream input, String configFilePath, String outputFolderPath) throws ScalpelException;
|
private static native void carveNat(String carverInputId, ReadContentInputStream input, String configFilePath, String outputFolderPath) throws ScalpelException;
|
||||||
@ -48,7 +48,7 @@ public class ScalpelCarver {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean init() {
|
public static synchronized boolean init() {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -252,11 +252,13 @@ public class RegressionTest extends TestCase {
|
|||||||
if (Boolean.parseBoolean(System.getProperty("ignore_unalloc"))) {
|
if (Boolean.parseBoolean(System.getProperty("ignore_unalloc"))) {
|
||||||
jbco0.doClick();
|
jbco0.doClick();
|
||||||
}
|
}
|
||||||
|
new Timeout("pausing", 10000).sleep(); // let things catch up
|
||||||
wo.btNext().clickMouse();
|
wo.btNext().clickMouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIngest() {
|
public void testIngest() {
|
||||||
logger.info("Ingest 3");
|
logger.info("Ingest 3");
|
||||||
|
new Timeout("pausing", 10000).sleep(); // wait for ingest to actually start
|
||||||
long startIngest = System.currentTimeMillis();
|
long startIngest = System.currentTimeMillis();
|
||||||
IngestManager man = IngestManager.getInstance();
|
IngestManager man = IngestManager.getInstance();
|
||||||
while (man.isIngestRunning()) {
|
while (man.isIngestRunning()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user