From 72e5ea71b2bc54bc4764483b219af63e6cc0c7df Mon Sep 17 00:00:00 2001 From: Brian Carrier Date: Wed, 14 Aug 2013 23:44:09 -0400 Subject: [PATCH] Added sample data source ingest module and updated docs to refer to it. --- .../casemodule/services/FileManager.java | 30 ++++++++++++------- docs/doxygen/modIngest.dox | 2 ++ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java index e4c497346d..66d0089f6b 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java @@ -77,9 +77,11 @@ public class FileManager implements Closeable { } /** - * @param dataSource data source Content (Image, parent-less - * VirtualDirectory) where to find files - * @param fileName the name of the file or directory to match + * Finds a set of files that meets the name criteria. + * @param dataSource Root data source to limit search results to (Image, + * VirtualDirectory, etc.). + * @param fileName Pattern of the name of the file or directory to match (case + * insensitive, used in LIKE SQL statement). * @return a list of AbstractFile for files/directories whose name matches * the given fileName */ @@ -90,11 +92,15 @@ public class FileManager implements Closeable { return tskCase.findFiles(dataSource, fileName); } + /** - * @param dataSource data source Content (Image, parent-less - * VirtualDirectory) where to find files - * @param fileName the name of the file or directory to match - * @param dirName the name of a parent directory of fileName + * Finds a set of files that meets the name criteria. + * @param dataSource Root data source to limit search results to (Image, + * VirtualDirectory, etc.). + * @param fileName Pattern of the name of the file or directory to match (case + * insensitive, used in LIKE SQL statement). + * @param dirName Pattern of the name of the parent directory to use as the root + * of the search (case insensitive, used in LIKE SQL statement). * @return a list of AbstractFile for files/directories whose name matches * fileName and whose parent directory contains dirName. */ @@ -106,10 +112,12 @@ public class FileManager implements Closeable { } /** - * @param dataSource data source Content (Image, parent-less - * VirtualDirectory) where to find files - * @param fileName the name of the file or directory to match - * @param parentFile parent file/dir of the file to find + * Finds a set of files that meets the name criteria. + * @param dataSource Root data source to limit search results to (Image, + * VirtualDirectory, etc.). + * @param fileName Pattern of the name of the file or directory to match (case + * insensitive, used in LIKE SQL statement). + * @param parentFile Object of root/parent directory to restrict search to. * @return a list of AbstractFile for files/directories whose name matches * fileName and that were inside a directory described by parentFsContent. */ diff --git a/docs/doxygen/modIngest.dox b/docs/doxygen/modIngest.dox index 3d8b53c466..272d9218fc 100644 --- a/docs/doxygen/modIngest.dox +++ b/docs/doxygen/modIngest.dox @@ -48,6 +48,7 @@ blackboard and with inbox messages to the user. \section ingest_datasrc Data Source-level Modules To make a data source-level module, make a new Java class either manually or using the NetBeans wizards. Edit the class to extend "org.sleuthkit.autopsy.ingest.IngestModuleDataSource". NetBeans will likely complain that you have not implemented the necessary methods and you can use its "hints" to automatically generate stubs for them. Use the documentation for the org.sleuthkit.autopsy.ingest.IngestModuleDataSource class for details on what each needs to do. +You can also refer to org.sleuthkit.autopsy.examples.SampleDataSourceIngestModule as an example module. Example snippet of an ingest-level module process() method: @@ -87,6 +88,7 @@ public void process(Content dataSource, IngestDataSourceWorkerController control \section ingest_file File-level Modules To make a File-level module, make a new Java class either manually or using the NetBeans wizards. Edit the class to extend "org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile". NetBeans will likely complain that you have not implemented the necessary methods and you can use its "hints" to automatically generate stubs for them. Use the method documentation in the org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile class to fill in the details. +You can also refer to org.sleuthkit.autopsy.examples.SampleFileIngestModule as an example module. Unlike Data Source-level modules, file-level modules are singletons. Only a single instance is created for all files. The same file-level module instance will be used for files in different images and even different cases if new cases are opened.