19 package org.sleuthkit.autopsy.casemodule;
22 import java.nio.file.Path;
23 import javax.swing.JPanel;
24 import java.util.ArrayList;
25 import java.util.Calendar;
26 import java.util.List;
27 import java.util.UUID;
28 import javax.swing.filechooser.FileFilter;
29 import org.openide.util.NbBundle;
30 import org.openide.util.lookup.ServiceProvider;
31 import org.openide.util.lookup.ServiceProviders;
44 @ServiceProviders(value = {
45 @ServiceProvider(service = DataSourceProcessor.class)
47 @ServiceProvider(service = AutoIngestDataSourceProcessor.class)}
51 private final static String DATA_SOURCE_TYPE = NbBundle.getMessage(
ImageDSProcessor.class,
"ImageDSProcessor.dsType.text");
52 private static final List<String> allExt =
new ArrayList<>();
56 private static final String ALL_DESC = NbBundle.getMessage(
ImageDSProcessor.class,
"ImageDSProcessor.allDesc.text");
58 private static final List<FileFilter> filtersList =
new ArrayList<>();
76 filtersList.add(allFilter);
77 filtersList.add(rawFilter);
78 filtersList.add(encaseFilter);
81 if (!System.getProperty(
"os.name").toLowerCase().contains(
"mac")) {
82 filtersList.add(virtualMachineFilter);
102 static List<FileFilter> getFileFiltersList() {
114 return DATA_SOURCE_TYPE;
172 if (!setDataSourceOptionsCalled) {
174 deviceId = UUID.randomUUID().toString();
179 md5 = configPanel.getMd5();
183 sha1 = configPanel.getSha1();
184 if (sha1.isEmpty()) {
187 sha256 = configPanel.getSha256();
188 if (sha256.isEmpty()) {
192 run(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, progressMonitor, callback);
217 run(deviceId, imagePath, 0, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callback);
246 addImageTask =
new AddImageTask(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, null, progressMonitor, callback);
247 new Thread(addImageTask).start();
259 if (null != addImageTask) {
260 addImageTask.cancelTask();
273 ignoreFatOrphanFiles =
false;
275 setDataSourceOptionsCalled =
false;
279 for (FileFilter filter : filters) {
280 if (filter.accept(file)) {
291 if (!isAcceptedByFiler(dataSourcePath.toFile(), filtersList)) {
302 }
catch (Exception ex) {
312 this.deviceId = deviceId;
313 this.imagePath = dataSourcePath.toString();
315 this.timeZone = Calendar.getInstance().getTimeZone().getID();
316 this.ignoreFatOrphanFiles =
false;
317 setDataSourceOptionsCalled =
true;
318 run(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callBack);
336 this.deviceId = UUID.randomUUID().toString();
337 this.imagePath = imagePath;
339 this.timeZone = Calendar.getInstance().getTimeZone().getID();
340 this.ignoreFatOrphanFiles = ignoreFatOrphanFiles;
341 setDataSourceOptionsCalled =
true;
boolean getNoFatOrphans()
void process(String deviceId, Path dataSourcePath, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack)
String getDataSourceType()
static boolean isAcceptedByFiler(File file, List< FileFilter > filters)
static final String RAW_IMAGE_DESC
static final String VIRTUAL_MACHINE_DESC
static synchronized ImageFilePanel createInstance(String context, List< FileFilter > fileChooserFilters)
AddImageTask addImageTask
void run(String deviceId, String imagePath, String timeZone, boolean ignoreFatOrphanFiles, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback)
void run(String deviceId, String imagePath, int sectorSize, String timeZone, boolean ignoreFatOrphanFiles, String md5, String sha1, String sha256, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback)
static final String ENCASE_IMAGE_DESC
boolean ignoreFatOrphanFiles
static final List< String > VIRTUAL_MACHINE_EXTS
static final List< String > ENCASE_IMAGE_EXTS
void setDataSourceOptions(String imagePath, String timeZone, boolean ignoreFatOrphanFiles)
boolean setDataSourceOptionsCalled
static boolean imageHasFileSystem(Path dataSourcePath)
void run(DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback)
static Case getCurrentCaseThrows()
final ImageFilePanel configPanel
static final List< String > RAW_IMAGE_EXTS
int canProcess(Path dataSourcePath)