mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26:15 +00:00
FileTypeID module: thread-safety tweak and comments
This commit is contained in:
parent
6b648510cd
commit
95cf21312e
@ -29,6 +29,9 @@ import org.sleuthkit.datamodel.AbstractFile;
|
|||||||
*/
|
*/
|
||||||
interface FileTypeDetectionInterface {
|
interface FileTypeDetectionInterface {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instances of this data structure are not shared between threads
|
||||||
|
*/
|
||||||
public class FileIdInfo {
|
public class FileIdInfo {
|
||||||
|
|
||||||
public String type;
|
public String type;
|
||||||
|
@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
|||||||
*/
|
*/
|
||||||
public class FileTypeIdModuleSettings implements IngestModuleIngestJobSettings {
|
public class FileTypeIdModuleSettings implements IngestModuleIngestJobSettings {
|
||||||
|
|
||||||
private boolean skipKnownFiles = true;
|
private volatile boolean skipKnownFiles = true;
|
||||||
|
|
||||||
FileTypeIdModuleSettings() {
|
FileTypeIdModuleSettings() {
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ import org.sleuthkit.datamodel.AbstractFile;
|
|||||||
|
|
||||||
class TikaFileTypeDetector implements FileTypeDetectionInterface {
|
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
|
@Override
|
||||||
public FileTypeDetectionInterface.FileIdInfo attemptMatch(AbstractFile abstractFile) {
|
public FileTypeDetectionInterface.FileIdInfo attemptMatch(AbstractFile abstractFile) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user