From 8b1528277d8bd575005d90932cd153799c4e1d8d Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Tue, 16 Feb 2016 12:43:56 -0500 Subject: [PATCH 1/8] Made check of known mandatory --- .../filetypeid/FileTypeIdIngestModule.java | 14 ++----- .../filetypeid/FileTypeIdModuleFactory.java | 38 +------------------ 2 files changed, 6 insertions(+), 46 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index b3c09dfb81..8433b489b1 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -29,6 +29,7 @@ import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.TskData.FileKnown; import org.sleuthkit.autopsy.ingest.IngestModule.ProcessResult; +import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter; /** @@ -38,7 +39,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter; public class FileTypeIdIngestModule implements FileIngestModule { private static final Logger logger = Logger.getLogger(FileTypeIdIngestModule.class.getName()); - private final FileTypeIdModuleSettings settings; + private final IngestModuleIngestJobSettings settings; private long jobId; private static final HashMap totalsForIngestJobs = new HashMap<>(); private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter(); @@ -69,7 +70,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { * * @param settings The ingest module settings. */ - FileTypeIdIngestModule(FileTypeIdModuleSettings settings) { + FileTypeIdIngestModule(IngestModuleIngestJobSettings settings) { this.settings = settings; } @@ -93,13 +94,6 @@ public class FileTypeIdIngestModule implements FileIngestModule { @Override public ProcessResult process(AbstractFile file) { - /** - * Skip known files if configured to do so. - */ - if (settings.skipKnownFiles() && (file.getKnown() == FileKnown.KNOWN)) { - return ProcessResult.OK; - } - /** * Attempt to detect the file type. Do it within an exception firewall, * so that any issues with reading file content or complaints from tika @@ -174,4 +168,4 @@ public class FileTypeIdIngestModule implements FileIngestModule { long numFiles = 0; } -} +} \ No newline at end of file diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java index 38823ca03d..07adc3c2a1 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java @@ -92,35 +92,6 @@ public class FileTypeIdModuleFactory extends IngestModuleFactoryAdapter { return globalSettingsPanel; } - /** - * @inheritDoc - */ - @Override - public IngestModuleIngestJobSettings getDefaultIngestJobSettings() { - return new FileTypeIdModuleSettings(); - } - - /** - * @inheritDoc - */ - @Override - public boolean hasIngestJobSettingsPanel() { - return true; - } - - /** - * @inheritDoc - */ - @Override - public IngestModuleIngestJobSettingsPanel getIngestJobSettingsPanel(IngestModuleIngestJobSettings settings) { - assert settings instanceof FileTypeIdModuleSettings; - if (!(settings instanceof FileTypeIdModuleSettings)) { - throw new IllegalArgumentException(NbBundle.getMessage(this.getClass(), - "FileTypeIdModuleFactory.getIngestJobSettingsPanel.exception.msg")); - } - return new FileTypeIdIngestJobSettingsPanel((FileTypeIdModuleSettings) settings); - } - /** * @inheritDoc */ @@ -134,11 +105,6 @@ public class FileTypeIdModuleFactory extends IngestModuleFactoryAdapter { */ @Override public FileIngestModule createFileIngestModule(IngestModuleIngestJobSettings settings) { - assert settings instanceof FileTypeIdModuleSettings; - if (!(settings instanceof FileTypeIdModuleSettings)) { - throw new IllegalArgumentException( - NbBundle.getMessage(this.getClass(), "FileTypeIdModuleFactory.createFileIngestModule.exception.msg")); - } - return new FileTypeIdIngestModule((FileTypeIdModuleSettings) settings); + return new FileTypeIdIngestModule(settings); } -} +} \ No newline at end of file From dc65fed3e92b7e8ebb46401a0f5c2eb8f06feb99 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Tue, 16 Feb 2016 13:20:34 -0500 Subject: [PATCH 2/8] Added exceptions to ingest module exceptions --- .../EmbeddedFileExtractorIngestModule.java | 4 ++-- .../embeddedfileextractor/SevenZipExtractor.java | 2 +- .../modules/exif/ExifParserFileIngestModule.java | 2 +- .../modules/filetypeid/FileTypeIdIngestModule.java | 2 +- .../photoreccarver/PhotoRecCarverFileIngestModule.java | 4 ++-- .../keywordsearch/KeywordSearchIngestModule.java | 10 +++++----- .../recentactivity/SearchEngineURLQueryAnalyzer.java | 8 ++++---- .../autopsy/scalpel/ScalpelCarverIngestModule.java | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java index 7e0d220f11..b7f6529786 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/EmbeddedFileExtractorIngestModule.java @@ -79,7 +79,7 @@ public final class EmbeddedFileExtractorIngestModule implements FileIngestModule } catch (SecurityException ex) { logger.log(Level.SEVERE, "Error initializing output dir: " + moduleDirAbsolute, ex); //NON-NLS services.postMessage(IngestMessage.createErrorMessage(EmbeddedFileExtractorModuleFactory.getModuleName(), "Error initializing", "Error initializing output dir: " + moduleDirAbsolute)); //NON-NLS - throw new IngestModuleException(ex.getMessage()); + throw new IngestModuleException(ex.getMessage(), ex); } } @@ -87,7 +87,7 @@ public final class EmbeddedFileExtractorIngestModule implements FileIngestModule try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - throw new IngestModuleException(ex.getMessage()); + throw new IngestModuleException(ex.getMessage(), ex); } // initialize the extraction modules. diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java index 44052df224..881e7c5fa4 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java +++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java @@ -133,7 +133,7 @@ class SevenZipExtractor { String details = NbBundle.getMessage(SevenZipExtractor.class, "EmbeddedFileExtractorIngestModule.ArchiveExtractor.init.errCantInitLib", e.getMessage()); services.postMessage(IngestMessage.createErrorMessage(EmbeddedFileExtractorModuleFactory.getModuleName(), msg, details)); - throw new IngestModuleException(e.getMessage()); + throw new IngestModuleException(e.getMessage(), e); } } this.context = context; diff --git a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java index de946ffd0f..b2ce0beca2 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java @@ -91,7 +91,7 @@ public final class ExifParserFileIngestModule implements FileIngestModule { try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "ExifParserFileIngestModule.startUp.fileTypeDetectorInitializationException.msg")); + throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "ExifParserFileIngestModule.startUp.fileTypeDetectorInitializationException.msg"), ex); } } diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index b3c09dfb81..956ddef89e 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -83,7 +83,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.startUp.fileTypeDetectorInitializationException.msg")); + throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "FileTypeIdIngestModule.startUp.fileTypeDetectorInitializationException.msg"), ex); } } diff --git a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java index f848838d02..16ae16e4bd 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/photoreccarver/PhotoRecCarverFileIngestModule.java @@ -152,7 +152,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule { // Initialize job totals initTotalsForIngestJob(jobId); } catch (SecurityException | IOException | UnsupportedOperationException ex) { - throw new IngestModule.IngestModuleException(NbBundle.getMessage(PhotoRecCarverFileIngestModule.class, "cannotCreateOutputDir.message", ex.getLocalizedMessage())); + throw new IngestModule.IngestModuleException(NbBundle.getMessage(PhotoRecCarverFileIngestModule.class, "cannotCreateOutputDir.message", ex.getLocalizedMessage()), ex); } } } @@ -396,7 +396,7 @@ final class PhotoRecCarverFileIngestModule implements FileIngestModule { } catch (FileAlreadyExistsException ex) { // No worries. } catch (IOException | SecurityException | UnsupportedOperationException ex) { - throw new IngestModule.IngestModuleException(NbBundle.getMessage(PhotoRecCarverFileIngestModule.class, "cannotCreateOutputDir.message", ex.getLocalizedMessage())); + throw new IngestModule.IngestModuleException(NbBundle.getMessage(PhotoRecCarverFileIngestModule.class, "cannotCreateOutputDir.message", ex.getLocalizedMessage()), ex); } return path; } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java index bb86774bbe..7d5ee1b5a4 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java @@ -142,7 +142,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule { try { fileTypeDetector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.startUp.fileTypeDetectorInitializationException.msg")); + throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.startUp.fileTypeDetectorInitializationException.msg"), ex); } ingester = Server.getIngester(); this.context = context; @@ -162,7 +162,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule { String details = NbBundle.getMessage(this.getClass(), "SolrConnectionCheck.Port"); logger.log(Level.SEVERE, "{0}: {1} {2}", new Object[]{msg, details, ex.toString()}); services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details)); - throw new IngestModuleException(msg); + throw new IngestModuleException(msg, ex); } try { kwsService.tryConnect(UserPreferences.getIndexingServerHost(), port); @@ -171,7 +171,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule { String details = ex.getMessage(); logger.log(Level.SEVERE, "{0}: {1} {2}", new Object[]{msg, details, ex.toString()}); services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details)); - throw new IngestModuleException(msg); + throw new IngestModuleException(msg, ex); } } else { // for single-user cases need to verify connection to local SOLR service @@ -189,7 +189,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule { String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg"); String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg); services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), msg, details)); - throw new IngestModuleException(msg); + throw new IngestModuleException(msg, ex); } try { // make an actual query to verify that server is responding @@ -198,7 +198,7 @@ public final class KeywordSearchIngestModule implements FileIngestModule { } catch (KeywordSearchModuleException | NoOpenCoreException ex) { throw new IngestModuleException( NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.exception.errConnToSolr.msg", - ex.getMessage())); + ex.getMessage()), ex); } // check if this job has any searchable keywords diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/SearchEngineURLQueryAnalyzer.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/SearchEngineURLQueryAnalyzer.java index 17736afd4b..def7610d11 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/SearchEngineURLQueryAnalyzer.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/SearchEngineURLQueryAnalyzer.java @@ -161,11 +161,11 @@ class SearchEngineURLQueryAnalyzer extends Extract { } } catch (IOException e) { - throw new IngestModuleException("Was not able to load SEUQAMappings.xml: " + e.getLocalizedMessage()); //NON-NLS + throw new IngestModuleException("Was not able to load SEUQAMappings.xml: " + e.getLocalizedMessage(), e); //NON-NLS } catch (ParserConfigurationException pce) { - throw new IngestModuleException("Unable to build XML parser: " + pce.getLocalizedMessage()); //NON-NLS + throw new IngestModuleException("Unable to build XML parser: " + pce.getLocalizedMessage(), pce); //NON-NLS } catch (SAXException sxe) { - throw new IngestModuleException("Unable to parse XML file: " + sxe.getLocalizedMessage()); //NON-NLS + throw new IngestModuleException("Unable to parse XML file: " + sxe.getLocalizedMessage(), sxe); //NON-NLS } NodeList nlist = xmlinput.getElementsByTagName("SearchEngine"); //NON-NLS @@ -394,7 +394,7 @@ class SearchEngineURLQueryAnalyzer extends Extract { String message = NbBundle .getMessage(this.getClass(), "SearchEngineURLQueryAnalyzer.init.exception.msg", XMLFILE); logger.log(Level.SEVERE, message, e); - throw new IngestModuleException(message); + throw new IngestModuleException(message, e); } loadConfigFile(); diff --git a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java index d6318a02de..2c7a140567 100644 --- a/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java +++ b/ScalpelCarver/src/org/sleuthkit/autopsy/scalpel/ScalpelCarverIngestModule.java @@ -106,7 +106,7 @@ class ScalpelCarverIngestModule implements FileIngestModule { } catch (IOException ex) { String message = NbBundle.getMessage(this.getClass(), "ScalpelCarverIngestModule.startUp.exception.msg4"); logger.log(Level.SEVERE, message, ex); - throw new IngestModuleException(message); + throw new IngestModuleException(message, ex); } initialized = true; From 0d9f9186acaf8843c46b91794b3883c4026a762b Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Wed, 17 Feb 2016 10:17:10 -0500 Subject: [PATCH 3/8] Made file type detector run on undetected files --- .../FileExtMismatchIngestModule.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java index e22e73ae26..2bb902d68f 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2014 Basis Technology Corp. + * Copyright 2011-2016 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,13 +18,11 @@ */ package org.sleuthkit.autopsy.modules.fileextmismatch; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.logging.Level; -import org.openide.util.Exceptions; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.services.Blackboard; @@ -40,7 +38,6 @@ import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE; -import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskData; import org.sleuthkit.datamodel.TskException; @@ -58,6 +55,7 @@ public class FileExtMismatchIngestModule implements FileIngestModule { private static final HashMap totalsForIngestJobs = new HashMap<>(); private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter(); private static Blackboard blackboard; + private FileTypeDetector detector; private static class IngestJobTotals { @@ -94,6 +92,11 @@ public class FileExtMismatchIngestModule implements FileIngestModule { FileExtMismatchXML xmlLoader = FileExtMismatchXML.getDefault(); SigTypeToExtMap = xmlLoader.load(); + try { + this.detector = new FileTypeDetector(); + } catch (FileTypeDetector.FileTypeDetectorInitException ex) { + throw new IngestModuleException("Could not create file extension mismatch module.", ex); + } } @@ -157,7 +160,7 @@ public class FileExtMismatchIngestModule implements FileIngestModule { if (settings.skipFilesWithNoExtension() && currActualExt.isEmpty()) { return false; } - String currActualSigType = abstractFile.getMIMEType(); + String currActualSigType = detector.getFileType(abstractFile); if (currActualSigType == null) { return false; } From b9d7be8fead842c69644d43ad56286e018f7aee5 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Fri, 19 Feb 2016 11:22:49 -0500 Subject: [PATCH 4/8] Updated error message --- .../modules/fileextmismatch/FileExtMismatchIngestModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java index 2bb902d68f..2825a16eb9 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java @@ -95,7 +95,7 @@ public class FileExtMismatchIngestModule implements FileIngestModule { try { this.detector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - throw new IngestModuleException("Could not create file extension mismatch module.", ex); + throw new IngestModuleException("Could not create file detector.", ex); } } From ece2e70ad5276fc4c9615492630e07c9e4433f75 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Fri, 19 Feb 2016 11:23:47 -0500 Subject: [PATCH 5/8] Updated error message --- .../modules/fileextmismatch/FileExtMismatchIngestModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java index 2825a16eb9..c579c69014 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java @@ -95,7 +95,7 @@ public class FileExtMismatchIngestModule implements FileIngestModule { try { this.detector = new FileTypeDetector(); } catch (FileTypeDetector.FileTypeDetectorInitException ex) { - throw new IngestModuleException("Could not create file detector.", ex); + throw new IngestModuleException("Could not create file type detector.", ex); } } From 809bcde6e0763878b793bfaaaac33fd704004b7f Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Fri, 19 Feb 2016 11:31:20 -0500 Subject: [PATCH 6/8] Removed unnecessary settings --- .../modules/filetypeid/FileTypeIdIngestModule.java | 10 +++------- .../modules/filetypeid/FileTypeIdModuleFactory.java | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index 8433b489b1..0381c58a9e 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -39,7 +39,6 @@ import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter; public class FileTypeIdIngestModule implements FileIngestModule { private static final Logger logger = Logger.getLogger(FileTypeIdIngestModule.class.getName()); - private final IngestModuleIngestJobSettings settings; private long jobId; private static final HashMap totalsForIngestJobs = new HashMap<>(); private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter(); @@ -67,11 +66,8 @@ public class FileTypeIdIngestModule implements FileIngestModule { /** * Creates an ingest module that detects the type of a file based on * signature (magic) values. Posts results to the blackboard. - * - * @param settings The ingest module settings. */ - FileTypeIdIngestModule(IngestModuleIngestJobSettings settings) { - this.settings = settings; + FileTypeIdIngestModule() { } /** @@ -147,7 +143,7 @@ public class FileTypeIdIngestModule implements FileIngestModule { * Update the match time total and increment number of files processed for * this ingest job. * - * @param jobId The ingest job identifier. + * @param jobId The ingest job identifier. * @param matchTimeInc Amount of time to add. */ private static synchronized void addToTotals(long jobId, long matchTimeInc) { @@ -168,4 +164,4 @@ public class FileTypeIdIngestModule implements FileIngestModule { long numFiles = 0; } -} \ No newline at end of file +} diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java index 07adc3c2a1..cd3425994d 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java @@ -105,6 +105,6 @@ public class FileTypeIdModuleFactory extends IngestModuleFactoryAdapter { */ @Override public FileIngestModule createFileIngestModule(IngestModuleIngestJobSettings settings) { - return new FileTypeIdIngestModule(settings); + return new FileTypeIdIngestModule(); } } \ No newline at end of file From 3a9b6444ff6113951b648549e3c8866efffb88f4 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Fri, 19 Feb 2016 11:38:17 -0500 Subject: [PATCH 7/8] Updated imports --- .../autopsy/modules/filetypeid/FileTypeIdIngestModule.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java index 0381c58a9e..c9194f5499 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestModule.java @@ -27,9 +27,7 @@ import org.sleuthkit.autopsy.ingest.IngestJobContext; import org.sleuthkit.autopsy.ingest.IngestMessage; import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.datamodel.AbstractFile; -import org.sleuthkit.datamodel.TskData.FileKnown; import org.sleuthkit.autopsy.ingest.IngestModule.ProcessResult; -import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter; /** From b1b2f20c978f2f575f67ff2817745fc0c051677c Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Fri, 19 Feb 2016 11:43:08 -0500 Subject: [PATCH 8/8] Deleted unnecessary classes --- .../FileTypeIdIngestJobSettingsPanel.form | 52 ---------- .../FileTypeIdIngestJobSettingsPanel.java | 99 ------------------- .../filetypeid/FileTypeIdModuleFactory.java | 1 - .../filetypeid/FileTypeIdModuleSettings.java | 56 ----------- 4 files changed, 208 deletions(-) delete mode 100644 Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestJobSettingsPanel.form delete mode 100644 Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestJobSettingsPanel.java delete mode 100755 Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleSettings.java diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestJobSettingsPanel.form b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestJobSettingsPanel.form deleted file mode 100644 index 183425da42..0000000000 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestJobSettingsPanel.form +++ /dev/null @@ -1,52 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestJobSettingsPanel.java deleted file mode 100644 index 658e0c00b9..0000000000 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdIngestJobSettingsPanel.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2013 - 2014 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.modules.filetypeid; - -import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettingsPanel; - -/** - * UI component used to set ingest job options for file type identifier ingest - * modules. - */ -class FileTypeIdIngestJobSettingsPanel extends IngestModuleIngestJobSettingsPanel { - - private final FileTypeIdModuleSettings settings; - - FileTypeIdIngestJobSettingsPanel(FileTypeIdModuleSettings settings) { - this.settings = settings; - initComponents(); - customizeComponents(); - } - - /** - * @inheritDoc - */ - @Override - public IngestModuleIngestJobSettings getSettings() { - return settings; - } - - /** - * Does child component initialization in addition to that done by the - * Matisse generated code. - */ - private void customizeComponents() { - skipKnownCheckBox.setSelected(settings.skipKnownFiles()); - } - - /** - * 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() { - - skipKnownCheckBox = new javax.swing.JCheckBox(); - - skipKnownCheckBox.setSelected(true); - skipKnownCheckBox.setText(org.openide.util.NbBundle.getMessage(FileTypeIdIngestJobSettingsPanel.class, "FileTypeIdIngestJobSettingsPanel.skipKnownCheckBox.text")); // NOI18N - skipKnownCheckBox.setToolTipText(org.openide.util.NbBundle.getMessage(FileTypeIdIngestJobSettingsPanel.class, "FileTypeIdIngestJobSettingsPanel.skipKnownCheckBox.toolTipText")); // NOI18N - skipKnownCheckBox.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - skipKnownCheckBoxActionPerformed(evt); - } - }); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(10, 10, 10) - .addComponent(skipKnownCheckBox) - .addContainerGap(46, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(11, 11, 11) - .addComponent(skipKnownCheckBox) - .addContainerGap(86, Short.MAX_VALUE)) - ); - }// //GEN-END:initComponents - - private void skipKnownCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_skipKnownCheckBoxActionPerformed - settings.setSkipKnownFiles(skipKnownCheckBox.isSelected()); - }//GEN-LAST:event_skipKnownCheckBoxActionPerformed - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JCheckBox skipKnownCheckBox; - // End of variables declaration//GEN-END:variables -} diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java index cd3425994d..78ccd986a0 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleFactory.java @@ -26,7 +26,6 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactory; import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter; import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel; import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; -import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettingsPanel; /** * A factory that creates file ingest modules that determine the types of files. diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleSettings.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleSettings.java deleted file mode 100755 index 8d8e4150d5..0000000000 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdModuleSettings.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Autopsy Forensic Browser - * - * Copyright 2014 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.modules.filetypeid; - -import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings; - -/** - * Ingest job options for the file type identifier ingest module instances. - */ -// TODO: This class does not need to be public. -public class FileTypeIdModuleSettings implements IngestModuleIngestJobSettings { - - private static final long serialVersionUID = 1L; - private boolean skipKnownFiles = true; - private boolean skipSmallFiles = false; // No longer used. - - FileTypeIdModuleSettings() { - } - - FileTypeIdModuleSettings(boolean skipKnownFiles) { - this.skipKnownFiles = skipKnownFiles; - } - - /** - * @inheritDoc - */ - @Override - public long getVersionNumber() { - return serialVersionUID; - } - - void setSkipKnownFiles(boolean enabled) { - skipKnownFiles = enabled; - } - - boolean skipKnownFiles() { - return skipKnownFiles; - } - -}