Merge fixes to main modules from branch 'keyword-search-prototype'

This commit is contained in:
Peter J. Martel 2011-12-08 15:04:58 -05:00
commit 89e96e5027
16 changed files with 91 additions and 57 deletions

View File

@ -39,8 +39,12 @@ public interface DataContentViewer {
public String getTitle(); public String getTitle();
/** /**
* Get new DataContentViewer instance. * Get new DataContentViewer instance. (This method is weird. We use the
* instance returned by the Lookup as a factory for the instances that
* are actually used.)
*/ */
// TODO: extract the factory method out into a seperate interface that
// is used for the Lookup.
public DataContentViewer getInstance(); public DataContentViewer getInstance();
/** /**

View File

@ -97,14 +97,6 @@ abstract class AbstractContentNode<T extends Content> extends AbstractNode imple
public byte[] read(long offset, long len) throws TskException { public byte[] read(long offset, long len) throws TskException {
return content.read(offset, len); return content.read(offset, len);
} }
/**
* Returns the location of the file ID / Metadata address on the columns on
* the directory table.
*
* @return
*/
abstract public int getFileIDColumn();
/** /**
* Returns the content of this node. * Returns the content of this node.
@ -238,6 +230,5 @@ abstract class AbstractContentNode<T extends Content> extends AbstractNode imple
public List<String> visit(VolumeSystem vs) { public List<String> visit(VolumeSystem vs) {
return vs.getParent().accept(this); return vs.getParent().accept(this);
} }
} }
} }

View File

@ -0,0 +1,78 @@
/*
* 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.datamodel;
import java.sql.SQLException;
import org.openide.nodes.FilterNode;
import org.openide.nodes.Node;
import org.openide.util.Lookup;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.TskException;
public class ContentFilterNode extends FilterNode implements ContentNode {
public ContentFilterNode(ContentNode original) {
super((Node) original);
}
public ContentFilterNode(ContentNode original, Children children) {
super((Node) original, children);
}
public ContentFilterNode(ContentNode original, Children children, Lookup lookup) {
super((Node) original, children, lookup);
}
@Override
public long getID() {
return ((ContentNode) super.getOriginal()).getID();
}
@Override
public Object[][] getRowValues(int rows) throws SQLException {
return ((ContentNode) super.getOriginal()).getRowValues(rows);
}
@Override
public byte[] read(long offset, long len) throws TskException {
return ((ContentNode) super.getOriginal()).read(offset, len);
}
@Override
public Content getContent() {
return ((ContentNode) super.getOriginal()).getContent();
}
@Override
public String[] getDisplayPath() {
return ((ContentNode) super.getOriginal()).getDisplayPath();
}
@Override
public String[] getSystemPath() {
return ((ContentNode) super.getOriginal()).getSystemPath();
}
@Override
public <T> T accept(ContentNodeVisitor<T> v) {
return ((ContentNode) super.getOriginal()).accept(v);
}
}

View File

@ -65,14 +65,6 @@ public interface ContentNode {
*/ */
public byte[] read(long offset, long len) throws TskException; public byte[] read(long offset, long len) throws TskException;
/**
* Returns the location of the file ID / Metadata address on the columns on
* the directory table.
*
* @return
*/
public int getFileIDColumn();
/** /**
* Returns the content of this node. * Returns the content of this node.
* *

View File

@ -100,11 +100,6 @@ public class DirectoryNode extends AbstractFsContentNode<Directory> {
return objs; return objs;
} }
@Override
public int getFileIDColumn() {
return 1;
}
@Override @Override
public <T> T accept(ContentNodeVisitor<T> v) { public <T> T accept(ContentNodeVisitor<T> v) {
return v.visit(this); return v.visit(this);

View File

@ -94,12 +94,7 @@ public class FileNode extends AbstractFsContentNode<File> {
}); });
return objs; return objs;
} }
@Override
public int getFileIDColumn() {
return 1; // change this later when it's defined
}
@Override @Override
public <T> T accept(ContentNodeVisitor<T> v) { public <T> T accept(ContentNodeVisitor<T> v) {
return v.visit(this); return v.visit(this);

View File

@ -79,11 +79,6 @@ public class ImageNode extends AbstractContentNode<Image> {
return objs; return objs;
} }
@Override
public int getFileIDColumn() {
return 0;
}
@Override @Override
public Cookie getCookie(Class clazz) { public Cookie getCookie(Class clazz) {
Children ch = getChildren(); Children ch = getChildren();

View File

@ -90,11 +90,6 @@ public class VolumeNode extends AbstractContentNode<Volume> {
return objs; return objs;
} }
@Override
public int getFileIDColumn() {
return 1;
}
/** /**
* Right click action for volume node * Right click action for volume node
* *

View File

@ -1,8 +1,8 @@
build.xml.data.CRC32=db477856 build.xml.data.CRC32=db477856
build.xml.script.CRC32=6ec7becb build.xml.script.CRC32=6ec7becb
build.xml.stylesheet.CRC32=a56c6a5b@1.42.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=db477856 nbproject/build-impl.xml.data.CRC32=db477856
nbproject/build-impl.xml.script.CRC32=8c5007a7 nbproject/build-impl.xml.script.CRC32=8c5007a7
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.42.2 nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.2

View File

@ -205,11 +205,6 @@ public class DataResultFilterNode extends FilterNode implements ContentNode {
return ((ContentNode) currentNode).read(offset, len); return ((ContentNode) currentNode).read(offset, len);
} }
@Override
public int getFileIDColumn() {
return ((ContentNode) currentNode).getFileIDColumn();
}
@Override @Override
public Content getContent() { public Content getContent() {
return ((ContentNode) currentNode).getContent(); return ((ContentNode) currentNode).getContent();

View File

@ -23,7 +23,10 @@ import java.util.List;
import javax.swing.Action; import javax.swing.Action;
import org.openide.nodes.FilterNode; import org.openide.nodes.FilterNode;
import org.openide.nodes.Node; import org.openide.nodes.Node;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.Volume;
/** /**
* This class sets the actions for the nodes in the directory tree and creates * This class sets the actions for the nodes in the directory tree and creates

View File

@ -26,6 +26,7 @@
<file name="org-sleuthkit-autopsy-directorytree-DirectoryTreeTopComponent.instance"> <file name="org-sleuthkit-autopsy-directorytree-DirectoryTreeTopComponent.instance">
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer"/> <attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer"/>
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent.getDefault"/> <attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent.getDefault"/>
<attr name="position" intvalue="100"/>
</file> </file>
</folder> </folder>
<folder name="Windows2"> <folder name="Windows2">

View File

@ -111,11 +111,6 @@ public class DataResultFilterNode extends FilterNode implements ContentNode {
return ((ContentNode) currentNode).read(offset, len); return ((ContentNode) currentNode).read(offset, len);
} }
@Override
public int getFileIDColumn() {
return ((ContentNode) currentNode).getFileIDColumn();
}
@Override @Override
public Content getContent() { public Content getContent() {
return ((ContentNode) currentNode).getContent(); return ((ContentNode) currentNode).getContent();

View File

@ -40,7 +40,6 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import org.openide.nodes.Node;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.windows.TopComponent; import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager; import org.openide.windows.WindowManager;

View File

@ -90,11 +90,6 @@ class SearchNode extends AbstractNode implements ContentNode {
throw new UnsupportedOperationException("Not supported yet."); throw new UnsupportedOperationException("Not supported yet.");
} }
@Override
public int getFileIDColumn() {
return -1; // change this later when needed
}
@Override @Override
public Content getContent() { public Content getContent() {
return null; return null;

View File

@ -22,6 +22,7 @@
<file name="org-sleuthkit-autopsy-filesearch-FileSearchTopComponent.instance"> <file name="org-sleuthkit-autopsy-filesearch-FileSearchTopComponent.instance">
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer"/> <attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.corecomponentinterfaces.DataExplorer"/>
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.filesearch.FileSearchTopComponent.getDefault"/> <attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.filesearch.FileSearchTopComponent.getDefault"/>
<attr name="position" intvalue="200"/>
</file> </file>
</folder> </folder>
<folder name="Windows2"> <folder name="Windows2">