mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 08:26:15 +00:00
Merge branch 'master' into new-features-20120503
Conflicts: KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestService.java
This commit is contained in:
commit
708dbd63ee
@ -1,8 +1,8 @@
|
|||||||
build.xml.data.CRC32=ec4b156b
|
build.xml.data.CRC32=656aafec
|
||||||
build.xml.script.CRC32=1308cb72
|
build.xml.script.CRC32=1308cb72
|
||||||
build.xml.stylesheet.CRC32=a56c6a5b@1.46.2
|
build.xml.stylesheet.CRC32=a56c6a5b@2.47.2
|
||||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
nbproject/build-impl.xml.data.CRC32=ec4b156b
|
nbproject/build-impl.xml.data.CRC32=656aafec
|
||||||
nbproject/build-impl.xml.script.CRC32=a7a0d07a
|
nbproject/build-impl.xml.script.CRC32=a7a0d07a
|
||||||
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@1.46.2
|
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.47.2
|
||||||
|
@ -18,9 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.keywordsearch;
|
package org.sleuthkit.autopsy.keywordsearch;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import org.openide.util.Exceptions;
|
|
||||||
import org.sleuthkit.autopsy.datamodel.FsContentStringStream;
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -28,6 +26,7 @@ import java.util.Collection;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.CancellationException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.swing.SwingWorker;
|
import javax.swing.SwingWorker;
|
||||||
@ -76,12 +75,10 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
private Map<Keyword, List<ContentHit>> currentResults;
|
private Map<Keyword, List<ContentHit>> currentResults;
|
||||||
private volatile int messageID = 0;
|
private volatile int messageID = 0;
|
||||||
private boolean processedFiles;
|
private boolean processedFiles;
|
||||||
private volatile boolean finalRun = false;
|
|
||||||
private volatile boolean finalRunComplete = false;
|
private volatile boolean finalRunComplete = false;
|
||||||
private final String hashDBServiceName = "Hash Lookup";
|
private final String hashDBServiceName = "Hash Lookup";
|
||||||
private SleuthkitCase caseHandle = null;
|
private SleuthkitCase caseHandle = null;
|
||||||
boolean initialized = false;
|
boolean initialized = false;
|
||||||
private final byte[] STRING_CHUNK_BUF = new byte[(int) MAX_STRING_CHUNK_SIZE];
|
|
||||||
|
|
||||||
public enum IngestStatus {
|
public enum IngestStatus {
|
||||||
|
|
||||||
@ -167,8 +164,7 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
updateKeywords();
|
updateKeywords();
|
||||||
//run one last search as there are probably some new files committed
|
//run one last search as there are probably some new files committed
|
||||||
if (keywords != null && !keywords.isEmpty() && processedFiles == true) {
|
if (keywords != null && !keywords.isEmpty() && processedFiles == true) {
|
||||||
finalRun = true;
|
searcher = new Searcher(keywords, true); //final searcher run
|
||||||
searcher = new Searcher(keywords);
|
|
||||||
searcher.execute();
|
searcher.execute();
|
||||||
} else {
|
} else {
|
||||||
finalRunComplete = true;
|
finalRunComplete = true;
|
||||||
@ -232,7 +228,6 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
}
|
}
|
||||||
|
|
||||||
processedFiles = false;
|
processedFiles = false;
|
||||||
finalRun = false;
|
|
||||||
finalRunComplete = false;
|
finalRunComplete = false;
|
||||||
searcherDone = true; //make sure to start the initial searcher
|
searcherDone = true; //make sure to start the initial searcher
|
||||||
//keeps track of all results per run not to repeat reporting the same hits
|
//keeps track of all results per run not to repeat reporting the same hits
|
||||||
@ -515,11 +510,17 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
private List<Keyword> keywords;
|
private List<Keyword> keywords;
|
||||||
private ProgressHandle progress;
|
private ProgressHandle progress;
|
||||||
private final Logger logger = Logger.getLogger(Searcher.class.getName());
|
private final Logger logger = Logger.getLogger(Searcher.class.getName());
|
||||||
|
private boolean finalRun = false;
|
||||||
|
|
||||||
Searcher(List<Keyword> keywords) {
|
Searcher(List<Keyword> keywords) {
|
||||||
this.keywords = keywords;
|
this.keywords = keywords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Searcher(List<Keyword> keywords, boolean finalRun) {
|
||||||
|
this(keywords);
|
||||||
|
this.finalRun = finalRun;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object doInBackground() throws Exception {
|
protected Object doInBackground() throws Exception {
|
||||||
logger.log(Level.INFO, "Starting new searcher");
|
logger.log(Level.INFO, "Starting new searcher");
|
||||||
@ -573,6 +574,9 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
//or wait for recovery to kick in and run again later
|
//or wait for recovery to kick in and run again later
|
||||||
//likely case has closed and threads are being interrupted
|
//likely case has closed and threads are being interrupted
|
||||||
return null;
|
return null;
|
||||||
|
} catch (CancellationException e) {
|
||||||
|
logger.log(Level.INFO, "Cancel detected, bailing during keyword query: " + keywordQuery.getQuery());
|
||||||
|
return null;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.log(Level.WARNING, "Error performing query: " + keywordQuery.getQuery(), e);
|
logger.log(Level.WARNING, "Error performing query: " + keywordQuery.getQuery(), e);
|
||||||
continue;
|
continue;
|
||||||
@ -728,7 +732,12 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void done() {
|
protected void done() {
|
||||||
super.done();
|
try {
|
||||||
|
super.get(); //block and get all exceptions thrown while doInBackground()
|
||||||
|
|
||||||
|
} catch (Exception ex) {
|
||||||
|
logger.log(Level.WARNING, "Searcher exceptions occurred, while in background. ", ex);
|
||||||
|
} finally {
|
||||||
searcherDone = true; //next searcher can start
|
searcherDone = true; //next searcher can start
|
||||||
|
|
||||||
progress.finish();
|
progress.finish();
|
||||||
@ -744,6 +753,7 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//check if fscontent already hit, ignore chunks
|
//check if fscontent already hit, ignore chunks
|
||||||
private static boolean previouslyHit(List<ContentHit> contents, ContentHit hit) {
|
private static boolean previouslyHit(List<ContentHit> contents, ContentHit hit) {
|
||||||
|
@ -98,7 +98,6 @@ public interface KeywordSearchQuery {
|
|||||||
* @param snippet snippet preview with hit context, or null if there is no snippet
|
* @param snippet snippet preview with hit context, or null if there is no snippet
|
||||||
* @param listName listname
|
* @param listName listname
|
||||||
* @return collection of results (with cached bb artifacts/attributes) created and written
|
* @return collection of results (with cached bb artifacts/attributes) created and written
|
||||||
* @throws NoOpenCoreException if could not write to bb because required query failed due to server error, this could be a notification to stop processing
|
|
||||||
*/
|
*/
|
||||||
public KeywordWriteResult writeToBlackBoard(String termHit, FsContent newFsHit, String snippet, String listName);
|
public KeywordWriteResult writeToBlackBoard(String termHit, FsContent newFsHit, String snippet, String listName);
|
||||||
|
|
||||||
|
@ -11,3 +11,5 @@ ReportPanel.jLabel1.text=jLabel1
|
|||||||
ReportPanel.saveReport.actionCommand=
|
ReportPanel.saveReport.actionCommand=
|
||||||
ReportPanel.saveReport.text=Export Report...
|
ReportPanel.saveReport.text=Export Report...
|
||||||
ReportPanel.jButton1.text=Close
|
ReportPanel.jButton1.text=Close
|
||||||
|
ReportFilter.updateLabel.toolTipText=
|
||||||
|
ReportFilter.updateLabel.text=
|
||||||
|
@ -50,49 +50,49 @@ public class Report {
|
|||||||
Case currentCase = Case.getCurrentCase(); // get the most updated case
|
Case currentCase = Case.getCurrentCase(); // get the most updated case
|
||||||
SleuthkitCase tempDb = currentCase.getSleuthkitCase();
|
SleuthkitCase tempDb = currentCase.getSleuthkitCase();
|
||||||
try {
|
try {
|
||||||
ReportUtils util = new ReportUtils();
|
tempDb.copyCaseDB(currentCase.getTempDirectory() + File.separator + "autopsy-copy.db");
|
||||||
util.copy(new FileInputStream(currentCase.getCaseDirectory()+File.separator+"autopsy.db"), new FileOutputStream(currentCase.getCaseDirectory()+File.separator+"autopsy-copy.db"));
|
dbconnect tempdbconnect = new dbconnect("org.sqlite.JDBC", "jdbc:sqlite:" + currentCase.getTempDirectory() + File.separator + "autopsy-copy.db");
|
||||||
dbconnect tempdbconnect = new dbconnect("org.sqlite.JDBC", "jdbc:sqlite:"+currentCase.getCaseDirectory()+File.separator+"autopsy-copy.db");
|
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_keyword;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_keyword;");
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_preview;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_preview;");
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_exp;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_exp;");
|
||||||
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_list;");
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_name;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_name;");
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report;");
|
||||||
String temp1 = "CREATE TABLE report_keyword AS SELECT value_text as keyword,blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = 10;";
|
String temp1 = "CREATE TABLE report_keyword AS SELECT value_text as keyword,blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = 10;";
|
||||||
String temp2 = "CREATE TABLE report_preview AS SELECT value_text as preview, blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = 11;";
|
String temp2 = "CREATE TABLE report_preview AS SELECT value_text as preview, blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = 12;";
|
||||||
String temp3 = "CREATE TABLE report_exp AS SELECT value_text as exp, blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = 12;";
|
String temp3 = "CREATE TABLE report_exp AS SELECT value_text as exp, blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = 11;";
|
||||||
String temp4 = "CREATE TABLE report_name AS SELECT name, report_keyword.artifact_id from tsk_files,blackboard_artifacts, report_keyword WHERE blackboard_artifacts.artifact_id = report_keyword.artifact_id AND blackboard_artifacts.obj_id = tsk_files.obj_id;";
|
String temp4 = "CREATE TABLE report_list AS SELECT value_text as list, blackboard_attributes.attribute_type_id, blackboard_attributes.artifact_id FROM blackboard_attributes WHERE attribute_type_id = 13;";
|
||||||
String temp5 = "CREATE TABLE report AS SELECT keyword,preview,exp, name from report_keyword INNER JOIN report_preview ON report_keyword.artifact_id=report_preview.artifact_id INNER JOIN report_exp ON report_preview.artifact_id=report_exp.artifact_id INNER JOIN report_name ON report_exp.artifact_id=report_name.artifact_id;";
|
String temp5 = "CREATE TABLE report_name AS SELECT name, report_keyword.artifact_id from tsk_files,blackboard_artifacts, report_keyword WHERE blackboard_artifacts.artifact_id = report_keyword.artifact_id AND blackboard_artifacts.obj_id = tsk_files.obj_id;";
|
||||||
|
String temp6 = "CREATE TABLE report AS SELECT keyword,preview,exp,list,name from report_keyword INNER JOIN report_preview ON report_keyword.artifact_id=report_preview.artifact_id INNER JOIN report_exp ON report_preview.artifact_id=report_exp.artifact_id INNER JOIN report_list ON report_exp.artifact_id=report_list.artifact_id INNER JOIN report_name ON report_list.artifact_id=report_name.artifact_id;";
|
||||||
tempdbconnect.executeStmt(temp1);
|
tempdbconnect.executeStmt(temp1);
|
||||||
tempdbconnect.executeStmt(temp2);
|
tempdbconnect.executeStmt(temp2);
|
||||||
tempdbconnect.executeStmt(temp3);
|
tempdbconnect.executeStmt(temp3);
|
||||||
tempdbconnect.executeStmt(temp4);
|
tempdbconnect.executeStmt(temp4);
|
||||||
tempdbconnect.executeStmt(temp5);
|
tempdbconnect.executeStmt(temp5);
|
||||||
ResultSet uniqueresults = tempdbconnect.executeQry("SELECT keyword, preview, exp, name FROM report ORDER BY keyword ASC");
|
tempdbconnect.executeStmt(temp6);
|
||||||
|
ResultSet uniqueresults = tempdbconnect.executeQry("SELECT keyword, exp, preview, list, name FROM report ORDER BY keyword ASC");
|
||||||
String keyword = "";
|
String keyword = "";
|
||||||
while (uniqueresults.next()) {
|
while (uniqueresults.next()) {
|
||||||
if(uniqueresults.getString("keyword") == null ? keyword == null : uniqueresults.getString("keyword").equals(keyword))
|
if (uniqueresults.getString("keyword") == null ? keyword == null : uniqueresults.getString("keyword").equals(keyword)) {
|
||||||
{
|
} else {
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
table.append("</tbody></table><br /><br />");
|
table.append("</tbody></table><br /><br />");
|
||||||
keyword = uniqueresults.getString("keyword");
|
keyword = uniqueresults.getString("keyword");
|
||||||
table.append("<strong>").append(keyword).append("</strong>");
|
table.append("<strong>").append(keyword).append("</strong>");
|
||||||
table.append("<table><thead><tr><th>").append("File Name").append("</th><th>Preview</th><th>Keyword List</th></tr><tbody>");
|
table.append("<table><thead><tr><th>").append("File Name").append("</th><th>Preview</th><th>Keyword List</th></tr><tbody>");
|
||||||
}
|
}
|
||||||
table.append("<tr><td>").append(uniqueresults.getString("name")).append("</td>");
|
table.append("<tr><td>").append(uniqueresults.getString("name")).append("</td>");
|
||||||
table.append("<td>").append(uniqueresults.getString("preview")).append("</td>").append("<td>").append(uniqueresults.getString("exp")).append("</td>").append("</tr>");
|
table.append("<td>").append(uniqueresults.getString("preview")).append("</td>").append("<td>").append(uniqueresults.getString("list")).append("<br />(").append(uniqueresults.getString("exp")).append(")").append("</td>").append("</tr>");
|
||||||
|
|
||||||
}
|
}
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_keyword;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_keyword;");
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_preview;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_preview;");
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_exp;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_exp;");
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_name;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_name;");
|
||||||
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report_list;");
|
||||||
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report;");
|
tempdbconnect.executeStmt("DROP TABLE IF EXISTS report;");
|
||||||
tempdbconnect.closeConnection();
|
tempdbconnect.closeConnection();
|
||||||
|
|
||||||
File f1 = new File(currentCase.getCaseDirectory()+File.separator+"autopsy-copy.db");
|
File f1 = new File(currentCase.getTempDirectory() + File.separator + "autopsy-copy.db");
|
||||||
boolean success = f1.delete();
|
boolean success = f1.delete();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -140,7 +140,7 @@ public final class ReportAction extends CallableSystemAction implements Presente
|
|||||||
Object source = e.getItem();
|
Object source = e.getItem();
|
||||||
JCheckBox comp = (JCheckBox) source;
|
JCheckBox comp = (JCheckBox) source;
|
||||||
String name = comp.getName();
|
String name = comp.getName();
|
||||||
BlackboardArtifact.ARTIFACT_TYPE type = BlackboardArtifact.ARTIFACT_TYPE.valueOf(name);
|
BlackboardArtifact.ARTIFACT_TYPE type = BlackboardArtifact.ARTIFACT_TYPE.fromLabel(name);
|
||||||
if (e.getStateChange() == ItemEvent.DESELECTED) {
|
if (e.getStateChange() == ItemEvent.DESELECTED) {
|
||||||
try {
|
try {
|
||||||
config.setGenArtifactType(type, Boolean.FALSE);
|
config.setGenArtifactType(type, Boolean.FALSE);
|
||||||
@ -202,7 +202,7 @@ public final class ReportAction extends CallableSystemAction implements Presente
|
|||||||
reportList.clear();
|
reportList.clear();
|
||||||
config = new ReportConfiguration();
|
config = new ReportConfiguration();
|
||||||
final JPanel filterpanel = new JPanel(new GridLayout(0, 2, 5, 5));
|
final JPanel filterpanel = new JPanel(new GridLayout(0, 2, 5, 5));
|
||||||
final JPanel artpanel = new JPanel(new GridLayout(0, 3, 5, 5));
|
final JPanel artpanel = new JPanel(new GridLayout(0, 3, 0, 0));
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -239,12 +239,13 @@ public final class ReportAction extends CallableSystemAction implements Presente
|
|||||||
artpanel.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
|
artpanel.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
|
||||||
artpanel.setAlignmentY(Component.TOP_ALIGNMENT);
|
artpanel.setAlignmentY(Component.TOP_ALIGNMENT);
|
||||||
artpanel.setAlignmentX(Component.LEFT_ALIGNMENT);
|
artpanel.setAlignmentX(Component.LEFT_ALIGNMENT);
|
||||||
artpanel.setSize(300, 100);
|
artpanel.setPreferredSize(new Dimension(300, 150));
|
||||||
for (BlackboardArtifact.ARTIFACT_TYPE a : panel.config.config.keySet()) {
|
for (BlackboardArtifact.ARTIFACT_TYPE a : ReportFilter.config.config.keySet()) {
|
||||||
JCheckBox ce = new JCheckBox();
|
JCheckBox ce = new JCheckBox();
|
||||||
ce.setText(a.getDisplayName());
|
ce.setText(a.getDisplayName());
|
||||||
ce.setToolTipText(a.getDisplayName());
|
ce.setToolTipText(a.getDisplayName());
|
||||||
ce.setName(a.getLabel());
|
ce.setName(a.getLabel());
|
||||||
|
ce.setPreferredSize(new Dimension(60, 30));
|
||||||
ce.setSelected(true);
|
ce.setSelected(true);
|
||||||
ce.addItemListener(clistener);
|
ce.addItemListener(clistener);
|
||||||
artpanel.add(ce);
|
artpanel.add(ce);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.1" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||||
<NonVisualComponents>
|
<NonVisualComponents>
|
||||||
@ -41,23 +41,27 @@
|
|||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Component id="updateLabel" pref="160" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<Component id="progBar" pref="221" max="32767" attributes="0"/>
|
<Component id="progBar" pref="220" max="32767" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
|
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="updateLabel" alignment="3" pref="23" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
<Component id="cancelButton" max="32767" attributes="0"/>
|
<Component id="cancelButton" max="32767" attributes="0"/>
|
||||||
@ -111,5 +115,15 @@
|
|||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="updateLabel">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportFilter.updateLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
|
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportFilter.updateLabel.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -57,9 +57,7 @@ public class ReportFilter extends javax.swing.JPanel {
|
|||||||
try {
|
try {
|
||||||
config.getAllTypes();
|
config.getAllTypes();
|
||||||
|
|
||||||
}
|
} catch (ReportModuleException ex) {
|
||||||
catch(ReportModuleException ex)
|
|
||||||
{
|
|
||||||
Logger.getLogger(Report.class.getName()).log(Level.SEVERE, "Exception occurred", ex);
|
Logger.getLogger(Report.class.getName()).log(Level.SEVERE, "Exception occurred", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -77,6 +75,7 @@ public class ReportFilter extends javax.swing.JPanel {
|
|||||||
progBar = new javax.swing.JProgressBar();
|
progBar = new javax.swing.JProgressBar();
|
||||||
jButton1 = new javax.swing.JButton();
|
jButton1 = new javax.swing.JButton();
|
||||||
cancelButton = new javax.swing.JButton();
|
cancelButton = new javax.swing.JButton();
|
||||||
|
updateLabel = new javax.swing.JLabel();
|
||||||
|
|
||||||
jButton2.setText(org.openide.util.NbBundle.getMessage(ReportFilter.class, "ReportFilter.jButton2.text")); // NOI18N
|
jButton2.setText(org.openide.util.NbBundle.getMessage(ReportFilter.class, "ReportFilter.jButton2.text")); // NOI18N
|
||||||
jButton2.setActionCommand(org.openide.util.NbBundle.getMessage(ReportFilter.class, "ReportFilter.jButton2.actionCommand")); // NOI18N
|
jButton2.setActionCommand(org.openide.util.NbBundle.getMessage(ReportFilter.class, "ReportFilter.jButton2.actionCommand")); // NOI18N
|
||||||
@ -112,6 +111,9 @@ public class ReportFilter extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
updateLabel.setText(org.openide.util.NbBundle.getMessage(ReportFilter.class, "ReportFilter.updateLabel.text")); // NOI18N
|
||||||
|
updateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(ReportFilter.class, "ReportFilter.updateLabel.toolTipText")); // NOI18N
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
@ -121,18 +123,21 @@ public class ReportFilter extends javax.swing.JPanel {
|
|||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(jButton1)
|
.addComponent(jButton1)
|
||||||
.addContainerGap())
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(updateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE))
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(progBar, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)
|
.addComponent(progBar, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(cancelButton)
|
.addComponent(cancelButton)))
|
||||||
.addGap(24, 24, 24))))
|
.addGap(24, 24, 24))
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGap(19, 19, 19)
|
.addGap(19, 19, 19)
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(jButton1)
|
.addComponent(jButton1)
|
||||||
|
.addComponent(updateLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 23, Short.MAX_VALUE))
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||||
.addComponent(cancelButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(cancelButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
@ -156,8 +161,7 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS
|
|||||||
String preview = ReportAction.preview;
|
String preview = ReportAction.preview;
|
||||||
ArrayList<JCheckBox> reportList = ReportAction.reportList;
|
ArrayList<JCheckBox> reportList = ReportAction.reportList;
|
||||||
ArrayList<String> classList = new ArrayList<String>();
|
ArrayList<String> classList = new ArrayList<String>();
|
||||||
for(JCheckBox box : reportList)
|
for (JCheckBox box : reportList) {
|
||||||
{
|
|
||||||
if (box.isSelected()) {
|
if (box.isSelected()) {
|
||||||
classList.add(box.getName());
|
classList.add(box.getName());
|
||||||
|
|
||||||
@ -217,7 +221,6 @@ private void jButton1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:e
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void progBarDone() {
|
public void progBarDone() {
|
||||||
int max = progBar.getMaximum();
|
int max = progBar.getMaximum();
|
||||||
progBar.setValue(max);
|
progBar.setValue(max);
|
||||||
@ -229,6 +232,18 @@ private void jButton1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:e
|
|||||||
progBar.setString("Querying Database for Report Results...");
|
progBar.setString("Querying Database for Report Results...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUpdateLabel(final String text) {
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
updateLabel.setText(text);
|
||||||
|
updateLabel.repaint();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void progBarText() {
|
public void progBarText() {
|
||||||
|
|
||||||
progBar.setString("Populating Report - Please wait...");
|
progBar.setString("Populating Report - Please wait...");
|
||||||
@ -258,12 +273,11 @@ private void jButton1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:e
|
|||||||
jButton2.addActionListener(e);
|
jButton2.addActionListener(e);
|
||||||
cancelButton.addActionListener(e);
|
cancelButton.addActionListener(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private javax.swing.JButton cancelButton;
|
private javax.swing.JButton cancelButton;
|
||||||
private javax.swing.JButton jButton1;
|
private javax.swing.JButton jButton1;
|
||||||
private javax.swing.JButton jButton2;
|
private javax.swing.JButton jButton2;
|
||||||
private javax.swing.JProgressBar progBar;
|
private javax.swing.JProgressBar progBar;
|
||||||
|
private javax.swing.JLabel updateLabel;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ import org.sleuthkit.datamodel.TskData;
|
|||||||
*/
|
*/
|
||||||
public class ReportHTML implements ReportModule {
|
public class ReportHTML implements ReportModule {
|
||||||
//Declare our publically accessible formatted Report, this will change everytime they run a Report
|
//Declare our publically accessible formatted Report, this will change everytime they run a Report
|
||||||
|
|
||||||
public static StringBuilder formatted_Report = new StringBuilder();
|
public static StringBuilder formatted_Report = new StringBuilder();
|
||||||
private static StringBuilder unformatted_header = new StringBuilder();
|
private static StringBuilder unformatted_header = new StringBuilder();
|
||||||
private static StringBuilder formatted_header = new StringBuilder();
|
private static StringBuilder formatted_header = new StringBuilder();
|
||||||
@ -56,7 +57,6 @@ public class ReportHTML implements ReportModule{
|
|||||||
private static ReportHTML instance = null;
|
private static ReportHTML instance = null;
|
||||||
|
|
||||||
ReportHTML() {
|
ReportHTML() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized ReportHTML getDefault() {
|
public static synchronized ReportHTML getDefault() {
|
||||||
@ -272,15 +272,12 @@ public class ReportHTML implements ReportModule{
|
|||||||
try {
|
try {
|
||||||
SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||||
value = sdf.format(new java.util.Date((tempatt.getValueLong())));
|
value = sdf.format(new java.util.Date((tempatt.getValueLong())));
|
||||||
}
|
} catch (Exception ex) {
|
||||||
catch(Exception ex){
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = tempatt.getValueString();
|
value = tempatt.getValueString();
|
||||||
}
|
}
|
||||||
if(value == null || value.isEmpty())
|
if (value == null || value.isEmpty()) {
|
||||||
{
|
|
||||||
value = "";
|
value = "";
|
||||||
}
|
}
|
||||||
value = ReportUtils.insertPeriodically(value, "<br>", 30);
|
value = ReportUtils.insertPeriodically(value, "<br>", 30);
|
||||||
@ -436,17 +433,14 @@ public class ReportHTML implements ReportModule{
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save(String path)
|
public void save(String path) {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), "UTF-8"));
|
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), "UTF-8"));
|
||||||
out.write(formatted_header.toString());
|
out.write(formatted_header.toString());
|
||||||
out.flush();
|
out.flush();
|
||||||
out.close();
|
out.close();
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch(IOException e){
|
|
||||||
Logger.getLogger(ReportHTML.class.getName()).log(Level.SEVERE, "Could not write out HTML report!", e);
|
Logger.getLogger(ReportHTML.class.getName()).log(Level.SEVERE, "Could not write out HTML report!", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,14 +451,17 @@ public class ReportHTML implements ReportModule{
|
|||||||
String type = "HTML";
|
String type = "HTML";
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String getExtension() {
|
||||||
|
String ext = ".html";
|
||||||
|
return ext;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ReportConfiguration GetReportConfiguration() {
|
public ReportConfiguration GetReportConfiguration() {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getReportTypeDescription() {
|
public String getReportTypeDescription() {
|
||||||
String desc = "This is an html formatted report that is meant to be viewed in a modern browser.";
|
String desc = "This is an html formatted report that is meant to be viewed in a modern browser.";
|
||||||
@ -475,7 +472,4 @@ public class ReportHTML implements ReportModule{
|
|||||||
public void getPreview(String path) {
|
public void getPreview(String path) {
|
||||||
BrowserControl.openUrl(path);
|
BrowserControl.openUrl(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -69,11 +69,21 @@ public interface ReportModule {
|
|||||||
*/
|
*/
|
||||||
public String getReportTypeDescription();
|
public String getReportTypeDescription();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calls to the report module to execute a method to display the report that was generated.
|
* Calls to the report module to execute a method to display the report that
|
||||||
|
* was generated.
|
||||||
|
*
|
||||||
* @param String the path to the file
|
* @param String the path to the file
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void getPreview(String path);
|
public void getPreview(String path);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calls to the report module to execute a method to get the extension
|
||||||
|
* that is used for the report
|
||||||
|
*
|
||||||
|
* @return String the extension the file will be saved as
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getExtension();
|
||||||
}
|
}
|
@ -29,15 +29,7 @@
|
|||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<Component id="jLabel1" alignment="0" pref="300" max="32767" attributes="0"/>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace pref="128" max="32767" attributes="0"/>
|
|
||||||
<Component id="saveReport" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@ -45,24 +37,56 @@
|
|||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
|
<EmptySpace pref="165" max="32767" attributes="0"/>
|
||||||
|
<Component id="jPanel1" min="-2" pref="76" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="jLabel1" pref="26" max="32767" attributes="0"/>
|
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
|
||||||
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="saveReport" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JButton" name="jButton1">
|
<Container class="javax.swing.JPanel" name="jPanel1">
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="338" max="32767" attributes="0"/>
|
||||||
|
<Component id="saveReport" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="jLabel1" alignment="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="saveReport" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportPanel.jButton1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
|
<Property name="horizontalTextPosition" type="int" value="2"/>
|
||||||
|
<Property name="verticalTextPosition" type="int" value="1"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="saveReport">
|
<Component class="javax.swing.JButton" name="saveReport">
|
||||||
@ -78,12 +102,14 @@
|
|||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveReportActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveReportActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
<Component class="javax.swing.JButton" name="jButton1">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||||
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportPanel.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
<ResourceString bundle="org/sleuthkit/autopsy/report/Bundle.properties" key="ReportPanel.jButton1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -20,14 +20,18 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.report;
|
package org.sleuthkit.autopsy.report;
|
||||||
|
|
||||||
|
import java.awt.GridBagConstraints;
|
||||||
|
import java.awt.GridBagLayout;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.io.*;
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.swing.JFileChooser;
|
import java.util.HashMap;
|
||||||
import javax.swing.JOptionPane;
|
import java.util.Map;
|
||||||
import org.jdom.output.XMLOutputter;
|
import javax.swing.*;
|
||||||
|
import javax.swing.border.Border;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -35,11 +39,17 @@ import org.jdom.output.XMLOutputter;
|
|||||||
*/
|
*/
|
||||||
public class ReportPanel extends javax.swing.JPanel {
|
public class ReportPanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
|
private ReportPanelAction rpa;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form ReportPanel
|
* Creates new form ReportPanel
|
||||||
*/
|
*/
|
||||||
public ReportPanel() {
|
public ReportPanel(ReportPanelAction reportpanelaction) {
|
||||||
initComponents();
|
initComponents();
|
||||||
|
this.setLayout(new GridLayout(0, 1));
|
||||||
|
Border border = BorderFactory.createTitledBorder("Report Summary");
|
||||||
|
this.setBorder(border);
|
||||||
|
rpa = reportpanelaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,11 +63,14 @@ public class ReportPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
jFileChooser1 = new javax.swing.JFileChooser();
|
jFileChooser1 = new javax.swing.JFileChooser();
|
||||||
jOptionPane1 = new javax.swing.JOptionPane();
|
jOptionPane1 = new javax.swing.JOptionPane();
|
||||||
jButton1 = new javax.swing.JButton();
|
jPanel1 = new javax.swing.JPanel();
|
||||||
saveReport = new javax.swing.JButton();
|
|
||||||
jLabel1 = new javax.swing.JLabel();
|
jLabel1 = new javax.swing.JLabel();
|
||||||
|
saveReport = new javax.swing.JButton();
|
||||||
|
jButton1 = new javax.swing.JButton();
|
||||||
|
|
||||||
jButton1.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jButton1.text")); // NOI18N
|
jLabel1.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel1.text")); // NOI18N
|
||||||
|
jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
|
||||||
|
jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
|
||||||
|
|
||||||
saveReport.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.saveReport.text")); // NOI18N
|
saveReport.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.saveReport.text")); // NOI18N
|
||||||
saveReport.setActionCommand(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.saveReport.actionCommand")); // NOI18N
|
saveReport.setActionCommand(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.saveReport.actionCommand")); // NOI18N
|
||||||
@ -67,31 +80,47 @@ public class ReportPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jLabel1.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jLabel1.text")); // NOI18N
|
jButton1.setText(org.openide.util.NbBundle.getMessage(ReportPanel.class, "ReportPanel.jButton1.text")); // NOI18N
|
||||||
|
|
||||||
|
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||||
|
jPanel1.setLayout(jPanel1Layout);
|
||||||
|
jPanel1Layout.setHorizontalGroup(
|
||||||
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addComponent(jButton1)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 338, Short.MAX_VALUE)
|
||||||
|
.addComponent(saveReport))
|
||||||
|
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
jPanel1Layout.setVerticalGroup(
|
||||||
|
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||||
|
.addContainerGap(150, Short.MAX_VALUE)
|
||||||
|
.addComponent(jLabel1)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
|
.addComponent(saveReport)
|
||||||
|
.addComponent(jButton1))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addComponent(jButton1)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 128, Short.MAX_VALUE)
|
|
||||||
.addComponent(saveReport)))
|
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap(165, Short.MAX_VALUE)
|
||||||
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE)
|
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
||||||
.addComponent(jButton1)
|
|
||||||
.addComponent(saveReport))
|
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -100,8 +129,9 @@ public class ReportPanel extends javax.swing.JPanel {
|
|||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
private void saveReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveReportActionPerformed
|
private void saveReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveReportActionPerformed
|
||||||
|
HashMap<ReportModule, String> reports = rpa.getReports();
|
||||||
|
saveReportAction(reports);
|
||||||
|
|
||||||
saveReportAction();
|
|
||||||
}//GEN-LAST:event_saveReportActionPerformed
|
}//GEN-LAST:event_saveReportActionPerformed
|
||||||
/**
|
/**
|
||||||
* Sets the listener for the OK button
|
* Sets the listener for the OK button
|
||||||
@ -113,49 +143,82 @@ private void saveReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setFinishedReportText() {
|
public void setFinishedReportText() {
|
||||||
|
|
||||||
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
String reportText = "Report was sucessfully generated at " + dateFormat.format(date) + ".";
|
String reportText = "<html>These reports were generated on " + dateFormat.format(date) + ". <br><br>";
|
||||||
jLabel1.setText(reportText);
|
jLabel1.setText(reportText);
|
||||||
|
final JPanel tpanel = new JPanel(new GridBagLayout());
|
||||||
|
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
|
||||||
|
GridBagConstraints c = new GridBagConstraints();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
HashMap<ReportModule, String> reports = rpa.getReports();
|
||||||
|
int cc = 0;
|
||||||
|
for (Map.Entry<ReportModule, String> entry : reports.entrySet()) {
|
||||||
|
c.fill = GridBagConstraints.HORIZONTAL;
|
||||||
|
c.weightx = 1;
|
||||||
|
c.gridwidth = 2;
|
||||||
|
c.gridx = 0;
|
||||||
|
c.gridy = cc;
|
||||||
|
String tempText = entry.getKey().getName() + " report - " + entry.getValue() + "";
|
||||||
|
JLabel lb = new JLabel();
|
||||||
|
lb.setText(tempText);
|
||||||
|
tpanel.add(lb, c);
|
||||||
|
tpanel.revalidate();
|
||||||
|
tpanel.repaint();
|
||||||
|
|
||||||
|
JButton jb = new JButton();
|
||||||
|
jb.setText("View Report");
|
||||||
|
c.fill = GridBagConstraints.NONE;
|
||||||
|
c.weightx = 0.0;
|
||||||
|
c.gridwidth = 1;
|
||||||
|
c.gridx = 2;
|
||||||
|
c.gridy = cc;
|
||||||
|
final ReportModule rep = entry.getKey();
|
||||||
|
final String path = entry.getValue();
|
||||||
|
jb.addActionListener(new ActionListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
rep.getPreview(path);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tpanel.add(jb, c);
|
||||||
|
tpanel.revalidate();
|
||||||
|
tpanel.repaint();
|
||||||
|
cc++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.add(tpanel, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveReportAction() {
|
private void saveReportAction(HashMap<ReportModule, String> reports) {
|
||||||
|
|
||||||
int option = jFileChooser1.showSaveDialog(this);
|
int option = jFileChooser1.showSaveDialog(this);
|
||||||
if (option == JFileChooser.APPROVE_OPTION) {
|
if (option == JFileChooser.APPROVE_OPTION) {
|
||||||
if (jFileChooser1.getSelectedFile() != null) {
|
if (jFileChooser1.getSelectedFile() != null) {
|
||||||
String path = jFileChooser1.getSelectedFile().toString();
|
String path = jFileChooser1.getSelectedFile().toString();
|
||||||
exportReport(path);
|
for (Map.Entry<ReportModule, String> entry : reports.entrySet()) {
|
||||||
|
exportReport(path, entry.getKey().getExtension(), entry.getKey());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void exportReport(String path) {
|
private void exportReport(String path, String ext, ReportModule report) {
|
||||||
|
|
||||||
String htmlpath = ReportUtils.changeExtension(path, ".html");
|
String newpath = ReportUtils.changeExtension(path + "-" + report.getName(), ext);
|
||||||
String xmlpath = ReportUtils.changeExtension(path, ".xml");
|
|
||||||
String xlspath = ReportUtils.changeExtension(path, ".xlsx");
|
|
||||||
try {
|
try {
|
||||||
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(htmlpath), "UTF-8"));
|
report.save(newpath);
|
||||||
|
JOptionPane.showMessageDialog(this, "\n" + report.getName() + " report has been successfully saved to: \n" + newpath);
|
||||||
// FileOutputStream out = new FileOutputStream(htmlpath);
|
} catch (Exception e) {
|
||||||
out.write(ReportHTML.formatted_Report.toString());
|
JOptionPane.showMessageDialog(this, "\n" + report.getName() + " report has failed to save! \n Reason:" + e);
|
||||||
out.flush();
|
|
||||||
out.close();
|
|
||||||
|
|
||||||
//xls report
|
|
||||||
FileOutputStream fos = new FileOutputStream(xlspath);
|
|
||||||
ReportXLS.wb.write(fos);
|
|
||||||
fos.close();
|
|
||||||
|
|
||||||
FileOutputStream xmlout = new FileOutputStream(xmlpath);
|
|
||||||
XMLOutputter serializer = new XMLOutputter();
|
|
||||||
serializer.output(ReportXML.xmldoc, xmlout);
|
|
||||||
xmlout.flush();
|
|
||||||
xmlout.close();
|
|
||||||
JOptionPane.showMessageDialog(this, "Report has been successfully saved!");
|
|
||||||
} catch (IOException e) {
|
|
||||||
System.err.println(e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
@ -163,6 +226,7 @@ private void saveReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI
|
|||||||
private javax.swing.JFileChooser jFileChooser1;
|
private javax.swing.JFileChooser jFileChooser1;
|
||||||
private javax.swing.JLabel jLabel1;
|
private javax.swing.JLabel jLabel1;
|
||||||
private javax.swing.JOptionPane jOptionPane1;
|
private javax.swing.JOptionPane jOptionPane1;
|
||||||
|
private javax.swing.JPanel jPanel1;
|
||||||
private javax.swing.JButton saveReport;
|
private javax.swing.JButton saveReport;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -26,8 +26,8 @@ import java.awt.event.ActionEvent;
|
|||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
|
||||||
import javax.swing.JDialog;
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
@ -41,7 +41,8 @@ public class ReportPanelAction {
|
|||||||
|
|
||||||
private static final String ACTION_NAME = "Report Preview";
|
private static final String ACTION_NAME = "Report Preview";
|
||||||
private StringBuilder viewReport = new StringBuilder();
|
private StringBuilder viewReport = new StringBuilder();
|
||||||
private int cc = 0;
|
private int cc = 1;
|
||||||
|
private HashMap<ReportModule,String> reports = new HashMap<ReportModule,String>();
|
||||||
public ReportPanelAction() {
|
public ReportPanelAction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +67,15 @@ public class ReportPanelAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
rr.progBarCount(classList.size());
|
rr.progBarCount(classList.size()+1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Advance the bar a bit so the user knows something is happening
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
rr.progBarSet(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//Turn our results into the appropriate xml/html reports
|
//Turn our results into the appropriate xml/html reports
|
||||||
@ -75,19 +84,20 @@ public class ReportPanelAction {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
reports.clear();
|
||||||
for (String s : classList) {
|
for (String s : classList) {
|
||||||
cc++;
|
|
||||||
try {
|
try {
|
||||||
Class reportclass = Class.forName(s);
|
final Class reportclass = Class.forName(s);
|
||||||
|
rr.setUpdateLabel("Running " + reportclass.getSimpleName() + " report...");
|
||||||
Object reportObject = reportclass.newInstance();
|
Object reportObject = reportclass.newInstance();
|
||||||
Class[] argTypes = new Class[] { ReportConfiguration.class};
|
Class[] argTypes = new Class[] { ReportConfiguration.class};
|
||||||
Method generatereport = reportclass.getDeclaredMethod("generateReport",argTypes);
|
Method generatereport = reportclass.getDeclaredMethod("generateReport",argTypes);
|
||||||
Object invoke = generatereport.invoke(reportObject,reportconfig);
|
Object invoke = generatereport.invoke(reportObject,reportconfig);
|
||||||
|
rr.progBarSet(cc);
|
||||||
String path = invoke.toString();
|
String path = invoke.toString();
|
||||||
Class[] argTypes2 = new Class[] { String.class};
|
Class[] argTypes2 = new Class[] { String.class};
|
||||||
Method getpreview = reportclass.getMethod("getPreview",argTypes2);
|
Method getpreview = reportclass.getMethod("getPreview",argTypes2);
|
||||||
|
reports.put((ReportModule)reportObject,path);
|
||||||
|
|
||||||
if(s == null ? preview == null : s.equals(preview))
|
if(s == null ? preview == null : s.equals(preview))
|
||||||
{
|
{
|
||||||
@ -97,7 +107,6 @@ public class ReportPanelAction {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
rr.progBarSet(cc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// StopWatch a = new StopWatch();
|
// StopWatch a = new StopWatch();
|
||||||
@ -152,7 +161,7 @@ public class ReportPanelAction {
|
|||||||
|
|
||||||
//Set the temporary label to let the user know its done and is waiting on the report
|
//Set the temporary label to let the user know its done and is waiting on the report
|
||||||
|
|
||||||
final ReportPanel panel = new ReportPanel();
|
final ReportPanel panel = new ReportPanel(this);
|
||||||
|
|
||||||
|
|
||||||
panel.setjButton1ActionListener(new ActionListener() {
|
panel.setjButton1ActionListener(new ActionListener() {
|
||||||
@ -187,4 +196,8 @@ public class ReportPanelAction {
|
|||||||
Log.get(ReportFilterAction.class).log(Level.WARNING, "Error displaying " + ACTION_NAME + " window.", ex);
|
Log.get(ReportFilterAction.class).log(Level.WARNING, "Error displaying " + ACTION_NAME + " window.", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HashMap<ReportModule,String> getReports(){
|
||||||
|
return reports;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,8 +66,9 @@ public class ReportUtils {
|
|||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int datum = bin.read();
|
int datum = bin.read();
|
||||||
if (datum == -1)
|
if (datum == -1) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
bout.write(datum);
|
bout.write(datum);
|
||||||
}
|
}
|
||||||
bout.flush();
|
bout.flush();
|
||||||
|
@ -424,6 +424,11 @@ public class ReportXLS implements ReportModule {
|
|||||||
String type = "XLS";
|
String type = "XLS";
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public String getExtension() {
|
||||||
|
String ext = ".xlsx";
|
||||||
|
return ext;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ReportConfiguration GetReportConfiguration() {
|
public ReportConfiguration GetReportConfiguration() {
|
||||||
|
@ -234,6 +234,12 @@ public class ReportXML implements ReportModule {
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getExtension() {
|
||||||
|
String ext = ".xml";
|
||||||
|
return ext;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ReportConfiguration GetReportConfiguration() {
|
public ReportConfiguration GetReportConfiguration() {
|
||||||
ReportConfiguration config = reportconfig;
|
ReportConfiguration config = reportconfig;
|
||||||
@ -268,8 +274,8 @@ public class ReportXML implements ReportModule {
|
|||||||
return img.getName();
|
return img.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Override
|
@Override
|
||||||
public String visit(File file) {
|
public String visit(org.sleuthkit.datamodel.File file) {
|
||||||
return file.getName();
|
return file.getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user