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),
46 @ServiceProvider(service=AutoIngestDataSourceProcessor.class)}
50 private final static String DATA_SOURCE_TYPE = NbBundle.getMessage(
ImageDSProcessor.class,
"ImageDSProcessor.dsType.text");
51 private static final List<String> allExt =
new ArrayList<>();
55 private static final String ALL_DESC = NbBundle.getMessage(
ImageDSProcessor.class,
"ImageDSProcessor.allDesc.text");
57 private static final List<FileFilter> filtersList =
new ArrayList<>();
71 filtersList.add(allFilter);
72 filtersList.add(rawFilter);
73 filtersList.add(encaseFilter);
74 filtersList.add(virtualMachineFilter);
98 return DATA_SOURCE_TYPE;
156 if (!setDataSourceOptionsCalled) {
158 deviceId = UUID.randomUUID().toString();
163 run(deviceId, imagePath, timeZone, ignoreFatOrphanFiles, progressMonitor, callback);
188 addImageTask =
new AddImageTask(deviceId, imagePath, timeZone, ignoreFatOrphanFiles, null, progressMonitor, callback);
189 new Thread(addImageTask).start();
201 if (null != addImageTask) {
202 addImageTask.cancelTask();
215 ignoreFatOrphanFiles =
false;
217 setDataSourceOptionsCalled =
false;
221 for (FileFilter filter : filters) {
222 if (filter.accept(file)) {
233 if (!isAcceptedByFiler(dataSourcePath.toFile(), filtersList)) {
244 }
catch (Exception ex) {
254 this.deviceId = deviceId;
255 this.imagePath = dataSourcePath.toString();
256 this.timeZone = Calendar.getInstance().getTimeZone().getID();
257 this.ignoreFatOrphanFiles =
false;
258 setDataSourceOptionsCalled =
true;
259 run(deviceId, dataSourcePath.toString(), timeZone, ignoreFatOrphanFiles, progressMonitor, callBack);
277 this.deviceId = UUID.randomUUID().toString();
278 this.imagePath = imagePath;
279 this.timeZone = Calendar.getInstance().getTimeZone().getID();
280 this.ignoreFatOrphanFiles = ignoreFatOrphanFiles;
281 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)
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 getCurrentCase()
final ImageFilePanel configPanel
static final List< String > RAW_IMAGE_EXTS
int canProcess(Path dataSourcePath)