mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
file association works now
This commit is contained in:
parent
a1b25bd900
commit
4bfc6ad8af
@ -78,7 +78,7 @@ public class ExternalResultsIngestModule extends IngestModuleAdapter implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
///@todo use a standard name or search for an XML file
|
///@todo use a standard name or search for an XML file
|
||||||
importFilePath = importPath + File.separator + "ext-test5.xml";
|
importFilePath = importPath + File.separator + "ext-test6.xml";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.Exceptions;
|
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestServices;
|
import org.sleuthkit.autopsy.ingest.IngestServices;
|
||||||
@ -99,13 +98,19 @@ public class ExternalResultsUtility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// get associated file (if any) to use as the content
|
// Get associated file (if any) to use as the content obj to attach the artifact to
|
||||||
Content currContent = null;
|
Content currContent = null;
|
||||||
|
|
||||||
//for (String filePath : art.files) {
|
|
||||||
if (art.files.size() > 0) {
|
if (art.files.size() > 0) {
|
||||||
String filePath = art.files.get(0).path;
|
String filePath = art.files.get(0).path;
|
||||||
List<AbstractFile> files = Case.getCurrentCase().getSleuthkitCase().findFiles(defaultDataSource, filePath);
|
String fileName = filePath;
|
||||||
|
String parentPath = "";
|
||||||
|
int charPos = filePath.lastIndexOf("/");
|
||||||
|
if (charPos > 0) {
|
||||||
|
fileName = filePath.substring(charPos + 1);
|
||||||
|
parentPath = filePath.substring(0, charPos + 1);
|
||||||
|
}
|
||||||
|
String whereQuery = "name='" + fileName + "' AND parent_path='" + parentPath + "'"; //NON-NLS
|
||||||
|
List<AbstractFile> files = Case.getCurrentCase().getSleuthkitCase().findAllFilesWhere(whereQuery);
|
||||||
if (files.size() > 0) {
|
if (files.size() > 0) {
|
||||||
currContent = files.get(0);
|
currContent = files.get(0);
|
||||||
if (files.size() > 1) {
|
if (files.size() > 1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user