Addresed code review comments

This commit is contained in:
Eugene Livis 2019-02-22 14:23:23 -05:00
parent 5a05c22e19
commit cc94069f58

View File

@ -42,6 +42,9 @@ import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException; import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskData; import org.sleuthkit.datamodel.TskData;
/**
* Generates CASE-UCO report file for a data source
*/
public class CaseUcoFormatExporter { public class CaseUcoFormatExporter {
private static final Logger logger = Logger.getLogger(CaseUcoFormatExporter.class.getName()); private static final Logger logger = Logger.getLogger(CaseUcoFormatExporter.class.getName());
@ -49,6 +52,14 @@ public class CaseUcoFormatExporter {
private CaseUcoFormatExporter() { private CaseUcoFormatExporter() {
} }
/**
* Generates CASE-UCO report for the selected data source.
*
* @param selectedDataSourceId Object ID of the data source
* @param reportOutputPath Full path to directory where to save CASE-UCO
* report file
* @param progressPanel ReportProgressPanel to update progress
*/
@NbBundle.Messages({ @NbBundle.Messages({
"ReportCaseUco.noCaseOpen=Unable to open currect case", "ReportCaseUco.noCaseOpen=Unable to open currect case",
"ReportCaseUco.unableToCreateDirectories=Unable to create directory for CASE-UCO report", "ReportCaseUco.unableToCreateDirectories=Unable to create directory for CASE-UCO report",
@ -177,6 +188,17 @@ public class CaseUcoFormatExporter {
catalog.writeEndObject(); catalog.writeEndObject();
} }
/**
* Save info about the Autopsy case in CASE-UCo format
*
* @param skCase SleuthkitCase object
* @param catalog JsonGenerator object
* @return CASE-UCO trace ID object for the Autopsy case entry
* @throws TskCoreException
* @throws SQLException
* @throws IOException
* @throws NoCurrentCaseException
*/
private static String saveCaseInfo(SleuthkitCase skCase, JsonGenerator catalog) throws TskCoreException, SQLException, IOException, NoCurrentCaseException { private static String saveCaseInfo(SleuthkitCase skCase, JsonGenerator catalog) throws TskCoreException, SQLException, IOException, NoCurrentCaseException {
// create a "trace" entry for the Autopsy case iteself // create a "trace" entry for the Autopsy case iteself
@ -220,6 +242,18 @@ public class CaseUcoFormatExporter {
return caseTraceId; return caseTraceId;
} }
/**
* Save info about the data source in CASE-UCo format
*
* @param selectedDataSourceId Object ID of the data source
* @param caseTraceId CASE-UCO trace ID object for the Autopsy case entry
* @param skCase SleuthkitCase object
* @param catalog JsonGenerator object
* @return
* @throws TskCoreException
* @throws SQLException
* @throws IOException
*/
private static String saveDataSourceInfo(Long selectedDataSourceId, String caseTraceId, SleuthkitCase skCase, JsonGenerator jsonGenerator) throws TskCoreException, SQLException, IOException { private static String saveDataSourceInfo(Long selectedDataSourceId, String caseTraceId, SleuthkitCase skCase, JsonGenerator jsonGenerator) throws TskCoreException, SQLException, IOException {
Long imageSize = (long) 0; Long imageSize = (long) 0;