diff --git a/iped-app/src/main/java/iped/app/ui/ColumnsManager.java b/iped-app/src/main/java/iped/app/ui/ColumnsManager.java index ecb7dbe39b..9a479c2d51 100644 --- a/iped-app/src/main/java/iped/app/ui/ColumnsManager.java +++ b/iped-app/src/main/java/iped/app/ui/ColumnsManager.java @@ -94,7 +94,10 @@ private static final File getGlobalColsFile() { File moduleDir; private File caseCols; - private File reportCols; + + private static final String SELECTED_PROPERTIES_FILENAME = "data/reportProps.dat"; + + private File reportPropsFile; String[] indexFields = null; @@ -150,10 +153,10 @@ static class ColumnState implements Serializable { protected void saveReportSelectedProps() { try { - Set reportProps = new HashSet<>(); - reportProps.addAll(getSelectedProperties()); - if (reportProps.size() > 0) { - Util.writeObject(reportProps, reportCols.getAbsolutePath()); + Set reportPropsSet = new HashSet<>(); + reportPropsSet.addAll(getSelectedProperties()); + if (reportPropsSet.size() > 0) { + Util.writeObject(reportPropsSet, reportPropsFile.getAbsolutePath()); } } catch (Exception e1) { e1.printStackTrace(); @@ -188,7 +191,7 @@ protected ColumnsManager() { autoManageCols = analysisConfig.isAutoManageCols(); moduleDir = App.get().appCase.getAtomicSourceBySourceId(0).getModuleDir(); - reportCols = new File(moduleDir, "reportCols.dat"); + reportPropsFile = new File(moduleDir, SELECTED_PROPERTIES_FILENAME); updateDinamicFields(); @@ -246,9 +249,9 @@ private void loadSavedCols() { protected ArrayList loadReportSelectedFields() { Set columnsReport = new HashSet<>(); ArrayList selectedFields = null; - if (reportCols.exists()) { + if (reportPropsFile.exists()) { try { - columnsReport = (Set) Util.readObject(reportCols.getAbsolutePath()); + columnsReport = (Set) Util.readObject(reportPropsFile.getAbsolutePath()); } catch (ClassNotFoundException | IOException e) { e.printStackTrace(); } diff --git a/iped-engine/src/main/java/iped/engine/task/HTMLReportTask.java b/iped-engine/src/main/java/iped/engine/task/HTMLReportTask.java index f572983669..9b1e21b32d 100644 --- a/iped-engine/src/main/java/iped/engine/task/HTMLReportTask.java +++ b/iped-engine/src/main/java/iped/engine/task/HTMLReportTask.java @@ -32,7 +32,6 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; -import java.io.Serializable; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -101,6 +100,8 @@ public class HTMLReportTask extends AbstractTask { private static final String propNamePlaceHolder = "%PROPERTY_NAME%"; private static final String propValuePlaceHolder = "%PROPERTY_VALUE%"; + private static final String SELECTED_PROPERTIES_FILENAME = "data/reportProps.dat"; + private static final List basicReportProps = Arrays.asList(BasicProps.NAME, BasicProps.PATH, BasicProps.TYPE, BasicProps.LENGTH, BasicProps.CREATED, BasicProps.MODIFIED, BasicProps.ACCESSED, BasicProps.DELETED, BasicProps.CARVED, BasicProps.HASH, IndexItem.ID_IN_SOURCE); @@ -215,7 +216,7 @@ public List> getConfigurables() { } protected ArrayList loadReportSelectedProps() { - File reportCols = new File(Configuration.getInstance().appRoot, "reportCols.dat"); + File reportCols = new File(Configuration.getInstance().appRoot, SELECTED_PROPERTIES_FILENAME); Set columnsReport = new HashSet<>(); ArrayList selectedFields = null; @@ -401,8 +402,6 @@ protected void process(IItem evidence) throws Exception { reg.path = evidence.getPath(); reg.evidenceId = evidence.getId(); - // reg.evidenceId = ipedCase.getLuceneId(evidence.getId()); - // reg.evidenceId = ipedCase.getLuceneId(new ItemId(0, evidence.getId())); Set categories = evidence.getCategorySet(); categories = categories.stream().map(c -> CategoryLocalization.getInstance().getLocalizedCategory(c.trim()))