20 package org.sleuthkit.autopsy.report.modules.caseuco;
22 import java.io.IOException;
23 import java.nio.file.Files;
24 import java.nio.file.Path;
25 import java.nio.file.Paths;
26 import java.util.ArrayDeque;
27 import java.util.Deque;
28 import java.util.HashSet;
29 import java.util.List;
31 import java.util.logging.Level;
32 import javax.swing.JPanel;
33 import org.openide.util.NbBundle;
56 add(TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_UNDEF.getValue());
57 add(TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG.getValue());
58 add(TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_VIRT.getValue());
75 return NbBundle.getMessage(this.getClass(),
"CaseUcoReportModule.getName.text");
85 return REPORT_FILE_NAME +
"." +
EXTENSION;
90 return NbBundle.getMessage(this.getClass(),
"CaseUcoReportModule.getDesc.text");
109 "CaseUcoReportModule.notInitialized=CASE-UCO settings panel has not been initialized",
110 "CaseUcoReportModule.noDataSourceSelected=No data source selected for CASE-UCO report",
111 "CaseUcoReportModule.ioError=I/O error encountered while generating report",
112 "CaseUcoReportModule.noCaseOpen=No case is currently open",
113 "CaseUcoReportModule.tskCoreException=TskCoreException [%s] encountered while generating the report. Please reference the log for more details.",
114 "CaseUcoReportModule.processingDataSource=Processing datasource: %s",
115 "CaseUcoReportModule.ingestWarning=Warning, this report will be created before ingest services completed",
116 "CaseUcoReportModule.unableToCreateDirectories=Unable to create directory for CASE-UCO report",
117 "CaseUcoReportModule.srcModuleName=CASE-UCO Report"
120 @SuppressWarnings(
"deprecation")
127 Path reportDirectory = Paths.get(baseReportDir);
129 Files.createDirectories(reportDirectory);
130 }
catch (IOException ex) {
131 logger.log(Level.WARNING,
"Unable to create directory for CASE-UCO report.", ex);
133 Bundle.CaseUcoReportModule_unableToCreateDirectories());
147 progressPanel.
start();
150 for(
int i = 0; i < dataSources.size(); i++) {
151 Content dataSource = dataSources.get(i);
153 Bundle.CaseUcoReportModule_processingDataSource(),
154 dataSource.getName()));
164 Bundle.CaseUcoReportModule_srcModuleName(),
167 }
catch (IOException ex) {
168 logger.log(Level.WARNING,
"I/O error encountered while generating the report.", ex);
170 Bundle.CaseUcoReportModule_ioError());
172 logger.log(Level.WARNING,
"No case open.", ex);
174 Bundle.CaseUcoReportModule_noCaseOpen());
175 }
catch (TskCoreException ex) {
176 logger.log(Level.WARNING,
"TskCoreException encounted while generating the report.", ex);
178 String.format(Bundle.CaseUcoReportModule_tskCoreException(), ex.toString()));
200 Deque<Content> stack =
new ArrayDeque<>();
201 stack.addAll(dataSource.getChildren());
204 while(!stack.isEmpty()) {
205 Content current = stack.pop();
206 if(current instanceof AbstractFile) {
207 AbstractFile f = (AbstractFile) (current);
208 if(SUPPORTED_TYPES.contains(f.getMetaType().getValue())) {
209 generator.addFile(f, dataSource);
213 for(Content child : current.getChildren()) {
List< Content > getDataSources()
void warnIngest(ReportProgressPanel progressPanel)
static synchronized IngestManager getInstance()
void addCase(Case caseObj)
static final Set< Short > SUPPORTED_TYPES
void complete(ReportStatus reportStatus)
boolean isIngestRunning()
void addDataSource(Content dataSource, Case parentCase)
void addReport(String localPath, String srcModuleName, String reportName)
void performDepthFirstSearch(Content dataSource, CaseUcoReportGenerator generator)
JPanel getConfigurationPanel()
static final String REPORT_FILE_NAME
void setIndeterminate(boolean indeterminate)
static final String EXTENSION
static final CaseUcoReportModule SINGLE_INSTANCE
static final Logger logger
void setMaximumProgress(int max)
String getRelativeFilePath()
static String getReportFileName()
static synchronized CaseUcoReportModule getDefault()
void generateReport(String baseReportDir, ReportProgressPanel progressPanel)
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
void updateStatusLabel(String statusMessage)
void setProgress(int value)