Merge pull request #7639 from eugene7646/merge_dev

Merge develop
This commit is contained in:
eugene7646 2022-07-07 13:50:57 -04:00 committed by GitHub
commit 20449a3772
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 213 additions and 175 deletions

View File

@ -35,7 +35,8 @@ class CommandLineCommand {
RUN_INGEST,
LIST_ALL_DATA_SOURCES,
GENERATE_REPORTS,
OPEN_CASE_IN_UI;
OPEN_CASE_IN_UI,
LIST_ALL_INGEST_PROFILES;
}
/**

View File

@ -18,6 +18,7 @@
*/
package org.sleuthkit.autopsy.commandlineingest;
import com.google.gson.GsonBuilder;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
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.IngestModuleError;
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.FilesSetsManager;
import org.sleuthkit.autopsy.report.infrastructure.ReportGenerator;
@ -311,6 +313,16 @@ public class CommandLineIngestManager extends CommandLineManager {
return;
}
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:
break;
}

View File

@ -55,6 +55,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
private final Option runIngestCommandOption = Option.optionalArgument('r', "runIngest");
private final Option listAllDataSourcesCommandOption = Option.withoutArgument('l', "listAllDataSources");
private final Option generateReportsOption = Option.optionalArgument('g', "generateReports");
private final Option listAllIngestProfileOption = Option.withoutArgument('p', "listAllIngestProfiles");
private final Option defaultArgument = Option.defaultArguments();
private boolean runFromCommandLine = false;
@ -91,6 +92,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
set.add(runIngestCommandOption);
set.add(listAllDataSourcesCommandOption);
set.add(generateReportsOption);
set.add(listAllIngestProfileOption);
set.add(defaultArgument);
return set;
}
@ -111,7 +113,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
// input arguments must contain at least one command
if (!(values.containsKey(createCaseCommandOption) || values.containsKey(addDataSourceCommandOption)
|| values.containsKey(runIngestCommandOption) || values.containsKey(listAllDataSourcesCommandOption)
|| values.containsKey(generateReportsOption))) {
|| values.containsKey(generateReportsOption) || values.containsKey(listAllIngestProfileOption))) {
// not running from command line
handleError("Invalid command line, an input option must be supplied.");
}
@ -119,6 +121,12 @@ public class CommandLineOptionProcessor extends OptionProcessor {
// parse input parameters
String[] argDirs;
String inputCaseName = "";
if(values.containsKey(listAllIngestProfileOption)) {
CommandLineCommand newCommand = new CommandLineCommand(CommandLineCommand.CommandType.LIST_ALL_INGEST_PROFILES);
commands.add(newCommand);
runFromCommandLine(true);
} else {
if (values.containsKey(caseNameOption)) {
argDirs = values.get(caseNameOption);
if (argDirs.length < 1) {
@ -311,6 +319,7 @@ public class CommandLineOptionProcessor extends OptionProcessor {
runFromCommandLine(true);
}
}
setState(ProcessState.COMPLETED);
System.out.println("Completed processing Autopsy command line options");

View File

@ -1,6 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<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>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
@ -72,6 +78,11 @@
</SubComponents>
</Container>
<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>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription">
<CardConstraints cardName="messages"/>
@ -106,7 +117,7 @@
</Events>
<Constraints>
<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>
</Constraints>
</Component>
@ -130,7 +141,7 @@
</Properties>
<Constraints>
<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>
</Constraints>
</Component>

View File

@ -335,6 +335,8 @@ final class MessageViewer extends JPanel implements RelationshipsViewer {
showingMessagesLabel = new javax.swing.JLabel();
threadNameLabel = new javax.swing.JLabel();
setMinimumSize(new java.awt.Dimension(450, 292));
setName(""); // NOI18N
setLayout(new java.awt.CardLayout());
rootMessagesPane.setOpaque(false);
@ -377,6 +379,7 @@ final class MessageViewer extends JPanel implements RelationshipsViewer {
add(rootMessagesPane, "threads");
messagePanel.setMinimumSize(new java.awt.Dimension(450, 292));
messagePanel.setLayout(new java.awt.GridBagLayout());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
@ -398,8 +401,8 @@ final class MessageViewer extends JPanel implements RelationshipsViewer {
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(9, 0, 9, 15);
messagePanel.add(backButton, gridBagConstraints);
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.gridx = 1;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.insets = new java.awt.Insets(9, 5, 5, 15);
messagePanel.add(threadNameLabel, gridBagConstraints);

View File

@ -44,7 +44,7 @@ import org.sleuthkit.autopsy.directorytree.DataResultFilterNode;
* General Purpose class for panels that need OutlineView of message nodes at
* 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;
@ -57,7 +57,7 @@ class MessagesPanel extends javax.swing.JPanel implements Lookup.Provider {
/**
* Creates new form MessagesPanel
*/
MessagesPanel() {
public MessagesPanel() {
initComponents();
messageContentViewer = new MessageDataContent();