19 package org.sleuthkit.autopsy.modules.embeddedfileextractor;
22 import java.util.logging.Level;
23 import org.openide.util.NbBundle;
36 import net.sf.sevenzipjbinding.SevenZipNativeInitializationException;
44 "CannotCreateOutputFolder=Unable to create output folder.",
45 "CannotRunFileTypeDetection=Unable to run file type detection.",
46 "UnableToInitializeLibraries=Unable to initialize 7Zip libraries."
52 static final String[] SUPPORTED_EXTENSIONS = {
"zip",
"rar",
"arj",
"7z",
"7zip",
"gzip",
"gz",
"bzip2",
"tar",
"tgz",};
65 SupportedImageExtractionFormats abstractFileExtractionFormat;
73 this.context = context;
82 File extractionDirectory =
new File(moduleDirAbsolute);
83 if (!extractionDirectory.exists()) {
85 extractionDirectory.mkdirs();
86 }
catch (SecurityException ex) {
100 this.archiveExtractor =
new SevenZipExtractor(context, fileTypeDetector, moduleDirRelative, moduleDirAbsolute);
101 }
catch (SevenZipNativeInitializationException ex) {
105 this.imageExtractor =
new ImageExtractor(context, fileTypeDetector, moduleDirRelative, moduleDirAbsolute);
111 if (abstractFile.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS)) {
116 if (abstractFile.getKnown().equals(TskData.FileKnown.KNOWN)) {
121 this.archivextraction = archiveExtractor.isSevenZipExtractionSupported(abstractFile);
122 this.imageExtraction = imageExtractor.isImageExtractionSupported(abstractFile);
124 if (!abstractFile.isFile() && (!this.archivextraction || !this.imageExtraction)) {
129 if (this.archivextraction) {
130 archiveExtractor.unpack(abstractFile);
134 if (this.imageExtraction) {
135 imageExtractor.extractImage(abstractFile);
154 static String getUniqueName(AbstractFile archiveFile) {
155 return archiveFile.getName() +
"_" + archiveFile.getId();
String getModuleOutputDirectoryRelativePath()
synchronized long decrementAndGet(long jobId)
String getModuleDirectory()
static Case getCurrentCase()
synchronized static Logger getLogger(String name)
static synchronized IngestServices getInstance()