mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
index only files, added info log to indexing, fixed strings extraction, reduced calls to DataContentViewers
This commit is contained in:
parent
c03e49fcfd
commit
5f8a2581f2
13
CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java
Normal file → Executable file
13
CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentTopComponent.java
Normal file → Executable file
@ -200,7 +200,7 @@ public final class DataContentTopComponent extends TopComponent implements DataC
|
||||
}
|
||||
}
|
||||
|
||||
resetTabs(currentNode);
|
||||
setupTabs(currentNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -248,14 +248,7 @@ public final class DataContentTopComponent extends TopComponent implements DataC
|
||||
|
||||
currentNode = selectedNode;
|
||||
|
||||
resetTabs(selectedNode);
|
||||
|
||||
// set the display on the current active tab
|
||||
int currentActiveTab = dataContentTabbedPane.getSelectedIndex();
|
||||
if (currentActiveTab != -1) {
|
||||
UpdateWrapper dcv = viewers.get(currentActiveTab);
|
||||
dcv.setNode(selectedNode);
|
||||
}
|
||||
setupTabs(selectedNode);
|
||||
} finally {
|
||||
this.setCursor(null);
|
||||
}
|
||||
@ -296,7 +289,7 @@ public final class DataContentTopComponent extends TopComponent implements DataC
|
||||
*
|
||||
* @param selectedNode the selected content Node
|
||||
*/
|
||||
public void resetTabs(Node selectedNode) {
|
||||
public void setupTabs(Node selectedNode) {
|
||||
|
||||
int totalTabs = dataContentTabbedPane.getTabCount();
|
||||
|
||||
|
2
CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java
Normal file → Executable file
2
CoreComponents/src/org/sleuthkit/autopsy/corecomponents/DataContentViewerHex.java
Normal file → Executable file
@ -223,11 +223,9 @@ public class DataContentViewerHex extends javax.swing.JPanel implements DataCont
|
||||
}
|
||||
|
||||
// set the data on the bottom and show it
|
||||
String text = "";
|
||||
Boolean setVisible = false;
|
||||
|
||||
if (data != null) {
|
||||
text = DataConversion.getString(data, 4);
|
||||
setVisible = true;
|
||||
}
|
||||
|
||||
|
22
DataModel/src/org/sleuthkit/autopsy/datamodel/DataConversion.java
Normal file → Executable file
22
DataModel/src/org/sleuthkit/autopsy/datamodel/DataConversion.java
Normal file → Executable file
@ -133,6 +133,7 @@ public class DataConversion {
|
||||
Charset.forName("UTF-8").newEncoder();
|
||||
*/
|
||||
|
||||
|
||||
final StringBuilder result = new StringBuilder();
|
||||
StringBuilder temp = new StringBuilder();
|
||||
int counter = 0;
|
||||
@ -141,28 +142,25 @@ public class DataConversion {
|
||||
final char NL = (char) 10; // ASCII char for new line
|
||||
final String NLS = Character.toString(NL);
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
char tempChar = (char) args[i];
|
||||
int dec = (int) tempChar;
|
||||
char curChar = (char) args[i];
|
||||
int curCharInt = (int) curChar;
|
||||
|
||||
// the printable ASCII chars are dec 32-126
|
||||
// and we want to include TAB as well (dec 9)
|
||||
if (!((dec < 32 || dec > 126) && dec != 9)) {
|
||||
temp.append(NLS);
|
||||
++counter;
|
||||
} else {
|
||||
// ignore non-printable ASCII chars
|
||||
// 32-126 and TAB ( 9)
|
||||
if (((curCharInt < 32) && (curCharInt != 9)) || (curCharInt > 126)) {
|
||||
if (counter >= parameter) {
|
||||
// add to the result and also add the new line at the end
|
||||
result.append(temp);
|
||||
result.append(Character.toString(NL));
|
||||
|
||||
// reset the temp and counter
|
||||
temp = new StringBuilder();
|
||||
counter = 0;
|
||||
}
|
||||
// reset the temp and counter
|
||||
temp = new StringBuilder();
|
||||
counter = 0;
|
||||
}
|
||||
else {
|
||||
temp.append(curChar);
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
|
||||
result.append(temp);
|
||||
|
7
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetAllFilesContentVisitor.java
Normal file → Executable file
7
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetAllFilesContentVisitor.java
Normal file → Executable file
@ -29,12 +29,12 @@ import org.sleuthkit.datamodel.File;
|
||||
import org.sleuthkit.datamodel.FileSystem;
|
||||
import org.sleuthkit.datamodel.FsContent;
|
||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
import org.sleuthkit.datamodel.TskData.FileKnown;
|
||||
|
||||
/**
|
||||
* Visitor for getting all the files to try to index from any Content object.
|
||||
* Currently gets all the files with a file extensions that match a list of
|
||||
* document types that Tika/Solr-Cell supports.
|
||||
* Currently gets all non-zero files.
|
||||
*/
|
||||
class GetAllFilesContentVisitor extends GetFilesContentVisitor {
|
||||
|
||||
@ -53,7 +53,8 @@ class GetAllFilesContentVisitor extends GetFilesContentVisitor {
|
||||
SleuthkitCase sc = Case.getCurrentCase().getSleuthkitCase();
|
||||
|
||||
String query = "SELECT * FROM tsk_files WHERE fs_obj_id = " + fs.getId()
|
||||
+ " AND (known != " + FileKnown.KNOWN.toLong() + ")";
|
||||
+ " AND (meta_type = " + TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG.getMetaType() +
|
||||
") AND (known != " + FileKnown.KNOWN.toLong() + ") AND (size > 0)";
|
||||
try {
|
||||
ResultSet rs = sc.runQuery(query);
|
||||
return sc.resultSetToFsContents(rs);
|
||||
|
9
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetIngestableFilesContentVisitor.java
Normal file → Executable file
9
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/GetIngestableFilesContentVisitor.java
Normal file → Executable file
@ -31,11 +31,12 @@ import org.sleuthkit.datamodel.FileSystem;
|
||||
import org.sleuthkit.datamodel.FsContent;
|
||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
import org.sleuthkit.datamodel.TskData.FileKnown;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
|
||||
|
||||
/**
|
||||
* Visitor for getting all the files to try to index from any Content object.
|
||||
* Currently gets all the files with a file extensions that match a list of
|
||||
* Currently gets all the non-zero sized files with a file extensions that match a list of
|
||||
* document types that Tika/Solr-Cell supports.
|
||||
*/
|
||||
class GetIngestableFilesContentVisitor extends GetFilesContentVisitor {
|
||||
@ -88,7 +89,9 @@ class GetIngestableFilesContentVisitor extends GetFilesContentVisitor {
|
||||
|
||||
String query = "SELECT * FROM tsk_files WHERE fs_obj_id = " + fs.getId()
|
||||
+ " AND (" + extensionsLikePredicate + ")"
|
||||
+ " AND (known != " + FileKnown.KNOWN.toLong() + ")";
|
||||
+ " AND (known != " + FileKnown.KNOWN.toLong() + ")"
|
||||
+ " AND (meta_type = " + TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG.getMetaType() + ")"
|
||||
+ " AND (size > 0)";
|
||||
try {
|
||||
ResultSet rs = sc.runQuery(query);
|
||||
return sc.resultSetToFsContents(rs);
|
||||
@ -97,6 +100,4 @@ class GetIngestableFilesContentVisitor extends GetFilesContentVisitor {
|
||||
return Collections.EMPTY_SET;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
0
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexContentFilesAction.java
Normal file → Executable file
0
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/IndexContentFilesAction.java
Normal file → Executable file
2
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Ingester.java
Normal file → Executable file
2
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Ingester.java
Normal file → Executable file
@ -25,6 +25,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.logging.Level;
|
||||
import org.apache.solr.client.solrj.SolrServer;
|
||||
import org.apache.solr.client.solrj.SolrServerException;
|
||||
import org.apache.solr.client.solrj.request.AbstractUpdateRequest;
|
||||
@ -113,6 +114,7 @@ class Ingester {
|
||||
setFields(up, fields);
|
||||
up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
|
||||
|
||||
logger.log(Level.INFO, "Ingesting " + fields.get("file_name"));
|
||||
up.setParam("commit", "false");
|
||||
|
||||
try {
|
||||
|
5
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java
Normal file → Executable file
5
KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java
Normal file → Executable file
@ -306,8 +306,7 @@ class Server {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
logger.log(Level.INFO, e.paramString());
|
||||
}
|
||||
|
||||
logger.log(Level.INFO, e.paramString().trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user