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;
173 if (!setDataSourceOptionsCalled) {
175 deviceId = UUID.randomUUID().toString();
180 md5 = configPanel.getMd5();
184 sha1 = configPanel.getSha1();
185 if (sha1.isEmpty()) {
188 sha256 = configPanel.getSha256();
189 if (sha256.isEmpty()) {
193 run(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, progressMonitor, callback);
218 run(deviceId, imagePath, 0, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callback);
247 addImageTask =
new AddImageTask(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, md5, sha1, sha256, null, progressMonitor, callback);
248 new Thread(addImageTask).start();
260 if (null != addImageTask) {
261 addImageTask.cancelTask();
274 ignoreFatOrphanFiles =
false;
276 setDataSourceOptionsCalled =
false;
280 for (FileFilter filter : filters) {
281 if (filter.accept(file)) {
292 if (!isAcceptedByFiler(dataSourcePath.toFile(), filtersList)) {
303 }
catch (Exception ex) {
313 this.deviceId = deviceId;
314 this.imagePath = dataSourcePath.toString();
316 this.timeZone = Calendar.getInstance().getTimeZone().getID();
317 this.ignoreFatOrphanFiles =
false;
318 setDataSourceOptionsCalled =
true;
319 run(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, null, null, null, progressMonitor, callBack);
337 this.deviceId = UUID.randomUUID().toString();
338 this.imagePath = imagePath;
340 this.timeZone = Calendar.getInstance().getTimeZone().getID();
341 this.ignoreFatOrphanFiles = ignoreFatOrphanFiles;
342 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)