mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-08 22:29:33 +00:00
- Ingest framework skeleton
- TSK-287 Make Directory Tree tab left-most tab - fixed keyword search explorer
This commit is contained in:
parent
338662fc90
commit
320fc7ff39
@ -1,8 +1,8 @@
|
|||||||
build.xml.data.CRC32=a2330d9e
|
build.xml.data.CRC32=2b495fd9
|
||||||
build.xml.script.CRC32=601bc2ba
|
build.xml.script.CRC32=601bc2ba
|
||||||
build.xml.stylesheet.CRC32=a56c6a5b@2.47.1
|
build.xml.stylesheet.CRC32=a56c6a5b@1.46.2
|
||||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
nbproject/build-impl.xml.data.CRC32=a2330d9e
|
nbproject/build-impl.xml.data.CRC32=2b495fd9
|
||||||
nbproject/build-impl.xml.script.CRC32=65e93a36
|
nbproject/build-impl.xml.script.CRC32=65e93a36
|
||||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.47.1
|
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.2
|
||||||
|
@ -123,6 +123,15 @@
|
|||||||
<specification-version>1.0</specification-version>
|
<specification-version>1.0</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.sleuthkit.autopsy.ingest</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<release-version>0-1</release-version>
|
||||||
|
<specification-version>1.0</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
</module-dependencies>
|
</module-dependencies>
|
||||||
<test-dependencies>
|
<test-dependencies>
|
||||||
<test-type>
|
<test-type>
|
||||||
|
@ -188,6 +188,11 @@
|
|||||||
<attr name="position" intvalue="3075"/>
|
<attr name="position" intvalue="3075"/>
|
||||||
</file>
|
</file>
|
||||||
</folder>
|
</folder>
|
||||||
|
<file name="org-sleuthkit-autopsy-hashdatabase-HashDbIngestService.instance">
|
||||||
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestServiceFsContent"/>
|
||||||
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.hashdatabase.HashDbIngestService.getDefault"/>
|
||||||
|
<attr name="position" intvalue="300"/>
|
||||||
|
</file>
|
||||||
</folder>
|
</folder>
|
||||||
<folder name="Shortcuts">
|
<folder name="Shortcuts">
|
||||||
<file name="D-N.shadow">
|
<file name="D-N.shadow">
|
||||||
|
@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2011 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
package org.sleuthkit.autopsy.hashdatabase;
|
||||||
|
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
|
import org.sleuthkit.autopsy.ingest.IngestServiceFsContent;
|
||||||
|
import org.sleuthkit.datamodel.FsContent;
|
||||||
|
|
||||||
|
public class HashDbIngestService implements IngestServiceFsContent {
|
||||||
|
|
||||||
|
private static HashDbIngestService instance = null;
|
||||||
|
|
||||||
|
private static String SERVICE_NAME = "Hash Db";
|
||||||
|
|
||||||
|
private static final Logger logger = Logger.getLogger(HashDbIngestService.class.getName());
|
||||||
|
|
||||||
|
private HashDbIngestService() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static synchronized HashDbIngestService getDefault() {
|
||||||
|
if (instance == null) {
|
||||||
|
instance = new HashDbIngestService();
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void process(FsContent fsContent) {
|
||||||
|
logger.log(Level.INFO, "Processing fsContent: " + fsContent.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void complete() {
|
||||||
|
logger.log(Level.INFO, "complete()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return SERVICE_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(IngestManager manager) {
|
||||||
|
logger.log(Level.INFO, "init()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stop() {
|
||||||
|
logger.log(Level.INFO, "stop()");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
8
Ingest/build.xml
Normal file
8
Ingest/build.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
|
||||||
|
<!-- for some information on what you could do (e.g. targets to override). -->
|
||||||
|
<!-- If you delete this file and reopen the project it will be recreated. -->
|
||||||
|
<project name="org.sleuthkit.autopsy.ingest" default="netbeans" basedir=".">
|
||||||
|
<description>Builds, tests, and runs the project org.sleuthkit.autopsy.ingest.</description>
|
||||||
|
<import file="nbproject/build-impl.xml"/>
|
||||||
|
</project>
|
9
Ingest/manifest.mf
Normal file
9
Ingest/manifest.mf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Bundle-Localization: org/sleuthkit/autopsy/ingest/Bundle
|
||||||
|
Bundle-Name: %OpenIDE-Module-Name
|
||||||
|
Bundle-SymbolicName: org.sleuthkit.autopsy.ingest/1
|
||||||
|
OpenIDE-Module-Implementation-Version: 1
|
||||||
|
OpenIDE-Module-Layer: org/sleuthkit/autopsy/ingest/layer.xml
|
||||||
|
OpenIDE-Module-Requires: org.openide.windows.WindowManager
|
||||||
|
OpenIDE-Module: org.sleuthkit.autopsy.ingest/0
|
||||||
|
|
45
Ingest/nbproject/build-impl.xml
Normal file
45
Ingest/nbproject/build-impl.xml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
||||||
|
*** EDIT ../build.xml INSTEAD ***
|
||||||
|
-->
|
||||||
|
<project name="org.sleuthkit.autopsy.ingest-impl" basedir="..">
|
||||||
|
<fail message="Please build using Ant 1.7.1 or higher.">
|
||||||
|
<condition>
|
||||||
|
<not>
|
||||||
|
<antversion atleast="1.7.1"/>
|
||||||
|
</not>
|
||||||
|
</condition>
|
||||||
|
</fail>
|
||||||
|
<property file="nbproject/private/suite-private.properties"/>
|
||||||
|
<property file="nbproject/suite.properties"/>
|
||||||
|
<fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
|
||||||
|
<property file="${suite.dir}/nbproject/private/platform-private.properties"/>
|
||||||
|
<property file="${suite.dir}/nbproject/platform.properties"/>
|
||||||
|
<macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||||
|
<attribute name="name"/>
|
||||||
|
<attribute name="value"/>
|
||||||
|
<sequential>
|
||||||
|
<property name="@{name}" value="${@{value}}"/>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
<macrodef name="evalprops" uri="http://www.netbeans.org/ns/nb-module-project/2">
|
||||||
|
<attribute name="property"/>
|
||||||
|
<attribute name="value"/>
|
||||||
|
<sequential>
|
||||||
|
<property name="@{property}" value="@{value}"/>
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
<property file="${user.properties.file}"/>
|
||||||
|
<nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||||
|
<nbmproject2:property name="nbplatform.active.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||||
|
<nbmproject2:evalprops property="cluster.path.evaluated" value="${cluster.path}" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
|
||||||
|
<fail message="Path to 'platform' cluster missing in $${cluster.path} property or using corrupt Netbeans Platform (missing harness).">
|
||||||
|
<condition>
|
||||||
|
<not>
|
||||||
|
<contains string="${cluster.path.evaluated}" substring="platform"/>
|
||||||
|
</not>
|
||||||
|
</condition>
|
||||||
|
</fail>
|
||||||
|
<import file="${harness.dir}/build.xml"/>
|
||||||
|
</project>
|
8
Ingest/nbproject/genfiles.properties
Normal file
8
Ingest/nbproject/genfiles.properties
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
build.xml.data.CRC32=1833dad1
|
||||||
|
build.xml.script.CRC32=7d5a04db
|
||||||
|
build.xml.stylesheet.CRC32=a56c6a5b@1.46.2
|
||||||
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
|
nbproject/build-impl.xml.data.CRC32=1833dad1
|
||||||
|
nbproject/build-impl.xml.script.CRC32=8b2da6d1
|
||||||
|
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.2
|
3
Ingest/nbproject/project.properties
Normal file
3
Ingest/nbproject/project.properties
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
javac.source=1.6
|
||||||
|
javac.compilerargs=-Xlint -Xlint:-serial
|
||||||
|
spec.version.base=1.0
|
121
Ingest/nbproject/project.xml
Normal file
121
Ingest/nbproject/project.xml
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||||
|
<type>org.netbeans.modules.apisupport.project</type>
|
||||||
|
<configuration>
|
||||||
|
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
|
||||||
|
<code-name-base>org.sleuthkit.autopsy.ingest</code-name-base>
|
||||||
|
<suite-component/>
|
||||||
|
<module-dependencies>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.netbeans.api.progress</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<release-version>1</release-version>
|
||||||
|
<specification-version>1.24.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.netbeans.libs.osgi</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.netbeans.modules.settings</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<release-version>1</release-version>
|
||||||
|
<specification-version>1.31.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.openide.awt</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<specification-version>7.31.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.openide.dialogs</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<specification-version>7.20.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.openide.modules</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<specification-version>7.23.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.openide.nodes</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<specification-version>7.21.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.openide.util</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<specification-version>8.15.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.openide.util.lookup</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<specification-version>8.8.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.openide.windows</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<specification-version>6.40.1</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.sleuthkit.autopsy.corecomponentinterfaces</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<release-version>1</release-version>
|
||||||
|
<specification-version>1.0</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.sleuthkit.autopsy.coreutils</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<release-version>0-1</release-version>
|
||||||
|
<specification-version>0.0</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.sleuthkit.autopsy.datamodel</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<release-version>1</release-version>
|
||||||
|
<specification-version>1.0</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
|
</module-dependencies>
|
||||||
|
<public-packages>
|
||||||
|
<package>org.sleuthkit.autopsy.ingest</package>
|
||||||
|
</public-packages>
|
||||||
|
</data>
|
||||||
|
</configuration>
|
||||||
|
</project>
|
1
Ingest/nbproject/suite.properties
Normal file
1
Ingest/nbproject/suite.properties
Normal file
@ -0,0 +1 @@
|
|||||||
|
suite.dir=${basedir}/..
|
@ -0,0 +1,9 @@
|
|||||||
|
CTL_IngestAction=Ingest
|
||||||
|
CTL_IngestTopComponent=Ingest
|
||||||
|
HINT_IngestTopComponent=Ingest window
|
||||||
|
OpenIDE-Module-Name=Ingest
|
||||||
|
IngestTopComponent.topLable.text=Image ingest services
|
||||||
|
IngestTopComponent.startButton.text=Start
|
||||||
|
IngestTopComponent.refreshFreqLabel.text=Refresh frequency
|
||||||
|
IngestTopComponent.fileProgressLabel.text=File progress
|
||||||
|
IngestTopComponent.imageProgressLabel.text=Image progress
|
206
Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java
Normal file
206
Ingest/src/org/sleuthkit/autopsy/ingest/IngestManager.java
Normal file
@ -0,0 +1,206 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2011 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.sleuthkit.autopsy.ingest;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import org.openide.util.Lookup;
|
||||||
|
import org.sleuthkit.datamodel.FsContent;
|
||||||
|
import org.sleuthkit.datamodel.Image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IngestManager sets up and manages ingest services
|
||||||
|
* runs them in a background thread
|
||||||
|
* notifies services when work is complete or should be interrupted
|
||||||
|
* processes messages from services in postMessage() and posts them to GUI
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class IngestManager {
|
||||||
|
|
||||||
|
private static final Logger logger = Logger.getLogger(IngestManager.class.getName());
|
||||||
|
private IngestTopComponent tc;
|
||||||
|
private IngestManagerStats stats;
|
||||||
|
private int updateFrequency;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param tc handle to Ingest top component
|
||||||
|
*/
|
||||||
|
IngestManager(IngestTopComponent tc) {
|
||||||
|
this.tc = tc;
|
||||||
|
stats = new IngestManagerStats();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IngestManager entry point, enqueues image to be processed.
|
||||||
|
* Spawns background thread which enumerates all sorted files and executes chosen services per file in a pre-determined order.
|
||||||
|
* Notifies services when work is complete or should be interrupted using complete() and stop() calls.
|
||||||
|
* Does not block and can be called multiple times to enqueue more work to already running background process.
|
||||||
|
*/
|
||||||
|
void execute(Collection<IngestServiceAbstract> services, Image image) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns the current minimal update frequency setting
|
||||||
|
* Services should call this between processing iterations to get current setting
|
||||||
|
* and use the setting to change notification and data refresh intervals
|
||||||
|
*/
|
||||||
|
public synchronized int getUpdateFrequency() {
|
||||||
|
return updateFrequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set new minimal update frequency services should use
|
||||||
|
* @param frequency
|
||||||
|
*/
|
||||||
|
synchronized void setUpdateFrequency(int frequency) {
|
||||||
|
this.updateFrequency = frequency;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns ingest summary report (how many files ingested, any errors, etc)
|
||||||
|
*/
|
||||||
|
String getReport() {
|
||||||
|
return stats.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service publishes message using InegestManager handle
|
||||||
|
* Does not block.
|
||||||
|
* The message gets enqueued in the GUI thread and displayed in a widget
|
||||||
|
* IngestService should make an attempt not to publish the same message multiple times.
|
||||||
|
* Viewer will attempt to identify duplicate messages and filter them out (slower)
|
||||||
|
*/
|
||||||
|
public synchronized void postMessage(final IngestMessage message) {
|
||||||
|
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
tc.displayMessage(message);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* helper to return all image services managed (using Lookup API)
|
||||||
|
*/
|
||||||
|
public static Collection<IngestServiceImage> enumerateImageServices() {
|
||||||
|
return (Collection<IngestServiceImage>) Lookup.getDefault().lookupAll(IngestServiceImage.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* helper to return all file/dir services managed (using Lookup API)
|
||||||
|
*/
|
||||||
|
public static Collection<IngestServiceFsContent> enumerateFsContentServices() {
|
||||||
|
return (Collection<IngestServiceFsContent>) Lookup.getDefault().lookupAll(IngestServiceFsContent.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get next file/dir to process
|
||||||
|
* the queue of FsContent to process is maintained internally
|
||||||
|
* and could be dynamically sorted as data comes in
|
||||||
|
*/
|
||||||
|
private synchronized FsContent getNextFsContent() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized boolean hasNextFsContent() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get next Image to process
|
||||||
|
* the queue of Images to process is maintained internally
|
||||||
|
* and could be dynamically sorted as data comes in
|
||||||
|
*/
|
||||||
|
private synchronized Image getNextImage() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized boolean hasNextImage() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* collects IngestManager statistics during runtime
|
||||||
|
*/
|
||||||
|
private static class IngestManagerStats {
|
||||||
|
|
||||||
|
Date startTime;
|
||||||
|
Date endTime;
|
||||||
|
int errorsTotal;
|
||||||
|
Map<IngestServiceAbstract, Integer> errors;
|
||||||
|
private static DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
IngestManagerStats() {
|
||||||
|
errors = new HashMap<IngestServiceAbstract, Integer>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
if (startTime != null) {
|
||||||
|
sb.append("Start time: ").append(dateFormatter.format(startTime));
|
||||||
|
}
|
||||||
|
if (endTime != null) {
|
||||||
|
sb.append("End time: ").append(dateFormatter.format(endTime));
|
||||||
|
}
|
||||||
|
sb.append("Total ingest time: ").append(getTotalTime());
|
||||||
|
sb.append("Total errors: ").append(errorsTotal);
|
||||||
|
if (errorsTotal > 0) {
|
||||||
|
sb.append("Errors per service:");
|
||||||
|
for (IngestServiceAbstract service : errors.keySet()) {
|
||||||
|
final int errorsService = errors.get(service);
|
||||||
|
sb.append("\t").append(service.getName()).append(": ").append(errorsService);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
void start() {
|
||||||
|
startTime = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
|
void end() {
|
||||||
|
endTime = new Date();
|
||||||
|
}
|
||||||
|
|
||||||
|
long getTotalTime() {
|
||||||
|
if (startTime == null || endTime == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return endTime.getTime() - startTime.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
void addError(IngestServiceAbstract source) {
|
||||||
|
++errorsTotal;
|
||||||
|
int curServiceError = errors.get(source);
|
||||||
|
errors.put(source, curServiceError + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
142
Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessage.java
Normal file
142
Ingest/src/org/sleuthkit/autopsy/ingest/IngestMessage.java
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2011 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.sleuthkit.autopsy.ingest;
|
||||||
|
|
||||||
|
import org.sleuthkit.autopsy.datamodel.KeyValueThing;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Representation of text posted by ingest services
|
||||||
|
*
|
||||||
|
* Message should have a unique ID within context of originating source
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class IngestMessage {
|
||||||
|
|
||||||
|
public enum MessageType {
|
||||||
|
|
||||||
|
DATA, INFO, WARNING, ERROR
|
||||||
|
};
|
||||||
|
|
||||||
|
private long ID;
|
||||||
|
private MessageType messageType;
|
||||||
|
private IngestServiceAbstract source;
|
||||||
|
private String text;
|
||||||
|
private KeyValueThing data;
|
||||||
|
|
||||||
|
private IngestMessage(long ID, MessageType messageType, IngestServiceAbstract source, String text) {
|
||||||
|
this.ID = ID;
|
||||||
|
this.source = source;
|
||||||
|
this.messageType = messageType;
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
//getters
|
||||||
|
public long getID() {
|
||||||
|
return ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IngestServiceAbstract getSource() {
|
||||||
|
return source;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getText() {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public KeyValueThing getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MessageType getMessageType() {
|
||||||
|
return messageType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(Long.toString(ID)).append(": ");
|
||||||
|
sb.append("type: ").append(messageType.name());
|
||||||
|
sb.append("source: ").append(source.getName());
|
||||||
|
sb.append("text: ").append(text);
|
||||||
|
if (data != null)
|
||||||
|
sb.append("data: ").append(data.toString());
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (obj == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getClass() != obj.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final IngestMessage other = (IngestMessage) obj;
|
||||||
|
if (this.ID != other.ID) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.messageType != other.messageType) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.source != other.source && (this.source == null || !this.source.equals(other.source))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 7;
|
||||||
|
hash = 83 * hash + (int) (this.ID ^ (this.ID >>> 32));
|
||||||
|
hash = 83 * hash + (this.messageType != null ? this.messageType.hashCode() : 0);
|
||||||
|
hash = 83 * hash + (this.source != null ? this.source.hashCode() : 0);
|
||||||
|
hash = 83 * hash + (this.text != null ? this.text.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//factory methods
|
||||||
|
public static IngestMessage createMessage(long ID, MessageType messageType, IngestServiceAbstract source, String message) {
|
||||||
|
if (messageType == null || source == null || message == null) {
|
||||||
|
throw new IllegalArgumentException("message type, source and message cannot be null");
|
||||||
|
}
|
||||||
|
IngestMessage im = new IngestMessage(ID, messageType, source, message);
|
||||||
|
return im;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IngestMessage createErrorMessage(long ID, IngestServiceAbstract source, String message) {
|
||||||
|
if (source == null || message == null) {
|
||||||
|
throw new IllegalArgumentException("message type, source and message cannot be null");
|
||||||
|
}
|
||||||
|
IngestMessage im = new IngestMessage(ID, MessageType.ERROR, source, message);
|
||||||
|
return im;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IngestMessage createDataMessage(long ID, IngestServiceAbstract source, String message, KeyValueThing data) {
|
||||||
|
if (source == null || message == null) {
|
||||||
|
throw new IllegalArgumentException("source and message cannot be null");
|
||||||
|
}
|
||||||
|
IngestMessage im = new IngestMessage(ID, MessageType.DATA, source, message);
|
||||||
|
im.data = data;
|
||||||
|
return im;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2011 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.sleuthkit.autopsy.ingest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base interface for ingest services
|
||||||
|
*/
|
||||||
|
public interface IngestServiceAbstract {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notification from manager that brand new processing should be initiated.
|
||||||
|
* Service loads its configuration and performs initialization
|
||||||
|
*
|
||||||
|
* @param IngestManager handle to the manager to postMessage() to
|
||||||
|
*/
|
||||||
|
public void init(IngestManager manager);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notification from manager that there is no more content to process and all work is done.
|
||||||
|
* Service performs any clean-up, notifies viewers and may also write results to the black-board
|
||||||
|
*/
|
||||||
|
public void complete();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notification from manager to stop processing due to some interruption (user, error, exception)
|
||||||
|
*/
|
||||||
|
public void stop();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get specific name of the service
|
||||||
|
* should be unique across services, a user-friendly name of the service shown in GUI
|
||||||
|
*/
|
||||||
|
public String getName();
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2011 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.sleuthkit.autopsy.ingest;
|
||||||
|
|
||||||
|
import org.sleuthkit.datamodel.FsContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ingest service that acts on every FsContent in image
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IngestServiceFsContent extends IngestServiceAbstract {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notification from manager to process file / directory.
|
||||||
|
* Service may choose to perform an action or enqueue processing of a group of FsContents.
|
||||||
|
* The service notifies viewers via IngestManager.postMessage()
|
||||||
|
* and may also write results to the black-board as it is processing
|
||||||
|
*/
|
||||||
|
public void process(FsContent fsContent);
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2011 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.sleuthkit.autopsy.ingest;
|
||||||
|
|
||||||
|
import org.sleuthkit.datamodel.Image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ingest service that acts on entire image (such as Internet history)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface IngestServiceImage extends IngestServiceAbstract {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* notification from manager to process image
|
||||||
|
* The service notifies viewers via IngestManager.postMessage()
|
||||||
|
* and may also write results to the black-board as it is processing.
|
||||||
|
*/
|
||||||
|
public void process(Image image);
|
||||||
|
}
|
201
Ingest/src/org/sleuthkit/autopsy/ingest/IngestTopComponent.form
Normal file
201
Ingest/src/org/sleuthkit/autopsy/ingest/IngestTopComponent.form
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
<?xml version="1.1" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="mainScrollPane" pref="289" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="mainScrollPane" pref="509" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="mainScrollPane">
|
||||||
|
<Properties>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[289, 509]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Container class="javax.swing.JPanel" name="mainPanel">
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="topLable" min="-2" max="-2" attributes="1"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||||
|
<Component id="jProgressBar1" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="imageProgressBar" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="servicesPanel" alignment="0" max="32767" attributes="1"/>
|
||||||
|
<Component id="freqSlider" alignment="0" max="32767" attributes="1"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace min="-2" pref="173" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="startButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="316" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="81" max="-2" attributes="0"/>
|
||||||
|
<Component id="imageProgressLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="227" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="74" max="-2" attributes="0"/>
|
||||||
|
<Component id="refreshFreqLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="219" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="84" max="-2" attributes="0"/>
|
||||||
|
<Component id="fileProgressLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="238" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
|
||||||
|
<Component id="topLable" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="servicesPanel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="startButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
|
||||||
|
<Component id="freqSlider" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="refreshFreqLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
|
||||||
|
<Component id="imageProgressBar" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="imageProgressLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||||
|
<Component id="jProgressBar1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="fileProgressLabel" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="75" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="topLable">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Tahoma" size="12" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestTopComponent.topLable.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JPanel" name="servicesPanel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
|
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
|
||||||
|
<LineBorder/>
|
||||||
|
</Border>
|
||||||
|
</Property>
|
||||||
|
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[200, 150]"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
|
<Dimension value="[200, 150]"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="198" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="148" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JSlider" name="freqSlider">
|
||||||
|
<Properties>
|
||||||
|
<Property name="majorTickSpacing" type="int" value="1"/>
|
||||||
|
<Property name="maximum" type="int" value="10"/>
|
||||||
|
<Property name="minimum" type="int" value="1"/>
|
||||||
|
<Property name="paintLabels" type="boolean" value="true"/>
|
||||||
|
<Property name="paintTicks" type="boolean" value="true"/>
|
||||||
|
<Property name="snapToTicks" type="boolean" value="true"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="stateChanged" listener="javax.swing.event.ChangeListener" parameters="javax.swing.event.ChangeEvent" handler="freqSliderStateChanged"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="startButton">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestTopComponent.startButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="startButtonActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="refreshFreqLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestTopComponent.refreshFreqLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JProgressBar" name="imageProgressBar">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="imageProgressLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestTopComponent.imageProgressLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JProgressBar" name="jProgressBar1">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="fileProgressLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/ingest/Bundle.properties" key="IngestTopComponent.fileProgressLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
332
Ingest/src/org/sleuthkit/autopsy/ingest/IngestTopComponent.java
Normal file
332
Ingest/src/org/sleuthkit/autopsy/ingest/IngestTopComponent.java
Normal file
@ -0,0 +1,332 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2011 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.sleuthkit.autopsy.ingest;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.beans.PropertyChangeEvent;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javax.swing.BoxLayout;
|
||||||
|
import javax.swing.JCheckBox;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JSlider;
|
||||||
|
import org.openide.util.NbBundle;
|
||||||
|
import org.openide.windows.TopComponent;
|
||||||
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Top component explorer for the Ingest module.
|
||||||
|
*/
|
||||||
|
public final class IngestTopComponent extends TopComponent implements DataExplorer {
|
||||||
|
|
||||||
|
private static IngestTopComponent instance;
|
||||||
|
private static final Logger logger = Logger.getLogger(IngestTopComponent.class.getName());
|
||||||
|
private IngestManager manager = null;
|
||||||
|
private Collection<IngestServiceAbstract> services;
|
||||||
|
private Map<String, Boolean> serviceStates;
|
||||||
|
private ActionListener serviceSelListener = new ActionListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent ev) {
|
||||||
|
JCheckBox box = (JCheckBox) ev.getSource();
|
||||||
|
serviceStates.put(box.getName(), box.isSelected());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private IngestTopComponent() {
|
||||||
|
manager = new IngestManager(this);
|
||||||
|
services = new ArrayList<IngestServiceAbstract>();
|
||||||
|
serviceStates = new HashMap<String, Boolean>();
|
||||||
|
initComponents();
|
||||||
|
customizeComponents();
|
||||||
|
setName(NbBundle.getMessage(IngestTopComponent.class, "CTL_IngestTopComponent"));
|
||||||
|
setToolTipText(NbBundle.getMessage(IngestTopComponent.class, "HINT_IngestTopComponent"));
|
||||||
|
//putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE);
|
||||||
|
putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static synchronized IngestTopComponent getDefault() {
|
||||||
|
if (instance == null) {
|
||||||
|
instance = new IngestTopComponent();
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TopComponent getTopComponent() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void propertyChange(PropertyChangeEvent evt) {
|
||||||
|
logger.log(Level.INFO, "Unhandled property change: " + evt.getPropertyName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPersistenceType() {
|
||||||
|
return TopComponent.PERSISTENCE_NEVER;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void customizeComponents() {
|
||||||
|
//custom GUI setup not done by builder
|
||||||
|
freqSlider.setToolTipText("Lower update frequency can optimize performance of certain ingest services, but also reduce real time status feedback");
|
||||||
|
|
||||||
|
JScrollPane scrollPane = new JScrollPane(servicesPanel);
|
||||||
|
scrollPane.setPreferredSize(this.getSize());
|
||||||
|
this.add(scrollPane, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
servicesPanel.setLayout(new BoxLayout(servicesPanel, BoxLayout.Y_AXIS));
|
||||||
|
|
||||||
|
Collection<IngestServiceImage> imageServices = IngestManager.enumerateImageServices();
|
||||||
|
for (IngestServiceImage service : imageServices) {
|
||||||
|
services.add(service);
|
||||||
|
JCheckBox checkbox = new JCheckBox(service.getName(), true);
|
||||||
|
checkbox.addActionListener(serviceSelListener);
|
||||||
|
servicesPanel.add(checkbox);
|
||||||
|
}
|
||||||
|
|
||||||
|
Collection<IngestServiceFsContent> fsServices = IngestManager.enumerateFsContentServices();
|
||||||
|
for (IngestServiceFsContent service : fsServices) {
|
||||||
|
services.add(service);
|
||||||
|
JCheckBox checkbox = new JCheckBox(service.getName(), true);
|
||||||
|
checkbox.addActionListener(serviceSelListener);
|
||||||
|
servicesPanel.add(checkbox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** This method is called from within the constructor to
|
||||||
|
* initialize the form.
|
||||||
|
* WARNING: Do NOT modify this code. The content of this method is
|
||||||
|
* always regenerated by the Form Editor.
|
||||||
|
*/
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
mainScrollPane = new javax.swing.JScrollPane();
|
||||||
|
mainPanel = new javax.swing.JPanel();
|
||||||
|
topLable = new javax.swing.JLabel();
|
||||||
|
servicesPanel = new javax.swing.JPanel();
|
||||||
|
freqSlider = new javax.swing.JSlider();
|
||||||
|
startButton = new javax.swing.JButton();
|
||||||
|
refreshFreqLabel = new javax.swing.JLabel();
|
||||||
|
imageProgressBar = new javax.swing.JProgressBar();
|
||||||
|
imageProgressLabel = new javax.swing.JLabel();
|
||||||
|
jProgressBar1 = new javax.swing.JProgressBar();
|
||||||
|
fileProgressLabel = new javax.swing.JLabel();
|
||||||
|
|
||||||
|
mainScrollPane.setPreferredSize(new java.awt.Dimension(289, 509));
|
||||||
|
|
||||||
|
topLable.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(topLable, org.openide.util.NbBundle.getMessage(IngestTopComponent.class, "IngestTopComponent.topLable.text")); // NOI18N
|
||||||
|
|
||||||
|
servicesPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
|
||||||
|
servicesPanel.setMinimumSize(new java.awt.Dimension(200, 150));
|
||||||
|
servicesPanel.setPreferredSize(new java.awt.Dimension(200, 150));
|
||||||
|
|
||||||
|
javax.swing.GroupLayout servicesPanelLayout = new javax.swing.GroupLayout(servicesPanel);
|
||||||
|
servicesPanel.setLayout(servicesPanelLayout);
|
||||||
|
servicesPanelLayout.setHorizontalGroup(
|
||||||
|
servicesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGap(0, 198, Short.MAX_VALUE)
|
||||||
|
);
|
||||||
|
servicesPanelLayout.setVerticalGroup(
|
||||||
|
servicesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGap(0, 148, Short.MAX_VALUE)
|
||||||
|
);
|
||||||
|
|
||||||
|
freqSlider.setMajorTickSpacing(1);
|
||||||
|
freqSlider.setMaximum(10);
|
||||||
|
freqSlider.setMinimum(1);
|
||||||
|
freqSlider.setPaintLabels(true);
|
||||||
|
freqSlider.setPaintTicks(true);
|
||||||
|
freqSlider.setSnapToTicks(true);
|
||||||
|
freqSlider.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||||
|
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||||
|
freqSliderStateChanged(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(startButton, org.openide.util.NbBundle.getMessage(IngestTopComponent.class, "IngestTopComponent.startButton.text")); // NOI18N
|
||||||
|
startButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
startButtonActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(refreshFreqLabel, org.openide.util.NbBundle.getMessage(IngestTopComponent.class, "IngestTopComponent.refreshFreqLabel.text")); // NOI18N
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(imageProgressLabel, org.openide.util.NbBundle.getMessage(IngestTopComponent.class, "IngestTopComponent.imageProgressLabel.text")); // NOI18N
|
||||||
|
|
||||||
|
org.openide.awt.Mnemonics.setLocalizedText(fileProgressLabel, org.openide.util.NbBundle.getMessage(IngestTopComponent.class, "IngestTopComponent.fileProgressLabel.text")); // NOI18N
|
||||||
|
|
||||||
|
javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
|
||||||
|
mainPanel.setLayout(mainPanelLayout);
|
||||||
|
mainPanelLayout.setHorizontalGroup(
|
||||||
|
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, mainPanelLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(topLable))
|
||||||
|
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, mainPanelLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||||
|
.addComponent(jProgressBar1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(imageProgressBar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(servicesPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
|
.addComponent(freqSlider, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||||
|
.addGap(173, 173, 173))
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addComponent(startButton)
|
||||||
|
.addContainerGap(316, Short.MAX_VALUE))
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addGap(81, 81, 81)
|
||||||
|
.addComponent(imageProgressLabel)
|
||||||
|
.addContainerGap(227, Short.MAX_VALUE))
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addGap(74, 74, 74)
|
||||||
|
.addComponent(refreshFreqLabel)
|
||||||
|
.addContainerGap(219, Short.MAX_VALUE))
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addGap(84, 84, 84)
|
||||||
|
.addComponent(fileProgressLabel)
|
||||||
|
.addContainerGap(238, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
mainPanelLayout.setVerticalGroup(
|
||||||
|
mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(mainPanelLayout.createSequentialGroup()
|
||||||
|
.addGap(24, 24, 24)
|
||||||
|
.addComponent(topLable)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
|
.addComponent(servicesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(startButton)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(freqSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(refreshFreqLabel)
|
||||||
|
.addGap(28, 28, 28)
|
||||||
|
.addComponent(imageProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(imageProgressLabel)
|
||||||
|
.addGap(27, 27, 27)
|
||||||
|
.addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(fileProgressLabel)
|
||||||
|
.addContainerGap(75, Short.MAX_VALUE))
|
||||||
|
);
|
||||||
|
|
||||||
|
mainScrollPane.setViewportView(mainPanel);
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
|
this.setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 289, Short.MAX_VALUE)
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(mainScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 509, Short.MAX_VALUE)
|
||||||
|
);
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void startButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startButtonActionPerformed
|
||||||
|
//pick the services
|
||||||
|
List<IngestServiceAbstract>servicesToStart = new ArrayList<IngestServiceAbstract>();
|
||||||
|
for (IngestServiceAbstract service : services) {
|
||||||
|
boolean serviceEnabled = serviceStates.get(service.getName());
|
||||||
|
if (serviceEnabled)
|
||||||
|
servicesToStart.add(service);
|
||||||
|
}
|
||||||
|
|
||||||
|
//pick the image
|
||||||
|
//TODO which image ? just enqueue all, and manager will skip already processed image
|
||||||
|
|
||||||
|
manager.execute(services, null);
|
||||||
|
}//GEN-LAST:event_startButtonActionPerformed
|
||||||
|
|
||||||
|
private void freqSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_freqSliderStateChanged
|
||||||
|
JSlider source = (JSlider) evt.getSource();
|
||||||
|
if (!source.getValueIsAdjusting()) {
|
||||||
|
final int refresh = (int) source.getValue();
|
||||||
|
manager.setUpdateFrequency(refresh);
|
||||||
|
|
||||||
|
}
|
||||||
|
}//GEN-LAST:event_freqSliderStateChanged
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JLabel fileProgressLabel;
|
||||||
|
private javax.swing.JSlider freqSlider;
|
||||||
|
private javax.swing.JProgressBar imageProgressBar;
|
||||||
|
private javax.swing.JLabel imageProgressLabel;
|
||||||
|
private javax.swing.JProgressBar jProgressBar1;
|
||||||
|
private javax.swing.JPanel mainPanel;
|
||||||
|
private javax.swing.JScrollPane mainScrollPane;
|
||||||
|
private javax.swing.JLabel refreshFreqLabel;
|
||||||
|
private javax.swing.JPanel servicesPanel;
|
||||||
|
private javax.swing.JButton startButton;
|
||||||
|
private javax.swing.JLabel topLable;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void componentOpened() {
|
||||||
|
logger.log(Level.INFO, "IngestTopComponent opened()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void componentClosed() {
|
||||||
|
logger.log(Level.INFO, "IngestTopComponent closed()");
|
||||||
|
}
|
||||||
|
|
||||||
|
void writeProperties(java.util.Properties p) {
|
||||||
|
// better to version settings since initial version as advocated at
|
||||||
|
// http://wiki.apidesign.org/wiki/PropertyFiles
|
||||||
|
p.setProperty("version", "1.0");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void readProperties(java.util.Properties p) {
|
||||||
|
String version = p.getProperty("version");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display ingest summary report in some dialog
|
||||||
|
*/
|
||||||
|
void displayReport(String ingestReport) {
|
||||||
|
//TODO widget
|
||||||
|
logger.log(Level.INFO, "INGEST REPORT: " + ingestReport);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display IngestMessage from service (forwarded by IngestManager)
|
||||||
|
*/
|
||||||
|
void displayMessage(IngestMessage ingestMessage) {
|
||||||
|
//TODO widget
|
||||||
|
logger.log(Level.INFO, "INGEST MESSAGE: " + ingestMessage.toString());
|
||||||
|
}
|
||||||
|
}
|
11
Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml
Normal file
11
Ingest/src/org/sleuthkit/autopsy/ingest/layer.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
|
||||||
|
<filesystem>
|
||||||
|
<folder name="Services">
|
||||||
|
<file name="org-sleuthkit-autopsy-ingest-IngestTopComponent.instance">
|
||||||
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer"/>
|
||||||
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.ingest.IngestTopComponent.getDefault"/>
|
||||||
|
<attr name="position" intvalue="300"/>
|
||||||
|
</file>
|
||||||
|
</folder>
|
||||||
|
</filesystem>
|
@ -3,6 +3,6 @@ build.xml.script.CRC32=87b97b04
|
|||||||
build.xml.stylesheet.CRC32=a56c6a5b@1.46.2
|
build.xml.stylesheet.CRC32=a56c6a5b@1.46.2
|
||||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
nbproject/build-impl.xml.data.CRC32=957d4757
|
nbproject/build-impl.xml.data.CRC32=d7ecf067
|
||||||
nbproject/build-impl.xml.script.CRC32=fe1f48d2
|
nbproject/build-impl.xml.script.CRC32=fe1f48d2
|
||||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.47.1
|
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.2
|
||||||
|
@ -117,6 +117,15 @@
|
|||||||
<specification-version>1.0</specification-version>
|
<specification-version>1.0</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<code-name-base>org.sleuthkit.autopsy.ingest</code-name-base>
|
||||||
|
<build-prerequisite/>
|
||||||
|
<compile-dependency/>
|
||||||
|
<run-dependency>
|
||||||
|
<release-version>0-1</release-version>
|
||||||
|
<specification-version>1.0</specification-version>
|
||||||
|
</run-dependency>
|
||||||
|
</dependency>
|
||||||
</module-dependencies>
|
</module-dependencies>
|
||||||
<public-packages>
|
<public-packages>
|
||||||
<package>org.sleuthkit.autopsy.keywordsearch</package>
|
<package>org.sleuthkit.autopsy.keywordsearch</package>
|
||||||
|
@ -32,15 +32,13 @@ import org.sleuthkit.autopsy.keywordsearch.KeywordSearchQueryManager.Presentatio
|
|||||||
/**
|
/**
|
||||||
* Provides a data explorer to perform Solr searches with
|
* Provides a data explorer to perform Solr searches with
|
||||||
*/
|
*/
|
||||||
@ServiceProvider(service = DataExplorer.class, position = 300)
|
|
||||||
public class KeywordSearchDataExplorer implements DataExplorer {
|
public class KeywordSearchDataExplorer implements DataExplorer {
|
||||||
|
|
||||||
private static KeywordSearchDataExplorer theInstance;
|
private static KeywordSearchDataExplorer theInstance = null;
|
||||||
private KeywordSearchTabsTopComponent tc;
|
private KeywordSearchTabsTopComponent tc;
|
||||||
private int filesIndexed;
|
private int filesIndexed;
|
||||||
|
|
||||||
public KeywordSearchDataExplorer() {
|
private KeywordSearchDataExplorer() {
|
||||||
this.setTheInstance();
|
|
||||||
this.filesIndexed = 0;
|
this.filesIndexed = 0;
|
||||||
this.tc = new KeywordSearchTabsTopComponent();
|
this.tc = new KeywordSearchTabsTopComponent();
|
||||||
|
|
||||||
@ -64,12 +62,11 @@ public class KeywordSearchDataExplorer implements DataExplorer {
|
|||||||
KeywordSearch.changeSupport.addPropertyChangeListener(KeywordSearch.NUM_FILES_CHANGE_EVT, new IndexChangeListener());
|
KeywordSearch.changeSupport.addPropertyChangeListener(KeywordSearch.NUM_FILES_CHANGE_EVT, new IndexChangeListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void setTheInstance() {
|
public static synchronized KeywordSearchDataExplorer getDefault() {
|
||||||
if (theInstance == null) {
|
if (theInstance == null) {
|
||||||
theInstance = this;
|
theInstance = new KeywordSearchDataExplorer();
|
||||||
} else {
|
|
||||||
throw new RuntimeException("Tried to instantiate mulitple instances of KeywordSearchTopComponent.");
|
|
||||||
}
|
}
|
||||||
|
return theInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2011 Basis Technology Corp.
|
||||||
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package org.sleuthkit.autopsy.keywordsearch;
|
||||||
|
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
|
import org.sleuthkit.autopsy.ingest.IngestServiceFsContent;
|
||||||
|
import org.sleuthkit.datamodel.FsContent;
|
||||||
|
|
||||||
|
//service provider registered in layer.xml
|
||||||
|
public final class KeywordSearchIngestService implements IngestServiceFsContent {
|
||||||
|
|
||||||
|
private static final Logger logger = Logger.getLogger(KeywordSearchIngestService.class.getName());
|
||||||
|
private static KeywordSearchIngestService instance = null;
|
||||||
|
|
||||||
|
public static synchronized KeywordSearchIngestService getDefault() {
|
||||||
|
if (instance == null) {
|
||||||
|
instance = new KeywordSearchIngestService();
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void process(FsContent fsContent) {
|
||||||
|
logger.log(Level.INFO, "Processing fsContent: " + fsContent.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void complete() {
|
||||||
|
logger.log(Level.INFO, "complete()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "Keyword Search";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(IngestManager manager) {
|
||||||
|
logger.log(Level.INFO, "init()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void stop() {
|
||||||
|
logger.log(Level.INFO, "stop()");
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
|
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.2//EN" "http://www.netbeans.org/dtds/filesystem-1_2.dtd">
|
||||||
<filesystem/>
|
<filesystem>
|
||||||
|
<folder name="Services">
|
||||||
|
<file name="org-sleuthkit-autopsy-keywordsearch-KeywordSearchIngestService.instance">
|
||||||
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.ingest.IngestServiceFsContent"/>
|
||||||
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.keywordsearch.KeywordSearchIngestService.getDefault"/>
|
||||||
|
<attr name="position" intvalue="200"/>
|
||||||
|
</file>
|
||||||
|
<file name="org-sleuthkit-autopsy-keywordsearch-KeywordSearchDataExplorer.instance">
|
||||||
|
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer"/>
|
||||||
|
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.keywordsearch.KeywordSearchDataExplorer.getDefault"/>
|
||||||
|
<attr name="position" intvalue="300"/>
|
||||||
|
</file>
|
||||||
|
</folder>
|
||||||
|
</filesystem>
|
||||||
|
@ -18,13 +18,15 @@ modules=\
|
|||||||
${project.org.sleuthkit.autopsy.datamodel}:\
|
${project.org.sleuthkit.autopsy.datamodel}:\
|
||||||
${project.org.sleuthkit.autopsy.casemodule}:\
|
${project.org.sleuthkit.autopsy.casemodule}:\
|
||||||
${project.org.sleuthkit.autopsy.keywordsearch}:\
|
${project.org.sleuthkit.autopsy.keywordsearch}:\
|
||||||
${project.org.sleuthkit.autopsy.coreutils}
|
${project.org.sleuthkit.autopsy.coreutils}:\
|
||||||
|
${project.org.sleuthkit.autopsy.ingest}
|
||||||
project.org.sleuthkit.autopsy.casemodule=Case
|
project.org.sleuthkit.autopsy.casemodule=Case
|
||||||
project.org.sleuthkit.autopsy.corecomponentinterfaces=CoreComponentInterfaces
|
project.org.sleuthkit.autopsy.corecomponentinterfaces=CoreComponentInterfaces
|
||||||
project.org.sleuthkit.autopsy.corecomponents=CoreComponents
|
project.org.sleuthkit.autopsy.corecomponents=CoreComponents
|
||||||
project.org.sleuthkit.autopsy.coreutils=CoreUtils
|
project.org.sleuthkit.autopsy.coreutils=CoreUtils
|
||||||
project.org.sleuthkit.autopsy.directorytree=DirectoryTree
|
project.org.sleuthkit.autopsy.directorytree=DirectoryTree
|
||||||
project.org.sleuthkit.autopsy.filesearch=FileSearch
|
project.org.sleuthkit.autopsy.filesearch=FileSearch
|
||||||
|
project.org.sleuthkit.autopsy.ingest=Ingest
|
||||||
project.org.sleuthkit.autopsy.keywordsearch=KeywordSearch
|
project.org.sleuthkit.autopsy.keywordsearch=KeywordSearch
|
||||||
project.org.sleuthkit.autopsy.menuactions=MenuActions
|
project.org.sleuthkit.autopsy.menuactions=MenuActions
|
||||||
project.org.sleuthkit.autopsy.datamodel=DataModel
|
project.org.sleuthkit.autopsy.datamodel=DataModel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user