mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
HTML report broken up from single try/catch to multiple.
Signed-off-by: Alex Ebadirad <aebadirad@42six.com>
This commit is contained in:
parent
695911b9a6
commit
ce96a91ce1
@ -34,13 +34,10 @@ import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||
import org.sleuthkit.datamodel.FsContent;
|
||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
import org.sleuthkit.datamodel.TskData;
|
||||
import org.sleuthkit.datamodel.*;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -55,6 +52,8 @@ public class ReportHTML implements ReportModule {
|
||||
private static String htmlPath = "";
|
||||
private ReportConfiguration config;
|
||||
private static ReportHTML instance = null;
|
||||
private Case currentCase = Case.getCurrentCase(); // get the most updated case
|
||||
private SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
||||
|
||||
ReportHTML() {
|
||||
}
|
||||
@ -128,14 +127,22 @@ public class ReportHTML implements ReportModule {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
String ingestwarning = "<h2 style=\"color: red;\">Warning, this report was run before ingest services completed!</h2>";
|
||||
Case currentCase = Case.getCurrentCase(); // get the most updated case
|
||||
SleuthkitCase skCase = currentCase.getSleuthkitCase();
|
||||
|
||||
String caseName = currentCase.getName();
|
||||
Integer imagecount = currentCase.getImageIDs().length;
|
||||
Integer totalfiles = skCase.countFsContentType(TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG);
|
||||
Integer totaldirs = skCase.countFsContentType(TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR);
|
||||
Integer totalfiles = 0;
|
||||
Integer totaldirs = 0;
|
||||
try {
|
||||
totaldirs = skCase.countFsContentType(TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_DIR);
|
||||
totalfiles = skCase.countFsContentType(TskData.TSK_FS_META_TYPE_ENUM.TSK_FS_META_TYPE_REG);
|
||||
} catch (TskException ex) {
|
||||
Logger.getLogger(ReportHTML.class.getName()).log(Level.SEVERE, "Could not get FsContentType counts from TSK ", ex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int reportsize = report.size();
|
||||
Integer filesystemcount = currentCase.getRootObjectsCount();
|
||||
DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
@ -250,7 +257,12 @@ public class ReportHTML implements ReportModule {
|
||||
StringBuilder artifact = new StringBuilder("");
|
||||
Long objId = entry.getKey().getObjectID();
|
||||
//Content file = skCase.getContentById(objId);
|
||||
FsContent file = skCase.getFsContentById(objId);
|
||||
FsContent file = null;
|
||||
try {
|
||||
file = skCase.getFsContentById(objId);
|
||||
} catch (TskException ex) {
|
||||
Logger.getLogger(ReportHTML.class.getName()).log(Level.SEVERE, "Could not get FsContent from TSK ", ex);
|
||||
}
|
||||
|
||||
Long filesize = file.getSize();
|
||||
|
||||
@ -417,12 +429,13 @@ public class ReportHTML implements ReportModule {
|
||||
formatted_Report.append("</div></div></body></html>");
|
||||
formatted_header.append(formatted_Report);
|
||||
// unformatted_header.append(formatted_Report);
|
||||
try {
|
||||
htmlPath = currentCase.getCaseDirectory() + "/Reports/" + caseName + "-" + datenotime + ".html";
|
||||
this.save(htmlPath);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
Logger.getLogger(ReportHTML.class.getName()).log(Level.WARNING, "Exception occurred", e);
|
||||
Logger.getLogger(ReportHTML.class.getName()).log(Level.SEVERE, "Could not write out HTML report! ", e);
|
||||
}
|
||||
return htmlPath;
|
||||
}
|
||||
@ -451,6 +464,7 @@ public class ReportHTML implements ReportModule {
|
||||
String type = "HTML";
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExtension() {
|
||||
String ext = ".html";
|
||||
|
Loading…
x
Reference in New Issue
Block a user