FileTypeID module: thread-safety tweak and comments

This commit is contained in:
Samuel H. Kenyon 2014-04-16 15:07:28 -04:00
parent 6b648510cd
commit 95cf21312e
3 changed files with 5 additions and 2 deletions

View File

@ -29,6 +29,9 @@ import org.sleuthkit.datamodel.AbstractFile;
*/
interface FileTypeDetectionInterface {
/**
* Instances of this data structure are not shared between threads
*/
public class FileIdInfo {
public String type;

View File

@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
*/
public class FileTypeIdModuleSettings implements IngestModuleIngestJobSettings {
private boolean skipKnownFiles = true;
private volatile boolean skipKnownFiles = true;
FileTypeIdModuleSettings() {
}

View File

@ -27,7 +27,7 @@ import org.sleuthkit.datamodel.AbstractFile;
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
public FileTypeDetectionInterface.FileIdInfo attemptMatch(AbstractFile abstractFile) {