Merge pull request #460 from mrtizmo/develop

KeywordSearch Module Japanese Localization
This commit is contained in:
Richard Cordovano 2014-01-28 10:59:05 -08:00
commit c5ef9523d6
203 changed files with 2906 additions and 1752 deletions

1
.gitignore vendored
View File

@ -36,7 +36,6 @@
!/Ingest/nbproject/project.properties
/branding_spear
/installer_spear
Bundle_*.properties
*/genfiles.properties
genfiles.properties
/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties

View File

@ -26,7 +26,7 @@ import org.sleuthkit.datamodel.BlackboardArtifact;
/**
* Abstract base class for Actions involving tags.
*/
public abstract class TagAction extends AbstractAction {
abstract class TagAction extends AbstractAction {
public TagAction(String menuText) {
super(menuText);
}

View File

@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.casemodule;
/**
* Dialog to show add image error messages
*/
public class AddImageErrorsDialog extends javax.swing.JDialog {
class AddImageErrorsDialog extends javax.swing.JDialog {
/**
* Creates new form AddImageErrorsDialog

View File

@ -43,7 +43,7 @@ import org.sleuthkit.datamodel.TskException;
* It updates the given ProgressMonitor as it works through adding the image,
* and et the end, calls the specified Callback.
*/
public class AddImageTask implements Runnable {
class AddImageTask implements Runnable {
private Logger logger = Logger.getLogger(AddImageTask.class.getName());

View File

@ -28,7 +28,7 @@ import org.openide.WizardDescriptor;
* visual component to display progress bar and status updates while adding an
* image in the wizard
*/
public class AddImageWizardAddingProgressVisual extends javax.swing.JPanel {
class AddImageWizardAddingProgressVisual extends javax.swing.JPanel {
private static final String ADDING_DATA_SOURCE_COMPLETE = "Adding Data Source - Complete";
private String errorLog = "";

View File

@ -27,7 +27,7 @@ import javax.swing.JPanel;
*
*
*/
public class AddImageWizardIngestConfigVisual extends javax.swing.JPanel {
class AddImageWizardIngestConfigVisual extends javax.swing.JPanel {
//could this be something more specific than JPanel? - jm
private JPanel ingestPanel = null;

View File

@ -40,7 +40,7 @@ import org.sleuthkit.datamodel.TskCoreException;
* manager methods acquire the locks for each transaction when adding
* logical files.
*/
public class AddLocalFilesTask implements Runnable {
class AddLocalFilesTask implements Runnable {
private Logger logger = Logger.getLogger(AddLocalFilesTask.class.getName());

View File

@ -19,7 +19,8 @@
package org.sleuthkit.autopsy.casemodule;
/**
* Exception thrown when case action (such as open, close, create) resulted in an error
* Exception thrown when case action (such as open, close, create) resulted in
* an error
*/
public class CaseActionException extends Exception {
@ -30,6 +31,4 @@ public class CaseActionException extends Exception {
public CaseActionException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -45,7 +45,7 @@ import org.openide.util.actions.Presenter;
* The action to close the current Case. This class should be disabled on
* creation and it will be enabled on new case creation or case opened.
*/
public final class CaseCloseAction extends CallableSystemAction implements Presenter.Toolbar{
final class CaseCloseAction extends CallableSystemAction implements Presenter.Toolbar{
JButton toolbarButton = new JButton();

View File

@ -66,7 +66,7 @@ import org.openide.util.actions.CallableSystemAction;
* The action to delete the current Case. This class should be disabled on
* creation and it will be enabled on new case creation or case opened.
*/
public final class CaseDeleteAction extends CallableSystemAction {
final class CaseDeleteAction extends CallableSystemAction {
private JPanel caller; // for error handling

View File

@ -25,6 +25,6 @@ import java.awt.event.ActionListener;
/**
*
*/
public interface CaseNewActionInterface extends ActionListener {
interface CaseNewActionInterface extends ActionListener {
}

View File

@ -40,7 +40,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
*
* @author jantonius
*/
public final class CasePropertiesAction extends CallableSystemAction {
final class CasePropertiesAction extends CallableSystemAction {
private static JDialog popUpWindow;

View File

@ -33,7 +33,7 @@ import org.openide.util.Lookup;
/**
*
*/
public class CueBannerPanel extends javax.swing.JPanel {
class CueBannerPanel extends javax.swing.JPanel {
final private static String title = "Open Recent Case";
final private static JFrame frame = new JFrame(title);

View File

@ -47,7 +47,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil;
/**
* ImageTypePanel for adding a local disk or partition such as PhysicalDrive0 or C:.
*/
public class LocalDiskPanel extends JPanel {
class LocalDiskPanel extends JPanel {
private static final Logger logger = Logger.getLogger(LocalDiskPanel.class.getName());
private static LocalDiskPanel instance;

View File

@ -30,7 +30,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessor;
/**
* Add input wizard subpanel for adding local files / dirs to the case
*/
public class LocalFilesPanel extends JPanel {
class LocalFilesPanel extends JPanel {
private PropertyChangeSupport pcs = null;
private Set<File> currentFiles = new TreeSet<File>(); //keep currents in a set to disallow duplicates per add

View File

@ -39,7 +39,7 @@ import org.sleuthkit.datamodel.TskCoreException;
public class MissingImageDialog extends javax.swing.JDialog {
class MissingImageDialog extends javax.swing.JDialog {
private static final Logger logger = Logger.getLogger(MissingImageDialog.class.getName());
long obj_id;
SleuthkitCase db;

View File

@ -28,7 +28,7 @@ package org.sleuthkit.autopsy.casemodule;
*
* @author dfickling
*/
public class NewCaseVisualPanel2 extends javax.swing.JPanel {
class NewCaseVisualPanel2 extends javax.swing.JPanel {
/** Creates new form NewCaseVisualPanel2 */
public NewCaseVisualPanel2() {

View File

@ -38,7 +38,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
/**
* Action to open the New Case wizard.
*/
public final class NewCaseWizardAction extends CallableSystemAction {
final class NewCaseWizardAction extends CallableSystemAction {
private WizardDescriptor.Panel<WizardDescriptor>[] panels;

View File

@ -43,7 +43,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
* The constructor is called when the autopsy is running.
* All the method to create and modify the properties file are within this class
*/
public final class RecentCases extends CallableSystemAction implements Presenter.Menu {
final class RecentCases extends CallableSystemAction implements Presenter.Menu {
static final int LENGTH = 5;
static final String NAME_PROP_KEY = "LBL_RecentCase_Name";

View File

@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.casemodule;
/**
* Interface for startup window implementations
*/
public interface StartupWindowInterface {
interface StartupWindowInterface {
/**
* Shows and makes active the startup window

View File

@ -32,7 +32,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
* is to implement StartupWindowInterface and register it with lookup as a ServiceProvider.
* The custom startup window is automatically chosen over the default one, given it is the only external module custom startup window.
*/
public class StartupWindowProvider implements StartupWindowInterface {
class StartupWindowProvider implements StartupWindowInterface {
private static volatile StartupWindowProvider instance;
private static final Logger logger = Logger.getLogger(StartupWindowProvider.class.getName());

View File

@ -28,7 +28,7 @@ import org.openide.util.actions.SystemAction;
/**
* This class is used to change / update the list of recent cases dynamically.
*/
public class UpdateRecentCases extends JMenuItem implements DynamicMenuContent {
class UpdateRecentCases extends JMenuItem implements DynamicMenuContent {
int length;
static boolean hasRecentCase = false;

View File

@ -45,7 +45,7 @@ import org.xml.sax.SAXException;
*
* @author jantonius
*/
public class XMLCaseManagement implements CaseConfigFileInterface {
class XMLCaseManagement implements CaseConfigFileInterface {
final static String XSDFILE = "CaseSchema.xsd";
final static String TOP_ROOT_NAME = "AutopsyCase";

View File

@ -36,7 +36,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
* Additionally, the ExplorerManager.Provider interface is implemented to
* supply an ExplorerManager to derived classes and their child components.
*/
public abstract class AbstractDataResultViewer extends JPanel implements DataResultViewer, Provider {
abstract class AbstractDataResultViewer extends JPanel implements DataResultViewer, Provider {
private static final Logger logger = Logger.getLogger(AbstractDataResultViewer.class.getName());
protected transient ExplorerManager em;

View File

@ -28,7 +28,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
/**
* Action to open custom implementation of the "About" window from the Help menu.
*/
public class CustomAboutAction extends AboutAction {
class CustomAboutAction extends AboutAction {
@Override
public void performAction() {

View File

@ -55,7 +55,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
// service provider when DataResultViewers can be made compatible with node
// multiple selection actions.
//@ServiceProvider(service = DataResultViewer.class)
public class DataResultViewerTable extends AbstractDataResultViewer {
class DataResultViewerTable extends AbstractDataResultViewer {
private String firstColumnLabel = "Name";
private Set<Property> propertiesAcc = new LinkedHashSet<>();

View File

@ -57,7 +57,7 @@ import org.sleuthkit.datamodel.TskCoreException;
// service provider when DataResultViewers can be made compatible with node
// multi-selection actions.
//@ServiceProvider(service = DataResultViewer.class)
public final class DataResultViewerThumbnail extends AbstractDataResultViewer {
final class DataResultViewerThumbnail extends AbstractDataResultViewer {
private static final Logger logger = Logger.getLogger(DataResultViewerThumbnail.class.getName());
//flag to keep track if images are being loaded

View File

@ -6,7 +6,7 @@ import java.util.List;
/**
* Interface used to capture frames from a video file.
*/
public interface FrameCapture {
interface FrameCapture {
/**
* @param file the video file to use

View File

@ -43,7 +43,7 @@ import org.sleuthkit.datamodel.SleuthkitJNI;
/**
* Custom "About" window panel.
*/
public class ProductInformationPanel extends JPanel implements HyperlinkListener {
class ProductInformationPanel extends JPanel implements HyperlinkListener {
private URL url = null;
private Icon about;

View File

@ -5,7 +5,7 @@ import java.awt.Image;
/**
*
*/
public class VideoFrame {
class VideoFrame {
private Image frame;
private long timeMillis;

View File

@ -27,15 +27,19 @@ import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.contentviewers.Utilities;
import org.sleuthkit.autopsy.corelibs.ScalrWrapper;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute;
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.ReadContentInputStream;
import org.sleuthkit.datamodel.TskCoreException;
@ -51,7 +55,7 @@ public class ImageUtils {
private static final Logger logger = Logger.getLogger(ImageUtils.class.getName());
private static final Image DEFAULT_ICON = new ImageIcon("/org/sleuthkit/autopsy/images/file-icon.png").getImage();
private static final List<String> SUPP_EXTENSIONS = Arrays.asList(ImageIO.getReaderFileSuffixes());
private static final List<String> SUPP_MIME_TYPES = Arrays.asList(ImageIO.getReaderMIMETypes());
/**
* Get the default Icon, which is the icon for a file.
* @return
@ -72,18 +76,37 @@ public class ImageUtils {
}
AbstractFile f = (AbstractFile) content;
final String fName = f.getName();
final int dotIdx = fName.lastIndexOf('.');
if (dotIdx == -1 || dotIdx == (fName.length() - 1)) {
if (f.getSize() == 0) {
return false;
}
// check the blackboard for a file type attribute
try {
ArrayList <BlackboardAttribute> attributes = f.getGenInfoAttributes(ATTRIBUTE_TYPE.TSK_FILE_TYPE_SIG);
for (BlackboardAttribute attribute : attributes) {
if (SUPP_MIME_TYPES.contains(attribute.getValueString())) {
return true;
}
}
}
catch (TskCoreException ex) {
logger.log(Level.WARNING, "Error while getting file signature from blackboard.", ex);
}
final String extension = f.getNameExtension();
// if we have an extension, check it
if (extension.equals("") == false) {
// Note: thumbnail generator only supports JPG, GIF, and PNG for now
if (SUPP_EXTENSIONS.contains(extension)) {
return true;
}
}
// if no extension or one that is not for an image, then read the content
return isJpegFileHeader(f);
}
final String ext = fName.substring(dotIdx + 1).toLowerCase();
// Note: thumbnail generator only supports JPG, GIF, and PNG for now
return (f.getSize() > 0
&& SUPP_EXTENSIONS.contains(ext));
}
/**
* Get an icon of a specified size.

View File

@ -22,7 +22,7 @@ package org.sleuthkit.autopsy.coreutils;
*
* @author dick
*/
public class LnkEnums {
class LnkEnums {
private static final byte[] CDRIVES = new byte[] { (byte)0xe0, 0x4f, (byte)0xd0, 0x20,
(byte)0xea, 0x3a, 0x69, 0x10, (byte)0xa2, (byte)0xd8, 0x08, 0x00, 0x2b, 0x30, 0x30, (byte)0x9d };

View File

@ -28,7 +28,7 @@ import java.util.logging.Level;
/*
* Toolbar button for testing logging. Not a normal part of application.
*/
public final class TestLogger implements ActionListener {
final class TestLogger implements ActionListener {
static final Logger logger = Logger.getLogger(TestLogger.class.getName());
Formatter fmt;

View File

@ -30,7 +30,7 @@ import java.util.logging.LogRecord;
* Formatter to wrap another formatter and prepend a timestampe to each formatted string
* Not currently used.
*/
public class TimestampingFormatter extends Formatter {
class TimestampingFormatter extends Formatter {
Formatter original;
DateFormat timestampFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, Locale.US);

View File

@ -22,7 +22,7 @@ package org.sleuthkit.autopsy.datamodel;
*
* @author dfickling
*/
public interface AutopsyItemVisitor<T> {
interface AutopsyItemVisitor<T> {
T visit(ExtractedContent ec);

View File

@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.datamodel;
/**
* Abstraction for certain top level items displayed in the GUI
*/
public interface AutopsyVisitableItem {
interface AutopsyVisitableItem {
/**
* visitor pattern support

View File

@ -38,7 +38,7 @@ import org.sleuthkit.datamodel.VolumeSystem;
* past subclasses that aren't part of the exposed hierarchy (VolumeSystem,
* FileSystem, and root Directories)
*/
public class ContentHierarchyVisitor extends ContentVisitor.Default<List<? extends Content>> {
class ContentHierarchyVisitor extends ContentVisitor.Default<List<? extends Content>> {
private static final Logger logger = Logger.getLogger(ContentHierarchyVisitor.class.getName());
private static final ContentHierarchyVisitor INSTANCE = new ContentHierarchyVisitor();

View File

@ -38,7 +38,7 @@ import org.sleuthkit.datamodel.VolumeSystem;
* past subclasses that aren't part of the exposed hierarchy (VolumeSystem,
* FileSystem, and root Directories)
*/
public class ContentIdHierarchyVisitor extends ContentVisitor.Default<List<? extends Long>> {
class ContentIdHierarchyVisitor extends ContentVisitor.Default<List<? extends Long>> {
private static final Logger logger = Logger.getLogger(ContentHierarchyVisitor.class.getName());
private static final ContentIdHierarchyVisitor INSTANCE = new ContentIdHierarchyVisitor();

View File

@ -26,7 +26,7 @@ import org.openide.util.Lookup;
* Provides basic information such as ID, parent ID, etc.
*/
public abstract class ContentNode extends DisplayableItemNode{
abstract class ContentNode extends DisplayableItemNode{
public ContentNode(Children children) {
super(children);

View File

@ -22,7 +22,7 @@ package org.sleuthkit.autopsy.datamodel;
* Interface for visitor pattern on ContentNodes
* @param <T> visit method return type
*/
public interface ContentNodeVisitor<T> {
interface ContentNodeVisitor<T> {
T visit(DirectoryNode dn);

View File

@ -36,7 +36,7 @@ import org.sleuthkit.datamodel.TskCoreException;
* consisting of content and blackboard artifact tags, grouped first by tag
* type, then by tag name.
*/
public class ContentTagNode extends DisplayableItemNode {
class ContentTagNode extends DisplayableItemNode {
private static final String ICON_PATH = "org/sleuthkit/autopsy/images/blue-tag-icon-16.png";
private final ContentTag tag;

View File

@ -24,7 +24,7 @@ import org.sleuthkit.datamodel.SleuthkitCase;
* Parent of the "extracted content" artifacts to be displayed in the tree. Other
* artifacts are displayed under other more specific parents.
*/
public class ExtractedContent implements AutopsyVisitableItem{
class ExtractedContent implements AutopsyVisitableItem{
SleuthkitCase skCase;

View File

@ -37,7 +37,7 @@ import org.sleuthkit.datamodel.TskCoreException;
* has all of the blackboard artifacts that are not displayed in a more specific form elsewhere
* in the tree.
*/
public class ExtractedContentChildren extends ChildFactory<BlackboardArtifact.ARTIFACT_TYPE> {
class ExtractedContentChildren extends ChildFactory<BlackboardArtifact.ARTIFACT_TYPE> {
private SleuthkitCase skCase;
private final ArrayList<BlackboardArtifact.ARTIFACT_TYPE> doNotShow;

View File

@ -25,7 +25,7 @@ import org.sleuthkit.datamodel.SleuthkitCase;
/**
* Filters database results by file extension.
*/
public class FileTypeExtensionFilters implements AutopsyVisitableItem {
class FileTypeExtensionFilters implements AutopsyVisitableItem {
private SleuthkitCase skCase;

View File

@ -25,7 +25,7 @@ import java.util.List;
* Contains Lists of commonly known and used file type extensions
* and 'getters' to obtain them.
*/
public class FileTypeExtensions {
class FileTypeExtensions {
private final static List<String> IMAGE_EXTENSIONS = Arrays.asList(".jpg", ".jpeg", ".png", ".psd", ".nef", ".tiff", ".bmp");
private final static List<String> VIDEO_EXTENSIONS = Arrays.asList(".aaf", ".3gp", ".asf", ".avi", ".m1v", ".m2v",
".m4v", ".mp4", ".mov", ".mpeg", ".mpg", ".mpe", ".mp4", ".rm", ".wmv", ".mpv", ".flv", ".swf");

View File

@ -23,7 +23,7 @@ import org.sleuthkit.datamodel.SleuthkitCase;
/**
* Recent files node support
*/
public class RecentFiles implements AutopsyVisitableItem {
class RecentFiles implements AutopsyVisitableItem {
SleuthkitCase skCase;

View File

@ -34,7 +34,7 @@ import org.sleuthkit.datamodel.SleuthkitCase;
*
* @author dfickling
*/
public class RecentFilesChildren extends ChildFactory<RecentFiles.RecentFilesFilter> {
class RecentFilesChildren extends ChildFactory<RecentFiles.RecentFilesFilter> {
private SleuthkitCase skCase;
private Calendar lastDay;

View File

@ -42,7 +42,7 @@ import org.sleuthkit.datamodel.TskData;
*
* @author dfickling
*/
public class RecentFilesFilterChildren extends ChildFactory<Content> {
class RecentFilesFilterChildren extends ChildFactory<Content> {
private SleuthkitCase skCase;
private RecentFilesFilter filter;

View File

@ -36,7 +36,7 @@ import org.sleuthkit.datamodel.TskCoreException;
* content and blackboard artifact tags, grouped first by tag type, then by
* tag name.
*/
public class TagsNode extends DisplayableItemNode {
class TagsNode extends DisplayableItemNode {
private static final String DISPLAY_NAME = "Tags";
private static final String ICON_PATH = "org/sleuthkit/autopsy/images/tag-folder-blue-icon-16.png";

View File

@ -23,7 +23,7 @@ package org.sleuthkit.autopsy.datamodel;
* RootContentChildren class. RootContentChildren is a NetBeans child node
* factory built on top of the NetBeans Children.Keys class.
*/
public class TagsNodeKey implements AutopsyVisitableItem {
class TagsNodeKey implements AutopsyVisitableItem {
// Creation of a TagsNode object corresponding to a TagsNodeKey object is done
// by a CreateAutopsyNodeVisitor dispatched from the AbstractContentChildren
// override of Children.Keys<T>.createNodes().

View File

@ -34,7 +34,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
*
* @author jantonius
*/
public class ChangeViewAction extends AbstractAction implements Presenter.Popup {
class ChangeViewAction extends AbstractAction implements Presenter.Popup {
private int type; // type 1 = hex view, 2 = string view
private Node node;

View File

@ -27,7 +27,7 @@ import org.openide.nodes.Node;
* DataResultFilterNode that created in the DataResultFilterNode.java.
*
*/
public class DataResultFilterChildren extends FilterNode.Children {
class DataResultFilterChildren extends FilterNode.Children {
ExplorerManager sourceEm;

View File

@ -55,7 +55,7 @@ import org.sleuthkit.datamodel.VolumeSystem;
/**
* Extracts all the unallocated space as a single file
*/
public final class ExtractUnallocAction extends AbstractAction {
final class ExtractUnallocAction extends AbstractAction {
private final List<UnallocStruct> LstUnallocs = new ArrayList<UnallocStruct>();
private static final List<String> lockedVols = new ArrayList<String>();

View File

@ -36,7 +36,7 @@ import org.sleuthkit.datamodel.SleuthkitCase;
* @deprecated do not use, it is here in case we ever pick up on this work
*/
@Deprecated
public class ResultDeleteAction extends AbstractAction {
class ResultDeleteAction extends AbstractAction {
private enum ActionType {

View File

@ -45,7 +45,7 @@ import org.sleuthkit.datamodel.TskCoreException;
* it is compiled each time to ensure that it is compliant with the API.
*/
// @ServiceProvider(service = DataContentViewer.class)
public class SampleContentViewer extends javax.swing.JPanel implements DataContentViewer {
class SampleContentViewer extends javax.swing.JPanel implements DataContentViewer {
/**
* Creates new form SampleContentViewer

View File

@ -50,7 +50,7 @@ import org.sleuthkit.datamodel.TskCoreException;
* Sample DataSource-level ingest module that doesn't do much at all.
* Just exists to show basic idea of these modules
*/
public class SampleDataSourceIngestModule extends org.sleuthkit.autopsy.ingest.IngestModuleDataSource {
class SampleDataSourceIngestModule extends org.sleuthkit.autopsy.ingest.IngestModuleDataSource {
/* Data Source modules operate on a disk or set of logical files. They
* are passed in teh data source refernce and query it for things they want.

View File

@ -53,7 +53,7 @@ import org.sleuthkit.datamodel.TskData;
* IngestModuleLoader will not load things from the org.sleuthkit.autopsy.examples package.
* Either change the package or the loading code to make this module actually run.
*/
public class SampleFileIngestModule extends org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile {
class SampleFileIngestModule extends org.sleuthkit.autopsy.ingest.IngestModuleAbstractFile {
private int attrId = -1;
private static SampleFileIngestModule defaultInstance = null;

View File

@ -26,7 +26,7 @@ import org.openide.util.actions.CallableSystemAction;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.directorytree.FileSearchProvider;
public final class FileSearchAction extends CallableSystemAction implements FileSearchProvider{
final class FileSearchAction extends CallableSystemAction implements FileSearchProvider{
private static FileSearchAction instance = null;

View File

@ -33,7 +33,7 @@ import javax.swing.JFrame;
/**
* File search dialog
*/
public class FileSearchDialog extends javax.swing.JDialog {
class FileSearchDialog extends javax.swing.JDialog {
/** Creates new form FileSearchDialog */
public FileSearchDialog() {

View File

@ -56,7 +56,7 @@ import org.sleuthkit.datamodel.TskCoreException;
/**
* FileSearchPanel that present search options
*/
public class FileSearchPanel extends javax.swing.JPanel {
class FileSearchPanel extends javax.swing.JPanel {
private List<FilterArea> filterAreas = new ArrayList<FilterArea>();
private JButton searchButton;

View File

@ -197,7 +197,7 @@ public class GeneralIngestConfigurator implements IngestConfigurator {
if (!modulesToStart.isEmpty() && contentToIngest != null) {
// Queue the ingest process.
manager.execute(modulesToStart, contentToIngest);
manager.scheduleDataSource(modulesToStart, contentToIngest);
}
}

View File

@ -39,7 +39,7 @@ import org.sleuthkit.datamodel.LayoutFile;
* Abstract visitor for getting all the files from content
* TODO should be moved to utility module (needs resolve cyclic deps)
*/
public abstract class GetFilesContentVisitor implements ContentVisitor<Collection<AbstractFile>> {
abstract class GetFilesContentVisitor implements ContentVisitor<Collection<AbstractFile>> {
private static final Logger logger = Logger.getLogger(GetFilesContentVisitor.class.getName());

View File

@ -37,7 +37,7 @@ import org.sleuthkit.datamodel.Content;
* Worker thread that runs a data source-level ingest module (image, file set virt dir, etc).
* Used to process only a single data-source and single module.
*/
public class IngestDataSourceThread extends SwingWorker<Void, Void> {
class IngestDataSourceThread extends SwingWorker<Void, Void> {
private final Logger logger = Logger.getLogger(IngestDataSourceThread.class.getName());
private ProgressHandle progress;

View File

@ -40,7 +40,7 @@ import org.sleuthkit.autopsy.coreutils.ModuleSettings;
/**
* main configuration panel for all ingest modules, reusable JPanel component
*/
public class IngestDialogPanel extends javax.swing.JPanel {
class IngestDialogPanel extends javax.swing.JPanel {
private IngestModuleAbstract currentModule;
private ModulesTableModel tableModel;

View File

@ -277,13 +277,13 @@ public class IngestManager {
}
/**
* Multiple data-sources version of execute() method. Enqueues multiple sources inputs (Content objects)
* Multiple data-sources version of scheduleDataSource() method. Enqueues multiple sources inputs (Content objects)
* and associated modules at once
*
* @param modules modules to execute on every data source
* @param inputs input data sources to enqueue and execute the ingest modules on
* @param modules modules to scheduleDataSource on every data source
* @param inputs input data sources to enqueue and scheduleDataSource the ingest modules on
*/
public void execute(final List<IngestModuleAbstract> modules, final List<Content> inputs) {
public void scheduleDataSource(final List<IngestModuleAbstract> modules, final List<Content> inputs) {
logger.log(Level.INFO, "Will enqueue number of inputs: " + inputs.size()
+ " to " + modules.size() + " modules.");
@ -310,14 +310,14 @@ public class IngestManager {
* not block and can be called multiple times to enqueue more work to
* already running background ingest process.
*
* @param modules modules to execute on the data source input
* @param input input data source Content objects to execute the ingest modules on
* @param modules modules to scheduleDataSource on the data source input
* @param input input data source Content objects to scheduleDataSource the ingest modules on
*/
public void execute(final List<IngestModuleAbstract> modules, final Content input) {
public void scheduleDataSource(final List<IngestModuleAbstract> modules, final Content input) {
List<Content> inputs = new ArrayList<Content>();
inputs.add(input);
logger.log(Level.INFO, "Will enqueue input: " + input.getName());
execute(modules, inputs);
scheduleDataSource(modules, inputs);
}
/**

View File

@ -25,7 +25,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
* the main layered pane container for messages table (IngestMessagePanel) and
* details view (IngestMessageDetailsPanel)
*/
public class IngestMessageMainPanel extends javax.swing.JPanel {
class IngestMessageMainPanel extends javax.swing.JPanel {
private IngestMessagePanel messagePanel;
private IngestMessageDetailsPanel detailsPanel;

View File

@ -44,7 +44,7 @@ import org.sleuthkit.datamodel.Content;
/**
* Top component which displays something.
*/
public final class IngestMessageTopComponent extends TopComponent implements IngestUI {
final class IngestMessageTopComponent extends TopComponent implements IngestUI {
private static IngestMessageTopComponent instance;
private static final Logger logger = Logger.getLogger(IngestMessageTopComponent.class.getName());

View File

@ -31,7 +31,7 @@ import org.openide.util.actions.Presenter;
// @ActionReference(path = "Toolbars/File", position = 575)
//})
//@Messages("CTL_IngestMessagesAction=Messages")
public final class IngestMessagesAction extends AbstractAction implements Presenter.Toolbar {
final class IngestMessagesAction extends AbstractAction implements Presenter.Toolbar {
@Override
public void actionPerformed(ActionEvent e) {

View File

@ -34,7 +34,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
* Toolbar for Ingest
*
*/
public class IngestMessagesToolbar extends javax.swing.JPanel {
class IngestMessagesToolbar extends javax.swing.JPanel {
private IngestMessagesButton ingestMessagesButton = new IngestMessagesButton();
private static volatile IngestMessagesToolbar instance;

View File

@ -23,7 +23,7 @@ package org.sleuthkit.autopsy.ingest;
/**
* Base interface for ingest modules
*/
public abstract class IngestModuleAbstract {
abstract class IngestModuleAbstract {
private String args;

View File

@ -90,7 +90,7 @@ import org.w3c.dom.NodeList;
* NOTE: this will be part of future IngestPipelineManager with IngestManager
* code refactored
*/
public final class IngestModuleLoader {
final class IngestModuleLoader {
private static final String PIPELINE_CONFIG_XML = "pipeline_config.xml";
private static final String XSDFILE = "PipelineConfigSchema.xsd";

View File

@ -24,7 +24,7 @@ import org.sleuthkit.datamodel.Content;
/**
* UI support for ingest
*/
public interface IngestUI {
interface IngestUI {
void displayMessage(final IngestMessage message);
int getMessagesCount();
void clearMessages();

View File

@ -34,7 +34,7 @@ import org.sleuthkit.autopsy.corecomponents.DataContentTopComponent;
*
* @author jantonius
*/
public class DataContentDynamicMenu extends JMenuItem implements DynamicMenuContent {
class DataContentDynamicMenu extends JMenuItem implements DynamicMenuContent {
@Override
public JComponent[] getMenuPresenters() {

View File

@ -27,7 +27,7 @@ import org.openide.util.actions.Presenter;
/**
* Menu item that displays DataContentViewers
*/
public class DataContentMenu extends CallableSystemAction implements Presenter.Menu {
class DataContentMenu extends CallableSystemAction implements Presenter.Menu {
DataContentMenu(){}

View File

@ -33,7 +33,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer;
*
* @author jantonius
*/
public class DataExplorerDynamicMenu extends JMenuItem implements DynamicMenuContent{
class DataExplorerDynamicMenu extends JMenuItem implements DynamicMenuContent{
DataExplorerDynamicMenu(){
}

View File

@ -28,7 +28,7 @@ import org.openide.util.actions.Presenter;
* Menu item that tracks available DataExplorers.
* @author jantonius
*/
public class DataExplorerMenu extends CallableSystemAction implements Presenter.Menu {
class DataExplorerMenu extends CallableSystemAction implements Presenter.Menu {
@Override
public JMenuItem getMenuPresenter() {

View File

@ -31,7 +31,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
/**
* Menu item tracks the DataResult windows
*/
public class DataResultMenu extends CallableSystemAction implements Presenter.Menu, PropertyChangeListener {
class DataResultMenu extends CallableSystemAction implements Presenter.Menu, PropertyChangeListener {
JMenu menu = new JMenu("DataResult Windows");

View File

@ -27,7 +27,7 @@ import org.openide.windows.WindowManager;
/**
* This action opens the TopComponent passed to the constructor
*/
public class OpenTopComponentAction extends AbstractAction{
class OpenTopComponentAction extends AbstractAction{
private TopComponent tc;

View File

@ -31,7 +31,7 @@ import org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent;
/**
* Menu item lists DataResult tabs.
*/
public class SearchResultMenu extends JMenuItem implements DynamicMenuContent {
class SearchResultMenu extends JMenuItem implements DynamicMenuContent {
SearchResultMenu(){

View File

@ -28,7 +28,7 @@ import org.openide.util.actions.Presenter;
*
* @author dfickling
*/
public class SpacerPanel extends javax.swing.JPanel{
class SpacerPanel extends javax.swing.JPanel{
SpacerPanel() {
this.setPreferredSize(new Dimension(2000, 20));
}

View File

@ -29,7 +29,7 @@ import org.sleuthkit.datamodel.TskData;
*
* @author jwallace
*/
public enum FileReportDataTypes {
enum FileReportDataTypes {
NAME("Name") {
@Override

View File

@ -26,7 +26,7 @@ import org.sleuthkit.datamodel.AbstractFile;
*
* @author jwallace
*/
public interface FileReportModule extends ReportModule {
interface FileReportModule extends ReportModule {
/**
* Initialize the report which will be stored at the given path.
* @param path

View File

@ -35,7 +35,7 @@ import org.sleuthkit.datamodel.AbstractFile;
*
* @author jwallace
*/
public class FileReportText implements FileReportModule {
class FileReportText implements FileReportModule {
private static final Logger logger = Logger.getLogger(FileReportText.class.getName());
private String reportPath;
private Writer out;
@ -123,7 +123,7 @@ public class FileReportText implements FileReportModule {
@Override
public String getDescription() {
return "A tab delimited text file containing information about files in the case.";
return "A tab delimited text file containing information about individual files in the case.";
}
@Override

View File

@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.report;
import javax.swing.JPanel;
public interface GeneralReportModule extends ReportModule {
interface GeneralReportModule extends ReportModule {
/**
* Called to generate the report. Method is responsible for saving the file at the

View File

@ -40,7 +40,7 @@ import org.sleuthkit.datamodel.*;
* ReportBodyFile generates a report in the body file format specified on
* The Sleuth Kit wiki as MD5|name|inode|mode_as_string|UID|GID|size|atime|mtime|ctime|crtime.
*/
public class ReportBodyFile implements GeneralReportModule {
class ReportBodyFile implements GeneralReportModule {
private static final Logger logger = Logger.getLogger(ReportBodyFile.class.getName());
private static ReportBodyFile instance = null;

View File

@ -37,7 +37,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil;
*
* Uses module settings property files to store customizations.
*/
public final class ReportBranding implements ReportBrandingProviderI {
final class ReportBranding implements ReportBrandingProviderI {
//property names
private static final String GENERATOR_LOGO_PATH_PROP = "GeneratorLogoPath";

View File

@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.report;
/**
* Interface to implement by reports to add on custom branding, logos, etc
*/
public interface ReportBrandingProviderI {
interface ReportBrandingProviderI {
/**
* Get the generator logo path on the local disk (previously set or default),

View File

@ -29,7 +29,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
public class ReportExcel implements TableReportModule {
class ReportExcel implements TableReportModule {
private static final Logger logger = Logger.getLogger(ReportExcel.class.getName());
private static ReportExcel instance;
@ -282,7 +282,7 @@ public class ReportExcel implements TableReportModule {
@Override
public String getDescription() {
return "An XLS formatted report which is meant to be viewed in Excel.";
return "A report about results and tagged items in Excel (XLS) format.";
}
@Override

View File

@ -29,7 +29,7 @@ import javax.swing.Box;
import javax.swing.JOptionPane;
import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
public class ReportGenerationPanel extends javax.swing.JPanel {
class ReportGenerationPanel extends javax.swing.JPanel {
private GridBagConstraints c;
private List<ReportProgressPanel> progressPanels;
private Component glue;

View File

@ -46,6 +46,7 @@ import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.SwingWorker;
import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
import org.sleuthkit.autopsy.coreutils.ImageUtils;
@ -71,7 +72,7 @@ import org.sleuthkit.datamodel.TskException;
* can be called to show report generation progress using ReportProgressPanel
* objects displayed using a dialog box.
*/
public class ReportGenerator {
class ReportGenerator {
private static final Logger logger = Logger.getLogger(ReportGenerator.class.getName());
private Case currentCase = Case.getCurrentCase();
@ -87,7 +88,7 @@ public class ReportGenerator {
static final String REPORTS_DIR = "Reports";
ReportGenerator(Map<TableReportModule, Boolean> tableModuleStates, Map<GeneralReportModule, Boolean> generalModuleStates, Map<FileReportModule, Boolean> fileListModuleStates) {
// Create the root reports directory path of the form: <CASE DIRECTORY>/Reports/<Case name> <Timestamp>/
// Create the root reports directory path of the form: <CASE DIRECTORY>/Reports/<Case fileName> <Timestamp>/
DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss");
Date date = new Date();
String dateNoTime = dateFormat.format(date);
@ -384,11 +385,18 @@ public class ReportGenerator {
}
}
// report on the blackboard results
makeBlackboardArtifactTables();
// report on the tagged files and artifacts
makeContentTagsTables();
makeBlackboardArtifactTagsTables();
// report on the tagged images
makeThumbnailTable();
// finish progress, wrap up
for (TableReportModule module : tableModules) {
tableProgress.get(module).complete();
module.endReport();
@ -397,11 +405,14 @@ public class ReportGenerator {
return 0;
}
/**
* Generate the tables for the selected blackboard artifacts
*/
private void makeBlackboardArtifactTables() {
// Make a comment string describing the tag names filter in effect.
StringBuilder comment = new StringBuilder();
if (!tagNamesFilter.isEmpty()) {
comment.append("This report only includes results tagged with: ");
comment.append("Contains results that were tagged with one of the following: ");
comment.append(makeCommaSeparatedList(tagNamesFilter));
}
@ -483,6 +494,9 @@ public class ReportGenerator {
}
}
/**
* Make table for tagged files
*/
private void makeContentTagsTables() {
// Check for cancellaton.
removeCancelledTableReportModules();
@ -508,7 +522,7 @@ public class ReportGenerator {
ArrayList<String> columnHeaders = new ArrayList<>(Arrays.asList("File", "Tag", "Comment"));
StringBuilder comment = new StringBuilder();
if (!tagNamesFilter.isEmpty()) {
comment.append("This report only includes file tagged with: ");
comment.append("Contains files that were tagged with one of the following: ");
comment.append(makeCommaSeparatedList(tagNamesFilter));
}
if (module instanceof ReportHTML) {
@ -524,9 +538,19 @@ public class ReportGenerator {
// Give the modules the rows for the content tags.
for (ContentTag tag : tags) {
if (passesTagNamesFilter(tag.getName().getDisplayName())) {
checkIfTagHasImage(tag);
ArrayList<String> rowData = new ArrayList<>(Arrays.asList(tag.getContent().getName(), tag.getName().getDisplayName(), tag.getComment()));
// skip tags that we are not reporting on
if (passesTagNamesFilter(tag.getName().getDisplayName()) == false) {
continue;
}
String fileName;
try {
fileName = tag.getContent().getUniquePath();
} catch (TskCoreException ex) {
fileName = tag.getContent().getName();
}
ArrayList<String> rowData = new ArrayList<>(Arrays.asList(fileName, tag.getName().getDisplayName(), tag.getComment()));
for (TableReportModule module : tableModules) {
// @@@ This casting is a tricky little workaround to allow the HTML report module to slip in a content hyperlink.
if (module instanceof ReportHTML) {
@ -537,7 +561,9 @@ public class ReportGenerator {
module.addRow(rowData);
}
}
}
// see if it is for an image so that we later report on it
checkIfTagHasImage(tag);
}
// The the modules content tags reporting is ended.
@ -548,6 +574,9 @@ public class ReportGenerator {
}
}
/**
* Generate the tables for the tagged artifacts
*/
private void makeBlackboardArtifactTagsTables() {
// Check for cancellaton.
removeCancelledTableReportModules();
@ -579,14 +608,18 @@ public class ReportGenerator {
// Give the modules the rows for the content tags.
for (BlackboardArtifactTag tag : tags) {
if (passesTagNamesFilter(tag.getName().getDisplayName())) {
checkIfTagHasImage(tag);
if (passesTagNamesFilter(tag.getName().getDisplayName()) == false) {
continue;
}
List<String> row;
for (TableReportModule module : tableModules) {
row = new ArrayList<>(Arrays.asList(tag.getArtifact().getArtifactTypeName(), tag.getName().getDisplayName(), tag.getComment(), tag.getContent().getName()));
module.addRow(row);
}
}
// check if the tag is an image that we should later make a thumbnail for
checkIfTagHasImage(tag);
}
// The the modules blackboard artifact tags reporting is ended.
@ -597,7 +630,12 @@ public class ReportGenerator {
}
}
boolean passesTagNamesFilter(String tagName) {
/**
* Test if the user requested that this tag be reported on
* @param tagName
* @return true if it should be reported on
*/
private boolean passesTagNamesFilter(String tagName) {
return tagNamesFilter.isEmpty() || tagNamesFilter.contains(tagName);
}
@ -611,25 +649,36 @@ public class ReportGenerator {
}
}
/**
* Make a report for the files that were previously found to
* be images.
*/
private void makeThumbnailTable() {
for (TableReportModule module : tableModules) {
tableProgress.get(module).updateStatusLabel("Now processing Tagged Images...");
tableProgress.get(module).updateStatusLabel("Creating thumbnails...");
if (module instanceof ReportHTML) {
ReportHTML htmlModule = (ReportHTML) module;
htmlModule.startDataType("Tagged Images", "Tagged Results and Contents that contain images.");
htmlModule.startDataType("Thumbnails", "Contains thumbnails of images that are associated with tagged files and results.");
List<String> emptyHeaders = new ArrayList<>();
for (int i = 0; i < ReportHTML.THUMBNAIL_COLUMNS; i++) {
emptyHeaders.add("");
}
htmlModule.startTable(emptyHeaders);
htmlModule.addThumbnailRows(images);
htmlModule.endTable();
htmlModule.endDataType();
}
}
}
/**
* Analyze artifact associated with tag and add to internal list if it is associated
* with an image.
* @param artifactTag
*/
private void checkIfTagHasImage(BlackboardArtifactTag artifactTag) {
AbstractFile file;
try {
@ -638,25 +687,28 @@ public class ReportGenerator {
logger.log(Level.WARNING, "Error while getting content from a blackboard artifact to report on.", ex);
return;
}
if (file.isDir() ||
file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS ||
file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS) {
return;
}
// Only include content for images
if (ImageUtils.thumbnailSupported(file)) {
images.add(file);
}
checkIfFileIsImage(file);
}
/**
* Analyze file that tag is associated with and determine if
* it is an image and should have a thumbnail reported for it.
* Images are added to internal list.
* @param contentTag
*/
private void checkIfTagHasImage(ContentTag contentTag) {
Content c = contentTag.getContent();
if (c instanceof AbstractFile == false) {
return;
}
AbstractFile file = (AbstractFile) c;
checkIfFileIsImage((AbstractFile) c);
}
/**
* If file is an image file, add it to the internal 'images' list.
* @param file
*/
private void checkIfFileIsImage(AbstractFile file) {
if (file.isDir() ||
file.getType() == TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS ||
@ -664,8 +716,8 @@ public class ReportGenerator {
return;
}
if (ImageUtils.thumbnailSupported(c)) {
images.add(c);
if (ImageUtils.thumbnailSupported(file)) {
images.add(file);
}
}
}

View File

@ -44,6 +44,8 @@ import org.openide.filesystems.FileObject;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.casemodule.Case;
import org.openide.filesystems.FileUtil;
import org.sleuthkit.autopsy.casemodule.services.Services;
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
import org.sleuthkit.autopsy.coreutils.ImageUtils;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.datamodel.ContentUtils.ExtractFscContentVisitor;
@ -58,7 +60,7 @@ import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.ContentTag;
import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
public class ReportHTML implements TableReportModule {
class ReportHTML implements TableReportModule {
private static final Logger logger = Logger.getLogger(ReportHTML.class.getName());
private static final String THUMBS_REL_PATH = "thumbs" + File.separator;
private static ReportHTML instance;
@ -533,42 +535,13 @@ public class ReportHTML implements TableReportModule {
return;
}
// Make a folder for the local file with the same tagName as the tag.
StringBuilder localFilePath = new StringBuilder();
localFilePath.append(path);
localFilePath.append(contentTag.getName().getDisplayName());
File localFileFolder = new File(localFilePath.toString());
if (!localFileFolder.exists()) {
localFileFolder.mkdirs();
}
// Construct a file tagName for the local file that incorporates the file id to ensure uniqueness.
String fileName = file.getName();
String objectIdSuffix = "_" + file.getId();
int lastDotIndex = fileName.lastIndexOf(".");
if (lastDotIndex != -1 && lastDotIndex != 0) {
// The file tagName has a conventional extension. Insert the object id before the '.' of the extension.
fileName = fileName.substring(0, lastDotIndex) + objectIdSuffix + fileName.substring(lastDotIndex, fileName.length());
}
else {
// The file has no extension or the only '.' in the file is an initial '.', as in a hidden file.
// Add the object id to the end of the file tagName.
fileName += objectIdSuffix;
}
localFilePath.append(File.separator);
localFilePath.append(fileName);
// If the local file doesn't already exist, create it now.
// The existence check is necessary because it is possible to apply multiple tags with the same tagName to a file.
File localFile = new File(localFilePath.toString());
if (!localFile.exists()) {
ExtractFscContentVisitor.extract(file, localFile, null, null);
}
// save it in a folder based on the tag name
String localFilePath = saveContent(file, contentTag.getName().getDisplayName());
// Add the hyperlink to the row. A column header for it was created in startTable().
StringBuilder localFileLink = new StringBuilder();
localFileLink.append("<a href=\"file:///");
localFileLink.append(localFilePath.toString());
localFileLink.append("<a href=\"");
localFileLink.append(localFilePath);
localFileLink.append("\">View File</a>");
row.add(localFileLink.toString());
@ -628,17 +601,45 @@ public class ReportHTML implements TableReportModule {
AbstractFile file = (AbstractFile) content;
String contentPath = saveContent(file);
// save copies of the orginal image and thumbnail image
String thumbnailPath = prepareThumbnail(file);
if (thumbnailPath == null) {
continue;
}
String contentPath = saveContent(file, "thumbs_fullsize");
String nameInImage;
try {
nameInImage = file.getUniquePath();
} catch (TskCoreException ex) {
nameInImage = file.getName();
}
StringBuilder linkToThumbnail = new StringBuilder();
linkToThumbnail.append("<a href=\"file:///");
linkToThumbnail.append("<a href=\"");
linkToThumbnail.append(contentPath);
linkToThumbnail.append("\">");
linkToThumbnail.append("<img src=\"").append(thumbnailPath).append("\" />");
linkToThumbnail.append("</a>");
linkToThumbnail.append("<img src=\"").append(thumbnailPath).append("\" title=\"").append(nameInImage).append("\"/>");
linkToThumbnail.append("</a><br>");
linkToThumbnail.append(file.getName()).append("<br>");
Services services = currentCase.getServices();
TagsManager tagsManager = services.getTagsManager();
try {
List<ContentTag> tags = tagsManager.getContentTagsByContent(content);
if (tags.size() > 0) {
linkToThumbnail.append("Tags: " );
}
for (int i = 0; i < tags.size(); i++) {
ContentTag tag = tags.get(i);
linkToThumbnail.append(tag.getName().getDisplayName());
if (i != tags.size() - 1) {
linkToThumbnail.append(", ");
}
}
} catch (TskCoreException ex) {
logger.log(Level.WARNING, "Could not find get tags for file.", ex);
}
currentRow.add(linkToThumbnail.toString());
totalCount++;
@ -670,11 +671,22 @@ public class ReportHTML implements TableReportModule {
return false;
}
public String saveContent(AbstractFile file) {
/**
* Save a local copy of the given file in the reports folder.
* @param file File to save
* @param dirName Custom top-level folder to use to store the files in (tag name, etc.)
* @return Path to where file was stored (relative to root of HTML folder)
*/
public String saveContent(AbstractFile file, String dirName) {
// clean up the dir name passed in
String dirName2 = dirName.replace("/", "_");
dirName2 = dirName2.replace("\\", "_");
// Make a folder for the local file with the same tagName as the tag.
StringBuilder localFilePath = new StringBuilder();
StringBuilder localFilePath = new StringBuilder(); // full path
localFilePath.append(path);
localFilePath.append("tagged_images");
localFilePath.append(dirName2);
File localFileFolder = new File(localFilePath.toString());
if (!localFileFolder.exists()) {
localFileFolder.mkdirs();
@ -702,7 +714,9 @@ public class ReportHTML implements TableReportModule {
if (!localFile.exists()) {
ExtractFscContentVisitor.extract(file, localFile, null, null);
}
return localFilePath.toString();
// get the relative path
return localFilePath.toString().substring(path.length());
}
/**
@ -730,7 +744,7 @@ public class ReportHTML implements TableReportModule {
@Override
public String getDescription() {
return "An HTML formatted report, designed to be viewed in a modern browser.";
return "A report about results and tagged items in HTML format.";
}

View File

@ -25,7 +25,7 @@ package org.sleuthkit.autopsy.report;
/**
* Interface got report modules that plug in to the reporting infrastructure.
*/
public interface ReportModule {
interface ReportModule {
/**
* Get the name of the report this module generates.

View File

@ -27,7 +27,7 @@ import java.awt.event.MouseListener;
import java.io.File;
import java.io.IOException;
public class ReportProgressPanel extends javax.swing.JPanel {
class ReportProgressPanel extends javax.swing.JPanel {
private ReportStatus STATUS;
// Enum to represent if a report is waiting,

View File

@ -44,11 +44,11 @@
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Component id="configurationPanel" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="descriptionScrollPane" min="-2" pref="32" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="configurationPanel" max="32767" attributes="0"/>
</Group>
<Component id="modulesScrollPane" max="32767" attributes="0"/>
<Component id="modulesScrollPane" pref="208" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>

View File

@ -36,7 +36,7 @@ import javax.swing.event.ListSelectionListener;
import org.openide.util.Lookup;
import org.sleuthkit.autopsy.coreutils.Logger;
public final class ReportVisualPanel1 extends JPanel implements ListSelectionListener {
final class ReportVisualPanel1 extends JPanel implements ListSelectionListener {
private static final Logger logger = Logger.getLogger(ReportVisualPanel1.class.getName());
private ReportWizardPanel1 wizPanel;
private List<ReportModule> modules = new ArrayList<>();
@ -76,6 +76,16 @@ public final class ReportVisualPanel1 extends JPanel implements ListSelectionLis
Collections.sort(modules, new Comparator<ReportModule>() {
@Override
public int compare(ReportModule rm1, ReportModule rm2) {
// our theory is that the report table modules are more common, so they go on top
boolean rm1isTable = (rm1 instanceof TableReportModule);
boolean rm2isTable = (rm2 instanceof TableReportModule);
if (rm1isTable && !rm2isTable) {
return -1;
}
if (!rm1isTable && rm2isTable) {
return 1;
}
return rm1.getName().compareTo(rm2.getName());
}
});
@ -207,10 +217,10 @@ public final class ReportVisualPanel1 extends JPanel implements ListSelectionLis
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(configurationPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(descriptionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(modulesScrollPane))
.addComponent(configurationPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(modulesScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 208, Short.MAX_VALUE))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents

View File

@ -43,7 +43,7 @@ import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
import org.sleuthkit.datamodel.TagName;
import org.sleuthkit.datamodel.TskCoreException;
public final class ReportVisualPanel2 extends JPanel {
final class ReportVisualPanel2 extends JPanel {
private ReportWizardPanel2 wizPanel;
private Map<String, Boolean> tagStates = new LinkedHashMap<>();

View File

@ -30,7 +30,7 @@ import org.openide.util.HelpCtx;
*
* @author jwallace
*/
public class ReportWizardFileOptionsPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor>{
class ReportWizardFileOptionsPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor>{
private WizardDescriptor wiz;
private ReportWizardFileOptionsVisualPanel component;
private JButton finishButton;

View File

@ -37,7 +37,7 @@ import javax.swing.event.ListDataListener;
*
* @author jwallace
*/
public class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
class ReportWizardFileOptionsVisualPanel extends javax.swing.JPanel {
private List<FileReportDataTypes> options;
private Map<FileReportDataTypes, Boolean> optionStates = new EnumMap<>(FileReportDataTypes.class);
private ListModel model;

View File

@ -27,7 +27,7 @@ import javax.swing.event.ChangeListener;
import org.openide.WizardDescriptor;
import org.openide.util.NbPreferences;
public final class ReportWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> {
final class ReportWizardIterator implements WizardDescriptor.Iterator<WizardDescriptor> {
private int index;
private ReportWizardPanel1 firstPanel;

View File

@ -29,7 +29,7 @@ import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx;
import org.openide.util.NbPreferences;
public class ReportWizardPanel1 implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
class ReportWizardPanel1 implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
private WizardDescriptor wiz;
private ReportVisualPanel1 component;
private JButton nextButton;

Some files were not shown because too many files have changed in this diff Show More