mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
commit
20449a3772
@ -35,7 +35,8 @@ class CommandLineCommand {
|
|||||||
RUN_INGEST,
|
RUN_INGEST,
|
||||||
LIST_ALL_DATA_SOURCES,
|
LIST_ALL_DATA_SOURCES,
|
||||||
GENERATE_REPORTS,
|
GENERATE_REPORTS,
|
||||||
OPEN_CASE_IN_UI;
|
OPEN_CASE_IN_UI,
|
||||||
|
LIST_ALL_INGEST_PROFILES;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.commandlineingest;
|
package org.sleuthkit.autopsy.commandlineingest;
|
||||||
|
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
@ -54,6 +55,7 @@ import org.sleuthkit.autopsy.ingest.IngestJobStartResult;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestModuleError;
|
import org.sleuthkit.autopsy.ingest.IngestModuleError;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestProfiles;
|
import org.sleuthkit.autopsy.ingest.IngestProfiles;
|
||||||
|
import org.sleuthkit.autopsy.ingest.IngestProfiles.IngestProfile;
|
||||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSet;
|
import org.sleuthkit.autopsy.modules.interestingitems.FilesSet;
|
||||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetsManager;
|
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetsManager;
|
||||||
import org.sleuthkit.autopsy.report.infrastructure.ReportGenerator;
|
import org.sleuthkit.autopsy.report.infrastructure.ReportGenerator;
|
||||||
@ -311,6 +313,16 @@ public class CommandLineIngestManager extends CommandLineManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case LIST_ALL_INGEST_PROFILES:
|
||||||
|
List<IngestProfile> profiles = IngestProfiles.getIngestProfiles();
|
||||||
|
GsonBuilder gb = new GsonBuilder();
|
||||||
|
System.out.println("Listing ingest profiles");
|
||||||
|
for(IngestProfile profile: profiles) {
|
||||||
|
String jsonText = gb.create().toJson(profile);
|
||||||
|
System.out.println(jsonText);
|
||||||
|
}
|
||||||
|
System.out.println("Ingest profile list complete");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
|||||||
private final Option runIngestCommandOption = Option.optionalArgument('r', "runIngest");
|
private final Option runIngestCommandOption = Option.optionalArgument('r', "runIngest");
|
||||||
private final Option listAllDataSourcesCommandOption = Option.withoutArgument('l', "listAllDataSources");
|
private final Option listAllDataSourcesCommandOption = Option.withoutArgument('l', "listAllDataSources");
|
||||||
private final Option generateReportsOption = Option.optionalArgument('g', "generateReports");
|
private final Option generateReportsOption = Option.optionalArgument('g', "generateReports");
|
||||||
|
private final Option listAllIngestProfileOption = Option.withoutArgument('p', "listAllIngestProfiles");
|
||||||
private final Option defaultArgument = Option.defaultArguments();
|
private final Option defaultArgument = Option.defaultArguments();
|
||||||
|
|
||||||
private boolean runFromCommandLine = false;
|
private boolean runFromCommandLine = false;
|
||||||
@ -91,6 +92,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
|||||||
set.add(runIngestCommandOption);
|
set.add(runIngestCommandOption);
|
||||||
set.add(listAllDataSourcesCommandOption);
|
set.add(listAllDataSourcesCommandOption);
|
||||||
set.add(generateReportsOption);
|
set.add(generateReportsOption);
|
||||||
|
set.add(listAllIngestProfileOption);
|
||||||
set.add(defaultArgument);
|
set.add(defaultArgument);
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
@ -111,7 +113,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
|||||||
// input arguments must contain at least one command
|
// input arguments must contain at least one command
|
||||||
if (!(values.containsKey(createCaseCommandOption) || values.containsKey(addDataSourceCommandOption)
|
if (!(values.containsKey(createCaseCommandOption) || values.containsKey(addDataSourceCommandOption)
|
||||||
|| values.containsKey(runIngestCommandOption) || values.containsKey(listAllDataSourcesCommandOption)
|
|| values.containsKey(runIngestCommandOption) || values.containsKey(listAllDataSourcesCommandOption)
|
||||||
|| values.containsKey(generateReportsOption))) {
|
|| values.containsKey(generateReportsOption) || values.containsKey(listAllIngestProfileOption))) {
|
||||||
// not running from command line
|
// not running from command line
|
||||||
handleError("Invalid command line, an input option must be supplied.");
|
handleError("Invalid command line, an input option must be supplied.");
|
||||||
}
|
}
|
||||||
@ -119,197 +121,204 @@ public class CommandLineOptionProcessor extends OptionProcessor {
|
|||||||
// parse input parameters
|
// parse input parameters
|
||||||
String[] argDirs;
|
String[] argDirs;
|
||||||
String inputCaseName = "";
|
String inputCaseName = "";
|
||||||
if (values.containsKey(caseNameOption)) {
|
|
||||||
argDirs = values.get(caseNameOption);
|
if(values.containsKey(listAllIngestProfileOption)) {
|
||||||
if (argDirs.length < 1) {
|
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.LIST_ALL_INGEST_PROFILES);
|
||||||
handleError("Missing argument 'caseName'");
|
commands.add(newCommand);
|
||||||
}
|
runFromCommandLine(true);
|
||||||
inputCaseName = argDirs[0];
|
} else {
|
||||||
|
if (values.containsKey(caseNameOption)) {
|
||||||
|
argDirs = values.get(caseNameOption);
|
||||||
|
if (argDirs.length < 1) {
|
||||||
|
handleError("Missing argument 'caseName'");
|
||||||
|
}
|
||||||
|
inputCaseName = argDirs[0];
|
||||||
|
|
||||||
|
if (inputCaseName == null || inputCaseName.isEmpty()) {
|
||||||
|
handleError("'caseName' argument is empty");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 'caseName' must always be specified
|
||||||
if (inputCaseName == null || inputCaseName.isEmpty()) {
|
if (inputCaseName == null || inputCaseName.isEmpty()) {
|
||||||
handleError("'caseName' argument is empty");
|
handleError("'caseName' argument is empty");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// 'caseName' must always be specified
|
String caseType = "";
|
||||||
if (inputCaseName == null || inputCaseName.isEmpty()) {
|
if (values.containsKey(caseTypeOption)) {
|
||||||
handleError("'caseName' argument is empty");
|
argDirs = values.get(caseTypeOption);
|
||||||
}
|
|
||||||
|
|
||||||
String caseType = "";
|
if (argDirs.length < 1) {
|
||||||
if (values.containsKey(caseTypeOption)) {
|
handleError("Missing argument 'caseType'");
|
||||||
argDirs = values.get(caseTypeOption);
|
}
|
||||||
|
caseType = argDirs[0];
|
||||||
|
|
||||||
if (argDirs.length < 1) {
|
if (caseType == null || caseType.isEmpty()) {
|
||||||
handleError("Missing argument 'caseType'");
|
handleError("'caseType' argument is empty");
|
||||||
}
|
} else if (!caseType.equalsIgnoreCase(CASETYPE_MULTI) && !caseType.equalsIgnoreCase(CASETYPE_SINGLE)) {
|
||||||
caseType = argDirs[0];
|
handleError("'caseType' argument is invalid");
|
||||||
|
} else if (caseType.equalsIgnoreCase(CASETYPE_MULTI) && !FeatureAccessUtils.canCreateMultiUserCases()) {
|
||||||
|
handleError("Unable to create multi user case. Confirm that multi user settings are configured correctly.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (caseType == null || caseType.isEmpty()) {
|
String caseBaseDir = "";
|
||||||
handleError("'caseType' argument is empty");
|
if (values.containsKey(caseBaseDirOption)) {
|
||||||
} else if (!caseType.equalsIgnoreCase(CASETYPE_MULTI) && !caseType.equalsIgnoreCase(CASETYPE_SINGLE)) {
|
argDirs = values.get(caseBaseDirOption);
|
||||||
handleError("'caseType' argument is invalid");
|
if (argDirs.length < 1) {
|
||||||
} else if (caseType.equalsIgnoreCase(CASETYPE_MULTI) && !FeatureAccessUtils.canCreateMultiUserCases()) {
|
handleError("Missing argument 'caseBaseDir'");
|
||||||
handleError("Unable to create multi user case. Confirm that multi user settings are configured correctly.");
|
}
|
||||||
}
|
caseBaseDir = argDirs[0];
|
||||||
}
|
|
||||||
|
|
||||||
String caseBaseDir = "";
|
if (caseBaseDir == null || caseBaseDir.isEmpty()) {
|
||||||
if (values.containsKey(caseBaseDirOption)) {
|
handleError("Missing argument 'caseBaseDir' option");
|
||||||
argDirs = values.get(caseBaseDirOption);
|
}
|
||||||
if (argDirs.length < 1) {
|
|
||||||
handleError("Missing argument 'caseBaseDir'");
|
|
||||||
}
|
|
||||||
caseBaseDir = argDirs[0];
|
|
||||||
|
|
||||||
|
if (!(new File(caseBaseDir).exists()) || !(new File(caseBaseDir).isDirectory())) {
|
||||||
|
handleError("'caseBaseDir' directory doesn't exist or is not a directory: " + caseBaseDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 'caseBaseDir' must always be specified
|
||||||
if (caseBaseDir == null || caseBaseDir.isEmpty()) {
|
if (caseBaseDir == null || caseBaseDir.isEmpty()) {
|
||||||
handleError("Missing argument 'caseBaseDir' option");
|
handleError("Missing argument 'caseBaseDir' option");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(new File(caseBaseDir).exists()) || !(new File(caseBaseDir).isDirectory())) {
|
String dataSourcePath = "";
|
||||||
handleError("'caseBaseDir' directory doesn't exist or is not a directory: " + caseBaseDir);
|
if (values.containsKey(dataSourcePathOption)) {
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 'caseBaseDir' must always be specified
|
|
||||||
if (caseBaseDir == null || caseBaseDir.isEmpty()) {
|
|
||||||
handleError("Missing argument 'caseBaseDir' option");
|
|
||||||
}
|
|
||||||
|
|
||||||
String dataSourcePath = "";
|
argDirs = values.get(dataSourcePathOption);
|
||||||
if (values.containsKey(dataSourcePathOption)) {
|
if (argDirs.length < 1) {
|
||||||
|
handleError("Missing argument 'dataSourcePath'");
|
||||||
|
}
|
||||||
|
dataSourcePath = argDirs[0];
|
||||||
|
|
||||||
argDirs = values.get(dataSourcePathOption);
|
// verify inputs
|
||||||
if (argDirs.length < 1) {
|
if (dataSourcePath == null || dataSourcePath.isEmpty()) {
|
||||||
handleError("Missing argument 'dataSourcePath'");
|
handleError("Missing argument 'dataSourcePath'");
|
||||||
}
|
|
||||||
dataSourcePath = argDirs[0];
|
|
||||||
|
|
||||||
// verify inputs
|
|
||||||
if (dataSourcePath == null || dataSourcePath.isEmpty()) {
|
|
||||||
handleError("Missing argument 'dataSourcePath'");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(new File(dataSourcePath).exists())) {
|
|
||||||
handleError("Input data source file " + dataSourcePath + " doesn't exist");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
String dataSourceId = "";
|
|
||||||
if (values.containsKey(dataSourceObjectIdOption)) {
|
|
||||||
|
|
||||||
argDirs = values.get(dataSourceObjectIdOption);
|
|
||||||
if (argDirs.length < 1) {
|
|
||||||
handleError("Missing argument 'dataSourceObjectIdOption'");
|
|
||||||
}
|
|
||||||
dataSourceId = argDirs[0];
|
|
||||||
|
|
||||||
// verify inputs
|
|
||||||
if (dataSourceId == null || dataSourceId.isEmpty()) {
|
|
||||||
handleError("Input data source id is empty");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create commands in order in which they should be executed:
|
|
||||||
// First create the "CREATE_CASE" command, if present
|
|
||||||
if (values.containsKey(createCaseCommandOption)) {
|
|
||||||
|
|
||||||
// 'caseName' must always be specified for "CREATE_CASE" command
|
|
||||||
if (inputCaseName == null || inputCaseName.isEmpty()) {
|
|
||||||
handleError("'caseName' argument is empty");
|
|
||||||
}
|
|
||||||
|
|
||||||
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.CREATE_CASE);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASE_TYPE.name(), caseType);
|
|
||||||
commands.add(newCommand);
|
|
||||||
runFromCommandLine(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add ADD_DATA_SOURCE command, if present
|
|
||||||
if (values.containsKey(addDataSourceCommandOption)) {
|
|
||||||
|
|
||||||
// 'dataSourcePath' must always be specified for "ADD_DATA_SOURCE" command
|
|
||||||
if (dataSourcePath == null || dataSourcePath.isEmpty()) {
|
|
||||||
handleError("'dataSourcePath' argument is empty");
|
|
||||||
}
|
|
||||||
|
|
||||||
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.ADD_DATA_SOURCE);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.DATA_SOURCE_PATH.name(), dataSourcePath);
|
|
||||||
commands.add(newCommand);
|
|
||||||
runFromCommandLine(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
String ingestProfile = "";
|
|
||||||
// Add RUN_INGEST command, if present
|
|
||||||
if (values.containsKey(runIngestCommandOption)) {
|
|
||||||
|
|
||||||
argDirs = values.get(runIngestCommandOption);
|
|
||||||
if(argDirs != null && argDirs.length > 0) {
|
|
||||||
ingestProfile = argDirs[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
// if new data source is being added during this run, then 'dataSourceId' is not specified
|
|
||||||
if (!values.containsKey(addDataSourceCommandOption) && dataSourceId.isEmpty()) {
|
|
||||||
// data source is not being added during this run, so 'dataSourceId' should have been specified
|
|
||||||
handleError("'dataSourceId' argument is empty");
|
|
||||||
}
|
|
||||||
|
|
||||||
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.RUN_INGEST);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.DATA_SOURCE_ID.name(), dataSourceId);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.INGEST_PROFILE_NAME.name(), ingestProfile);
|
|
||||||
commands.add(newCommand);
|
|
||||||
runFromCommandLine(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add "LIST_ALL_DATA_SOURCES" command, if present
|
|
||||||
if (values.containsKey(listAllDataSourcesCommandOption)) {
|
|
||||||
|
|
||||||
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.LIST_ALL_DATA_SOURCES);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
|
||||||
commands.add(newCommand);
|
|
||||||
runFromCommandLine(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add "GENERATE_REPORTS" command, if present
|
|
||||||
if (values.containsKey(generateReportsOption)) {
|
|
||||||
List<String> reportProfiles;
|
|
||||||
argDirs = values.get(generateReportsOption);
|
|
||||||
if (argDirs.length > 0) {
|
|
||||||
// use custom report configuration(s)
|
|
||||||
reportProfiles = Stream.of(argDirs[0].split(","))
|
|
||||||
.map(String::trim)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
if (reportProfiles == null || reportProfiles.isEmpty()) {
|
|
||||||
handleError("'generateReports' argument is empty");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (String reportProfile : reportProfiles) {
|
if (!(new File(dataSourcePath).exists())) {
|
||||||
if (reportProfile.isEmpty()) {
|
handleError("Input data source file " + dataSourcePath + " doesn't exist");
|
||||||
handleError("Empty report profile name");
|
|
||||||
}
|
|
||||||
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.GENERATE_REPORTS);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.REPORT_PROFILE_NAME.name(), reportProfile);
|
|
||||||
commands.add(newCommand);
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// use default report configuration
|
|
||||||
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.GENERATE_REPORTS);
|
String dataSourceId = "";
|
||||||
|
if (values.containsKey(dataSourceObjectIdOption)) {
|
||||||
|
|
||||||
|
argDirs = values.get(dataSourceObjectIdOption);
|
||||||
|
if (argDirs.length < 1) {
|
||||||
|
handleError("Missing argument 'dataSourceObjectIdOption'");
|
||||||
|
}
|
||||||
|
dataSourceId = argDirs[0];
|
||||||
|
|
||||||
|
// verify inputs
|
||||||
|
if (dataSourceId == null || dataSourceId.isEmpty()) {
|
||||||
|
handleError("Input data source id is empty");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create commands in order in which they should be executed:
|
||||||
|
// First create the "CREATE_CASE" command, if present
|
||||||
|
if (values.containsKey(createCaseCommandOption)) {
|
||||||
|
|
||||||
|
// 'caseName' must always be specified for "CREATE_CASE" command
|
||||||
|
if (inputCaseName == null || inputCaseName.isEmpty()) {
|
||||||
|
handleError("'caseName' argument is empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.CREATE_CASE);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASE_TYPE.name(), caseType);
|
||||||
|
commands.add(newCommand);
|
||||||
|
runFromCommandLine(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add ADD_DATA_SOURCE command, if present
|
||||||
|
if (values.containsKey(addDataSourceCommandOption)) {
|
||||||
|
|
||||||
|
// 'dataSourcePath' must always be specified for "ADD_DATA_SOURCE" command
|
||||||
|
if (dataSourcePath == null || dataSourcePath.isEmpty()) {
|
||||||
|
handleError("'dataSourcePath' argument is empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.ADD_DATA_SOURCE);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.DATA_SOURCE_PATH.name(), dataSourcePath);
|
||||||
|
commands.add(newCommand);
|
||||||
|
runFromCommandLine(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
String ingestProfile = "";
|
||||||
|
// Add RUN_INGEST command, if present
|
||||||
|
if (values.containsKey(runIngestCommandOption)) {
|
||||||
|
|
||||||
|
argDirs = values.get(runIngestCommandOption);
|
||||||
|
if(argDirs != null && argDirs.length > 0) {
|
||||||
|
ingestProfile = argDirs[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// if new data source is being added during this run, then 'dataSourceId' is not specified
|
||||||
|
if (!values.containsKey(addDataSourceCommandOption) && dataSourceId.isEmpty()) {
|
||||||
|
// data source is not being added during this run, so 'dataSourceId' should have been specified
|
||||||
|
handleError("'dataSourceId' argument is empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.RUN_INGEST);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.DATA_SOURCE_ID.name(), dataSourceId);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.INGEST_PROFILE_NAME.name(), ingestProfile);
|
||||||
|
commands.add(newCommand);
|
||||||
|
runFromCommandLine(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add "LIST_ALL_DATA_SOURCES" command, if present
|
||||||
|
if (values.containsKey(listAllDataSourcesCommandOption)) {
|
||||||
|
|
||||||
|
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.LIST_ALL_DATA_SOURCES);
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
||||||
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
||||||
commands.add(newCommand);
|
commands.add(newCommand);
|
||||||
}
|
runFromCommandLine(true);
|
||||||
|
}
|
||||||
|
|
||||||
runFromCommandLine(true);
|
// Add "GENERATE_REPORTS" command, if present
|
||||||
|
if (values.containsKey(generateReportsOption)) {
|
||||||
|
List<String> reportProfiles;
|
||||||
|
argDirs = values.get(generateReportsOption);
|
||||||
|
if (argDirs.length > 0) {
|
||||||
|
// use custom report configuration(s)
|
||||||
|
reportProfiles = Stream.of(argDirs[0].split(","))
|
||||||
|
.map(String::trim)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (reportProfiles == null || reportProfiles.isEmpty()) {
|
||||||
|
handleError("'generateReports' argument is empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String reportProfile : reportProfiles) {
|
||||||
|
if (reportProfile.isEmpty()) {
|
||||||
|
handleError("Empty report profile name");
|
||||||
|
}
|
||||||
|
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.GENERATE_REPORTS);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.REPORT_PROFILE_NAME.name(), reportProfile);
|
||||||
|
commands.add(newCommand);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// use default report configuration
|
||||||
|
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.GENERATE_REPORTS);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASE_NAME.name(), inputCaseName);
|
||||||
|
newCommand.addInputValue(CommandLineCommand.InputType.CASES_BASE_DIR_PATH.name(), caseBaseDir);
|
||||||
|
commands.add(newCommand);
|
||||||
|
}
|
||||||
|
|
||||||
|
runFromCommandLine(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(ProcessState.COMPLETED);
|
setState(ProcessState.COMPLETED);
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[450, 292]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="name" type="java.lang.String" value="" noResource="true"/>
|
||||||
|
</Properties>
|
||||||
<AuxValues>
|
<AuxValues>
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
||||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
@ -72,6 +78,11 @@
|
|||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JPanel" name="messagePanel">
|
<Container class="javax.swing.JPanel" name="messagePanel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[450, 292]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription">
|
||||||
<CardConstraints cardName="messages"/>
|
<CardConstraints cardName="messages"/>
|
||||||
@ -106,7 +117,7 @@
|
|||||||
</Events>
|
</Events>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||||
<GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="9" insetsLeft="0" insetsBottom="9" insetsRight="15" anchor="13" weightX="1.0" weightY="0.0"/>
|
<GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="9" insetsLeft="0" insetsBottom="9" insetsRight="15" anchor="13" weightX="0.0" weightY="0.0"/>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
</Constraints>
|
</Constraints>
|
||||||
</Component>
|
</Component>
|
||||||
@ -130,7 +141,7 @@
|
|||||||
</Properties>
|
</Properties>
|
||||||
<Constraints>
|
<Constraints>
|
||||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||||
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="9" insetsLeft="5" insetsBottom="5" insetsRight="15" anchor="17" weightX="0.0" weightY="0.0"/>
|
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="9" insetsLeft="5" insetsBottom="5" insetsRight="15" anchor="17" weightX="1.0" weightY="0.0"/>
|
||||||
</Constraint>
|
</Constraint>
|
||||||
</Constraints>
|
</Constraints>
|
||||||
</Component>
|
</Component>
|
||||||
|
@ -335,6 +335,8 @@ final class MessageViewer extends JPanel implements RelationshipsViewer {
|
|||||||
showingMessagesLabel = new javax.swing.JLabel();
|
showingMessagesLabel = new javax.swing.JLabel();
|
||||||
threadNameLabel = new javax.swing.JLabel();
|
threadNameLabel = new javax.swing.JLabel();
|
||||||
|
|
||||||
|
setMinimumSize(new java.awt.Dimension(450, 292));
|
||||||
|
setName(""); // NOI18N
|
||||||
setLayout(new java.awt.CardLayout());
|
setLayout(new java.awt.CardLayout());
|
||||||
|
|
||||||
rootMessagesPane.setOpaque(false);
|
rootMessagesPane.setOpaque(false);
|
||||||
@ -377,6 +379,7 @@ final class MessageViewer extends JPanel implements RelationshipsViewer {
|
|||||||
|
|
||||||
add(rootMessagesPane, "threads");
|
add(rootMessagesPane, "threads");
|
||||||
|
|
||||||
|
messagePanel.setMinimumSize(new java.awt.Dimension(450, 292));
|
||||||
messagePanel.setLayout(new java.awt.GridBagLayout());
|
messagePanel.setLayout(new java.awt.GridBagLayout());
|
||||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
gridBagConstraints.gridx = 0;
|
gridBagConstraints.gridx = 0;
|
||||||
@ -398,8 +401,8 @@ final class MessageViewer extends JPanel implements RelationshipsViewer {
|
|||||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
gridBagConstraints.gridx = 2;
|
gridBagConstraints.gridx = 2;
|
||||||
gridBagConstraints.gridy = 0;
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
|
||||||
gridBagConstraints.weightx = 1.0;
|
|
||||||
gridBagConstraints.insets = new java.awt.Insets(9, 0, 9, 15);
|
gridBagConstraints.insets = new java.awt.Insets(9, 0, 9, 15);
|
||||||
messagePanel.add(backButton, gridBagConstraints);
|
messagePanel.add(backButton, gridBagConstraints);
|
||||||
backButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(MessageViewer.class, "MessageViewer.backButton.AccessibleContext.accessibleDescription")); // NOI18N
|
backButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(MessageViewer.class, "MessageViewer.backButton.AccessibleContext.accessibleDescription")); // NOI18N
|
||||||
@ -416,7 +419,9 @@ final class MessageViewer extends JPanel implements RelationshipsViewer {
|
|||||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||||
gridBagConstraints.gridx = 1;
|
gridBagConstraints.gridx = 1;
|
||||||
gridBagConstraints.gridy = 0;
|
gridBagConstraints.gridy = 0;
|
||||||
|
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||||
|
gridBagConstraints.weightx = 1.0;
|
||||||
gridBagConstraints.insets = new java.awt.Insets(9, 5, 5, 15);
|
gridBagConstraints.insets = new java.awt.Insets(9, 5, 5, 15);
|
||||||
messagePanel.add(threadNameLabel, gridBagConstraints);
|
messagePanel.add(threadNameLabel, gridBagConstraints);
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ import org.sleuthkit.autopsy.directorytree.DataResultFilterNode;
|
|||||||
* General Purpose class for panels that need OutlineView of message nodes at
|
* General Purpose class for panels that need OutlineView of message nodes at
|
||||||
* the top with a MessageDataContent at the bottom.
|
* the top with a MessageDataContent at the bottom.
|
||||||
*/
|
*/
|
||||||
class MessagesPanel extends javax.swing.JPanel implements Lookup.Provider {
|
public class MessagesPanel extends javax.swing.JPanel implements Lookup.Provider {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ class MessagesPanel extends javax.swing.JPanel implements Lookup.Provider {
|
|||||||
/**
|
/**
|
||||||
* Creates new form MessagesPanel
|
* Creates new form MessagesPanel
|
||||||
*/
|
*/
|
||||||
MessagesPanel() {
|
public MessagesPanel() {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
messageContentViewer = new MessageDataContent();
|
messageContentViewer = new MessageDataContent();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user