Autopsy  4.4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
RawDSProcessor.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-2016 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.datasourceprocessors;
20 
21 import java.util.UUID;
22 import javax.swing.JPanel;
23 import org.openide.util.NbBundle.Messages;
24 import org.openide.util.lookup.ServiceProvider;
28 
35 @ServiceProvider(service = DataSourceProcessor.class)
36 public class RawDSProcessor implements DataSourceProcessor {
37 
38  private final RawDSInputPanel configPanel;
39  private AddRawImageTask addImageTask;
40 
41  /*
42  * Constructs a Raw data source processor that implements the
43  * DataSourceProcessor service provider interface to allow integration with
44  * the add data source wizard. It also provides a run method overload to
45  * allow it to be used independently of the wizard.
46  */
47  public RawDSProcessor() {
48  configPanel = RawDSInputPanel.createInstance(RawDSProcessor.class.getName());
49  }
50 
58  @Messages({"RawDSProcessor.dataSourceType=Unallocated Space Image File"})
59  public static String getType() {
60  return Bundle.RawDSProcessor_dataSourceType();
61  }
62 
70  @Override
71  public String getDataSourceType() {
72  return Bundle.RawDSProcessor_dataSourceType();
73  }
74 
83  @Override
84  public JPanel getPanel() {
85  configPanel.readSettings();
86  configPanel.select();
87  return configPanel;
88  }
89 
97  @Override
98  public boolean isPanelValid() {
99  return configPanel.validatePanel();
100  }
101 
116  @Override
117  public void run(DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) {
118  configPanel.storeSettings();
119  run(UUID.randomUUID().toString(), configPanel.getImageFilePath(), configPanel.getTimeZone(), configPanel.getChunkSize(), progressMonitor, callback);
120  }
121 
144  private void run(String deviceId, String imageFilePath, String timeZone, long chunkSize, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) {
145  addImageTask = new AddRawImageTask(deviceId, imageFilePath, timeZone, chunkSize, progressMonitor, callback);
146  new Thread(addImageTask).start();
147  }
148 
149  @Override
150  public void cancel() {
151  }
152 
157  @Override
158  public void reset() {
159  configPanel.reset();
160  }
161 
162 }
void run(String deviceId, String imageFilePath, String timeZone, long chunkSize, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback)
void run(DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback)

Copyright © 2012-2016 Basis Technology. Generated on: Fri Sep 29 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.