mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
modifications for executing the external cmd
This commit is contained in:
parent
cca3619bc4
commit
603fa21d04
@ -92,13 +92,16 @@ public class ExternalResultsIngestModule extends IngestModuleAdapter implements
|
||||
|
||||
try {
|
||||
dataSourcePath = dataSource.getUniquePath();
|
||||
String foo[] = dataSource.getImage().getPaths();
|
||||
} catch (TskCoreException ex) {
|
||||
String msgstr = NbBundle.getMessage(this.getClass(), "ExternalResultsIngestModule.process.exception.datasourcepath");
|
||||
logger.log(Level.SEVERE, msgstr);
|
||||
return ProcessResult.ERROR;
|
||||
}
|
||||
|
||||
///@todo get cmdName
|
||||
///@todo get cmdName and cmdPath
|
||||
cmdName = "cmd /c start xmltest.bat";
|
||||
cmdPath = "";
|
||||
|
||||
// Run
|
||||
if (refCounter.get(jobId) == 1) {
|
||||
@ -143,18 +146,19 @@ public class ExternalResultsIngestModule extends IngestModuleAdapter implements
|
||||
cmdSb.append(cmdArgs[i]).append(" ");
|
||||
}
|
||||
|
||||
File workingDir = new File(cmdPath);
|
||||
//File workingDirFile = new File(cmdPath);
|
||||
//run exe, passing the data source path and the import (results) path
|
||||
logger.log(Level.INFO, "Starting external command using: " + cmdSb.toString()); //NON-NLS
|
||||
ExecUtil executor = new ExecUtil();
|
||||
executor.execute(cmdArgs[0], cmdArgs[1], cmdArgs[2]);
|
||||
logger.log(Level.INFO, "Finished running external command."); //NON-NLS
|
||||
|
||||
|
||||
progressBar.progress(1);
|
||||
|
||||
// execution is done, look for results to import
|
||||
ExternalResultsXML parser = new ExternalResultsXML(importPath);
|
||||
ExternalResultsUtility.importResults(parser);
|
||||
//ExternalResultsXML parser = new ExternalResultsXML(importPath);
|
||||
//ExternalResultsUtility.importResults(parser);
|
||||
progressBar.progress(1);
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
package org.sleuthkit.autopsy.modules.externalresults;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
@ -58,7 +59,7 @@ public class ExternalResultsXML implements ExternalResultsParser {
|
||||
private static final String TYPE_ATTR = "type"; //NON-NLS
|
||||
private static final String NAME_ATTR = "name"; //NON-NLS
|
||||
|
||||
private String reportPath;
|
||||
private String reportFilePath;
|
||||
private ResultsData resultsData = null;
|
||||
|
||||
/**
|
||||
@ -66,7 +67,8 @@ public class ExternalResultsXML implements ExternalResultsParser {
|
||||
* @param reportPath
|
||||
*/
|
||||
ExternalResultsXML(String reportPath) {
|
||||
this.reportPath = reportPath;
|
||||
///@todo find an xml file to parse
|
||||
reportFilePath = reportPath + File.separator + "ext-test1.xml";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,7 +80,7 @@ public class ExternalResultsXML implements ExternalResultsParser {
|
||||
resultsData = new ResultsData();
|
||||
try
|
||||
{
|
||||
final Document doc = XMLUtil.loadDoc(ExternalResultsXML.class, reportPath, XSDFILE);
|
||||
final Document doc = XMLUtil.loadDoc(ExternalResultsXML.class, reportFilePath, XSDFILE);
|
||||
if (doc == null) {
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user