mirror of
https://github.com/elisspace/autopsy.git
synced 2026-08-30 16:11:57 +00:00
Updated docs link and uncommented 4.0-only code
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
|
||||
# Simple file-level ingest module for Autopsy.
|
||||
# Search for TODO for the things that you need to change
|
||||
# See http://sleuthkit.org/autopsy/docs/api-docs/3.1/index.html for documentation
|
||||
# See http://sleuthkit.org/autopsy/docs/api-docs/4.1/index.html for documentation
|
||||
|
||||
import jarray
|
||||
import inspect
|
||||
@@ -53,8 +53,7 @@ from org.sleuthkit.autopsy.coreutils import Logger
|
||||
from org.sleuthkit.autopsy.casemodule import Case
|
||||
from org.sleuthkit.autopsy.casemodule.services import Services
|
||||
from org.sleuthkit.autopsy.casemodule.services import FileManager
|
||||
# This will work in 4.0.1 and beyond
|
||||
# from org.sleuthkit.autopsy.casemodule.services import Blackboard
|
||||
from org.sleuthkit.autopsy.casemodule.services import Blackboard
|
||||
|
||||
# Factory that defines the name and details of the module and allows Autopsy
|
||||
# to create instances of the modules that will do the anlaysis.
|
||||
@@ -95,7 +94,7 @@ class SampleJythonFileIngestModule(FileIngestModule):
|
||||
|
||||
# Where any setup and configuration is done
|
||||
# 'context' is an instance of org.sleuthkit.autopsy.ingest.IngestJobContext.
|
||||
# See: http://sleuthkit.org/autopsy/docs/api-docs/3.1/classorg_1_1sleuthkit_1_1autopsy_1_1ingest_1_1_ingest_job_context.html
|
||||
# See: http://sleuthkit.org/autopsy/docs/api-docs/4.1/classorg_1_1sleuthkit_1_1autopsy_1_1ingest_1_1_ingest_job_context.html
|
||||
# TODO: Add any setup code that you need here.
|
||||
def startUp(self, context):
|
||||
self.filesFound = 0
|
||||
@@ -115,9 +114,8 @@ class SampleJythonFileIngestModule(FileIngestModule):
|
||||
(file.isFile() == False)):
|
||||
return IngestModule.ProcessResult.OK
|
||||
|
||||
# This will work in 4.0.1 and beyond
|
||||
# Use blackboard class to index blackboard artifacts for keyword search
|
||||
# blackboard = Case.getCurrentCase().getServices().getBlackboard()
|
||||
blackboard = Case.getCurrentCase().getServices().getBlackboard()
|
||||
|
||||
# For an example, we will flag files with .txt in the name and make a blackboard artifact.
|
||||
if file.getName().lower().endswith(".txt"):
|
||||
@@ -132,12 +130,11 @@ class SampleJythonFileIngestModule(FileIngestModule):
|
||||
SampleJythonFileIngestModuleFactory.moduleName, "Text Files")
|
||||
art.addAttribute(att)
|
||||
|
||||
# This will work in 4.0.1 and beyond
|
||||
#try:
|
||||
# # index the artifact for keyword search
|
||||
# blackboard.indexArtifact(art)
|
||||
#except Blackboard.BlackboardException as e:
|
||||
# self.log(Level.SEVERE, "Error indexing artifact " + art.getDisplayName())
|
||||
try:
|
||||
# index the artifact for keyword search
|
||||
blackboard.indexArtifact(art)
|
||||
except Blackboard.BlackboardException as e:
|
||||
self.log(Level.SEVERE, "Error indexing artifact " + art.getDisplayName())
|
||||
|
||||
# Fire an event to notify the UI and others that there is a new artifact
|
||||
IngestServices.getInstance().fireModuleDataEvent(
|
||||
|
||||
Reference in New Issue
Block a user