Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
AutopsyOptionProcessor.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2018 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 */
19package org.sleuthkit.autopsy.core;
20
21import java.util.HashSet;
22import java.util.Map;
23import java.util.Set;
24import java.util.logging.Level;
25import org.sleuthkit.autopsy.coreutils.Logger;
26import org.netbeans.api.sendopts.CommandException;
27import org.netbeans.spi.sendopts.Env;
28import org.netbeans.spi.sendopts.Option;
29import org.netbeans.spi.sendopts.OptionProcessor;
30import org.openide.util.lookup.ServiceProvider;
31import org.sleuthkit.autopsy.coreutils.ModuleSettings;
32import org.sleuthkit.autopsy.coreutils.PlatformUtil;
33
39@ServiceProvider(service=OptionProcessor.class)
40public class AutopsyOptionProcessor extends OptionProcessor {
41
42 private static final Logger logger = Logger.getLogger(AutopsyOptionProcessor.class.getName());
43 private final Option liveAutopsyOption = Option.optionalArgument('l', "liveAutopsy");
44 // @@@ We should centralize where we store this. It is defined in 2 other places.
45 private final static String PROP_BASECASE = "LBL_BaseCase_PATH";
46
47
48 @Override
49 protected Set<Option> getOptions() {
50 Set<Option> set = new HashSet<>();
51 set.add(liveAutopsyOption);
52 return set;
53 }
54
55 @Override
56 protected void process(Env env, Map<Option, String[]> values) throws CommandException {
57 if(values.containsKey(liveAutopsyOption)){
58 try {
60
61 // get the starting folder to store cases in
62 String[] argDirs= values.get(liveAutopsyOption);
63 String startingCaseDir;
64 if (argDirs == null || argDirs.length == 0) {
65 startingCaseDir = PlatformUtil.getUserDirectory().toString();
66 }
67 else {
68 startingCaseDir = argDirs[0];
69 }
72 logger.log(Level.SEVERE, ex.getMessage(), ex);
73 }
74 }
75 }
76}
void process(Env env, Map< Option, String[]> values)
static synchronized void setRunningInTarget(boolean runningInTarget)
synchronized static Logger getLogger(String name)
Definition Logger.java:124
static synchronized void setConfigSetting(String moduleName, String settingName, String settingVal)

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.