Skip to content

Commit

Permalink
Resource bundle updated. Unalloc Unused blocks marked as octet-stream
Browse files Browse the repository at this point in the history
  • Loading branch information
sidheshenator committed May 22, 2015
1 parent 22b50d5 commit 34c5a1d
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ OpenIDE-Module-Name=ExifParser
OpenIDE-Module-Short-Description=Exif metadata ingest module
ExifParserFileIngestModule.moduleName.text=Exif Parser
ExifParserFileIngestModule.getDesc.text=Ingests JPEG files and retrieves their EXIF metadata.
ExifParserFileIngestModule.startUp.fileTypeDetectorInitializationException.msg=Error initializing the File Type Detector.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.Date;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestJobContext;
Expand Down Expand Up @@ -75,8 +76,8 @@ public void startUp(IngestJobContext context) throws IngestModuleException {
try {
fileTypeDetector = new FileTypeDetector();
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
logger.log(Level.SEVERE, "Error initializing FileTypeDetector", ex); // NON-NLS
throw new IngestModuleException("Error initializing FileTypeDetector"); // NON-NLS
logger.log(Level.SEVERE, NbBundle.getMessage(this.getClass(), "ExifParserFileIngestModule.startUp.fileTypeDetectorInitializationException.msg"), ex);
throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "ExifParserFileIngestModule.startUp.fileTypeDetectorInitializationException.msg"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskData;

/**
* Detects the type of a file by an inspection of its contents.
Expand Down Expand Up @@ -143,12 +144,21 @@ public String getFileType(AbstractFile abstractFile) {
* succeeds.
*
* @param file The file to test.
* @param moduleName The name of the module posting to the blackboard.
* @return The MIME type name id detection was successful, null otherwise.
* @throws TskCoreException if there is an error posting to the blackboard.
*/
public String detectAndPostToBlackboard(AbstractFile file) throws TskCoreException {
String mimeType = detect(file);

String mimeType;
// Consistently mark unallocated and unused space as file type application/octet-stream
if ((file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)
|| (file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)
|| (file.isFile() == false)) {
mimeType = MimeTypes.OCTET_STREAM;
} else {
mimeType = detect(file);
}

if (null != mimeType) {
/**
* Add the file type attribute to the general info artifact. Note
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ public void startUp(IngestJobContext context) throws IngestModuleException {
@Override
public ProcessResult process(AbstractFile file) {

/**
* Skip unallocated space and unused blocks files.
*/
if ((file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)
|| (file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS)
|| (file.isFile() == false)) {
return ProcessResult.OK;
}

/**
* Skip known files if configured to do so.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ SevenZipIngestModule.unpack.encrFileDetected.msg=Encrypted files in archive dete
SevenZipIngestModule.unpack.encrFileDetected.details=Some files in archive\: {0} are encrypted. {1} extractor was unable to extract all files from this archive.
SevenZipIngestModule.UnpackStream.write.exception.msg=Error writing unpacked file to\: {0}
SevenZipIngestModule.UnpackedTree.exception.msg=Error adding a derived file to db\:{0}
SevenZipIngestModule.startUp.fileTypeDetectorInitializationException.msg=Error initializing the File Type Detector.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public void startUp(IngestJobContext context) throws IngestModuleException {
try {
fileTypeDetector = new FileTypeDetector();
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
logger.log(Level.SEVERE, "Error initializing FileTypeDetector", ex); // NON-NLS
throw new IngestModuleException("Error initializing FileTypeDetector"); // NON-NLS
logger.log(Level.SEVERE, NbBundle.getMessage(this.getClass(), "SevenZipIngestModule.startUp.fileTypeDetectorInitializationException.msg"), ex);
throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "SevenZipIngestModule.startUp.fileTypeDetectorInitializationException.msg"));
}

final Case currentCase = Case.getCurrentCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,4 @@ KeywordSearchModuleFactory.createFileIngestModule.exception.msg=Expected setting
SearchRunner.Searcher.done.err.msg=Error performing keyword search
KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.toolTipText=Fastest overall, but no results until the end
KeywordSearchGlobalSearchSettingsPanel.timeRadioButton5.text=No periodic searches
KeywordSearchIngestModule.startUp.fileTypeDetectorInitializationException.msg=Error initializing the File Type Detector.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public void startUp(IngestJobContext context) throws IngestModuleException {
try {
fileTypeDetector = new FileTypeDetector();
} catch (FileTypeDetector.FileTypeDetectorInitException ex) {
logger.log(Level.SEVERE, "Error initializing FileTypeDetector", ex); // NON-NLS
throw new IngestModuleException("Error initializing FileTypeDetector"); // NON-NLS
logger.log(Level.SEVERE, NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.startUp.fileTypeDetectorInitializationException.msg"), ex);
throw new IngestModuleException(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.startUp.fileTypeDetectorInitializationException.msg"));
}
ingester = Server.getIngester();
this.context = context;
Expand Down

0 comments on commit 34c5a1d

Please sign in to comment.