mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
format files and remove commented code
format files and remove commented code
This commit is contained in:
parent
b04622d308
commit
641bdab2c4
@ -205,6 +205,7 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
* Find the files to process that will be processed by the iLeapp program
|
* Find the files to process that will be processed by the iLeapp program
|
||||||
*
|
*
|
||||||
* @param dataSource
|
* @param dataSource
|
||||||
|
*
|
||||||
* @return List of abstract files to process.
|
* @return List of abstract files to process.
|
||||||
*/
|
*/
|
||||||
private List<AbstractFile> findiLeappFilesToProcess(Content dataSource) {
|
private List<AbstractFile> findiLeappFilesToProcess(Content dataSource) {
|
||||||
@ -270,8 +271,8 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
"ILeappAnalyserIngestModule.error.reading.iLeapp.directory=Error reading iLeapp Output directory."})
|
"ILeappAnalyserIngestModule.error.reading.iLeapp.directory=Error reading iLeapp Output directory."})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find the tsv files in the iLeapp output directory and match them to files we know we want to process
|
* Find the tsv files in the iLeapp output directory and match them to files
|
||||||
* and return the list to process those files.
|
* we know we want to process and return the list to process those files.
|
||||||
*/
|
*/
|
||||||
private List<String> findTsvFiles(Path iLeapOutputDir) throws IngestModuleException {
|
private List<String> findTsvFiles(Path iLeapOutputDir) throws IngestModuleException {
|
||||||
List<String> allTsvFiles = new ArrayList<>();
|
List<String> allTsvFiles = new ArrayList<>();
|
||||||
@ -298,9 +299,11 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the iLeapp files that were found that match the xml mapping file
|
* Process the iLeapp files that were found that match the xml mapping file
|
||||||
|
*
|
||||||
* @param iLeappFilesToProcess List of files to process
|
* @param iLeappFilesToProcess List of files to process
|
||||||
* @param iLeappImageFile Abstract file to create artifact for
|
* @param iLeappImageFile Abstract file to create artifact for
|
||||||
* @param statusHelper progress bar update
|
* @param statusHelper progress bar update
|
||||||
|
*
|
||||||
* @throws FileNotFoundException
|
* @throws FileNotFoundException
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
@ -311,7 +314,6 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
String fileName = FilenameUtils.getName(iLeappFileName);
|
String fileName = FilenameUtils.getName(iLeappFileName);
|
||||||
statusHelper.progress(NbBundle.getMessage(this.getClass(), "ILeappAnalyserIngestModule.parsing.file", fileName));
|
statusHelper.progress(NbBundle.getMessage(this.getClass(), "ILeappAnalyserIngestModule.parsing.file", fileName));
|
||||||
File iLeappFile = new File(iLeappFileName);
|
File iLeappFile = new File(iLeappFileName);
|
||||||
// List<List<String>> attrList = new ArrayList<>();
|
|
||||||
if (tsvFileAttributes.containsKey(fileName)) {
|
if (tsvFileAttributes.containsKey(fileName)) {
|
||||||
List<List<String>> attrList = tsvFileAttributes.get(fileName);
|
List<List<String>> attrList = tsvFileAttributes.get(fileName);
|
||||||
try {
|
try {
|
||||||
@ -324,7 +326,6 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
HashMap<Integer, String> columnNumberToProcess = findColumnsToProcess(line, attrList);
|
HashMap<Integer, String> columnNumberToProcess = findColumnsToProcess(line, attrList);
|
||||||
line = reader.readLine();
|
line = reader.readLine();
|
||||||
while (line != null) {
|
while (line != null) {
|
||||||
// Collection<BlackboardAttribute> bbattributes = new ArrayList<BlackboardAttribute>();
|
|
||||||
Collection<BlackboardAttribute> bbattributes = processReadLine(line, columnNumberToProcess, fileName);
|
Collection<BlackboardAttribute> bbattributes = processReadLine(line, columnNumberToProcess, fileName);
|
||||||
if (!bbattributes.isEmpty()) {
|
if (!bbattributes.isEmpty()) {
|
||||||
BlackboardArtifact bbartifact = createArtifactWithAttributes(artifactType.getTypeID(), iLeappImageFile, bbattributes);
|
BlackboardArtifact bbartifact = createArtifactWithAttributes(artifactType.getTypeID(), iLeappImageFile, bbattributes);
|
||||||
@ -352,8 +353,10 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the line read and create the necessary attributes for it
|
* Process the line read and create the necessary attributes for it
|
||||||
|
*
|
||||||
* @param line a tsv line to process that was read
|
* @param line a tsv line to process that was read
|
||||||
* @param columnNumberToProcess Which columns to process in the tsv line
|
* @param columnNumberToProcess Which columns to process in the tsv line
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private Collection<BlackboardAttribute> processReadLine(String line, HashMap<Integer, String> columnNumberToProcess, String fileName) throws IngestModuleException {
|
private Collection<BlackboardAttribute> processReadLine(String line, HashMap<Integer, String> columnNumberToProcess, String fileName) throws IngestModuleException {
|
||||||
@ -416,11 +419,15 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the first line of the tsv file which has the headings. Match the headings to the columns in the XML
|
* Process the first line of the tsv file which has the headings. Match the
|
||||||
* mapping file so we know which columns to process.
|
* headings to the columns in the XML mapping file so we know which columns
|
||||||
|
* to process.
|
||||||
|
*
|
||||||
* @param line a tsv heading line of the columns in the file
|
* @param line a tsv heading line of the columns in the file
|
||||||
* @param attrList the list of headings we want to process
|
* @param attrList the list of headings we want to process
|
||||||
* @return the numbered column(s) and attribute(s) we want to use for the column(s)
|
*
|
||||||
|
* @return the numbered column(s) and attribute(s) we want to use for the
|
||||||
|
* column(s)
|
||||||
*/
|
*/
|
||||||
private HashMap<Integer, String> findColumnsToProcess(String line, List<List<String>> attrList) {
|
private HashMap<Integer, String> findColumnsToProcess(String line, List<List<String>> attrList) {
|
||||||
String[] columnNames = line.split("\\t");
|
String[] columnNames = line.split("\\t");
|
||||||
@ -458,7 +465,6 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
try {
|
try {
|
||||||
String path = PlatformUtil.getUserConfigDirectory() + File.separator + XMLFILE;
|
String path = PlatformUtil.getUserConfigDirectory() + File.separator + XMLFILE;
|
||||||
File f = new File(path);
|
File f = new File(path);
|
||||||
logger.log(Level.INFO, "Load successful"); //NON-NLS
|
|
||||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||||
xmlinput = db.parse(f);
|
xmlinput = db.parse(f);
|
||||||
@ -526,11 +532,12 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
*
|
*
|
||||||
* @param type is a blackboard.artifact_type enum to determine which
|
* @param type is a blackboard.artifact_type enum to determine which
|
||||||
* type the artifact should be
|
* type the artifact should be
|
||||||
* @param content is the Content object that needs to have the
|
* @param content is the Content object that needs to have the artifact
|
||||||
* artifact added for it
|
* added for it
|
||||||
* @param bbattributes is the collection of blackboard attributes that need
|
* @param bbattributes is the collection of blackboard attributes that need
|
||||||
* to be added to the artifact after the artifact has
|
* to be added to the artifact after the artifact has
|
||||||
* been created
|
* been created
|
||||||
|
*
|
||||||
* @return The newly-created artifact, or null on error
|
* @return The newly-created artifact, or null on error
|
||||||
*/
|
*/
|
||||||
protected BlackboardArtifact createArtifactWithAttributes(int type, AbstractFile abstractFile, Collection<BlackboardAttribute> bbattributes) {
|
protected BlackboardArtifact createArtifactWithAttributes(int type, AbstractFile abstractFile, Collection<BlackboardAttribute> bbattributes) {
|
||||||
@ -547,7 +554,8 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
/**
|
/**
|
||||||
* Method to post a list of BlackboardArtifacts to the blackboard.
|
* Method to post a list of BlackboardArtifacts to the blackboard.
|
||||||
*
|
*
|
||||||
* @param artifacts A list of artifacts. IF list is empty or null, the function will return.
|
* @param artifacts A list of artifacts. IF list is empty or null, the
|
||||||
|
* function will return.
|
||||||
*/
|
*/
|
||||||
void postArtifacts(Collection<BlackboardArtifact> artifacts) {
|
void postArtifacts(Collection<BlackboardArtifact> artifacts) {
|
||||||
if (artifacts == null || artifacts.isEmpty()) {
|
if (artifacts == null || artifacts.isEmpty()) {
|
||||||
@ -577,5 +585,4 @@ public class ILeappAnalyserIngestModule implements DataSourceIngestModule {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,8 @@ import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter;
|
|||||||
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A factory that creates data source ingest modules that will run iLeapp against
|
* A factory that creates data source ingest modules that will run iLeapp
|
||||||
* logical files and saves the output to module output.
|
* against logical files and saves the output to module output.
|
||||||
*/
|
*/
|
||||||
@ServiceProvider(service = IngestModuleFactory.class)
|
@ServiceProvider(service = IngestModuleFactory.class)
|
||||||
public class ILeappAnalyserModuleFactory extends IngestModuleFactoryAdapter {
|
public class ILeappAnalyserModuleFactory extends IngestModuleFactoryAdapter {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user