Autopsy  4.18.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.report.modules.html.HTMLReport Class Reference

Inherits org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Public Member Functions

void addRow (List< String > row)
 
void addRowWithTaggedContentHyperlink (List< String > row, ContentTag contentTag)
 
void addSetElement (String elementName)
 
void addSetIndex (List< String > sets)
 
void addThumbnailRows (Set< Content > images)
 
String dateToString (long date)
 
void endDataType ()
 
void endReport ()
 
void endSet ()
 
void endTable ()
 
ReportModuleSettings getConfiguration ()
 
JPanel getConfigurationPanel ()
 
ReportModuleSettings getDefaultConfiguration ()
 
String getDescription ()
 
String getName ()
 
String getRelativeFilePath ()
 
String saveContent (AbstractFile file, String dirName)
 
void setConfiguration (ReportModuleSettings settings)
 
void startContentTagsTable (List< String > columnHeaders)
 
void startDataType (String name, String description)
 
void startReport (String baseReportDir)
 
void startSet (String setName)
 
void startTable (List< String > titles)
 

Static Public Member Functions

static synchronized HTMLReport getDefault ()
 

Static Public Attributes

static Integer THUMBNAIL_COLUMNS = 5
 

Private Member Functions

 HTMLReport ()
 
void addRow (List< String > row, boolean escapeText)
 
String dataTypeToFileName (String dataType)
 
boolean failsContentCheck (Content c)
 
String formatHtmlString (String text)
 
List< ImageTagRegiongetTaggedRegions (List< ContentTag > contentTags)
 
void initializePanel ()
 
String makeCustomUniqueFilePath (AbstractFile file, String dirName)
 
String prepareThumbnail (AbstractFile file)
 
void refresh () throws NoCurrentCaseException
 
String useDataTypeIcon (String dataType)
 
void writeCss ()
 
void writeIndex ()
 
void writeNav ()
 
String writePageFooter ()
 
String writePageHeader ()
 
void writeSummary ()
 
StringBuilder writeSummaryCaseDetails ()
 
StringBuilder writeSummaryImageInfo ()
 
StringBuilder writeSummaryIngestHistoryInfo (SleuthkitCase skCase, List< IngestJobInfo > ingestJobs)
 
StringBuilder writeSummarySoftwareInfo (SleuthkitCase skCase, List< IngestJobInfo > ingestJobs)
 

Private Attributes

HTMLReportConfigurationPanel configPanel
 
Case currentCase
 
String currentDataType
 
Map< String, Integer > dataTypes
 
Writer out
 
String path
 
final ReportBranding reportBranding
 
Integer rowCount
 
String subPath
 
String thumbsPath
 

Static Private Attributes

static final String HTML_SUBDIR = "content"
 
static HTMLReport instance
 
static final Logger logger = Logger.getLogger(HTMLReport.class.getName())
 
static final int MAX_THUMBS_PER_PAGE = 1000
 
static final String THUMBS_REL_PATH = "thumbs" + File.separator
 

Detailed Description

Definition at line 87 of file HTMLReport.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.report.modules.html.HTMLReport.HTMLReport ( )
private

Member Function Documentation

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.addRow ( List< String >  row)

Add a row to the current table, escaping the text to be contained in the row.

Parameters
rowvalues for each cell in the row

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 725 of file HTMLReport.java.

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.addRowWithTaggedContentHyperlink(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.addThumbnailRows().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.addRow ( List< String >  row,
boolean  escapeText 
)
private

Add a row to the current table.

Parameters
rowvalues for each cell in the row
escapeTextwhether or not the text of the row should be escaped, true for escaped, false for not escaped

Definition at line 736 of file HTMLReport.java.

References org.sleuthkit.autopsy.coreutils.EscapeUtil.escapeHtml().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.addRowWithTaggedContentHyperlink ( List< String >  row,
ContentTag  contentTag 
)

Saves a local copy of a tagged file and adds a row with a hyper link to the file.

Parameters
rowValues for each data cell in the row
contentTagThe tag

Definition at line 762 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.addRow(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.saveContent().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.addSetElement ( String  elementName)

Add a new element to the current set.

Parameters
elementNamename of the element

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 650 of file HTMLReport.java.

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.addSetIndex ( List< String >  sets)

Add an index to the current page for all the sets about to be added.

Parameters
setslist of set names to be added

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 630 of file HTMLReport.java.

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.addThumbnailRows ( Set< Content >  images)

Add the body of the thumbnails table.

Parameters
images

Definition at line 843 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.addRow(), org.sleuthkit.autopsy.report.modules.html.HTMLReport.endDataType(), org.sleuthkit.autopsy.report.modules.html.HTMLReport.endTable(), org.sleuthkit.autopsy.coreutils.FileUtil.escapeFileName(), org.sleuthkit.autopsy.report.modules.html.HTMLReport.failsContentCheck(), org.sleuthkit.autopsy.casemodule.services.TagsManager.getContentTagsByContent(), org.sleuthkit.autopsy.casemodule.Case.getCurrentCase(), org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTagsUtil.getImageWithTags(), org.sleuthkit.autopsy.casemodule.services.TagsManager.getNotableTagLabel(), org.sleuthkit.autopsy.casemodule.Case.getServices(), org.sleuthkit.autopsy.report.modules.html.HTMLReport.getTaggedRegions(), org.sleuthkit.autopsy.casemodule.services.Services.getTagsManager(), org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTagsUtil.getThumbnailWithTags(), org.sleuthkit.autopsy.report.modules.html.HTMLReport.makeCustomUniqueFilePath(), org.sleuthkit.autopsy.contentviewers.imagetagging.ImageTagsUtil.IconSize.MEDIUM, org.sleuthkit.autopsy.report.modules.html.HTMLReport.prepareThumbnail(), org.sleuthkit.autopsy.report.modules.html.HTMLReport.saveContent(), org.sleuthkit.autopsy.report.modules.html.HTMLReport.startDataType(), org.sleuthkit.autopsy.report.modules.html.HTMLReport.startTable(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.THUMBNAIL_COLUMNS.

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.dataTypeToFileName ( String  dataType)
private

Generate a file name for the given datatype, by replacing any undesirable chars, like /, or spaces

Parameters
dataTypedata type for which to generate a file name

Definition at line 203 of file HTMLReport.java.

References org.sleuthkit.autopsy.coreutils.FileUtil.escapeFileName().

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.startDataType(), org.sleuthkit.autopsy.report.modules.html.HTMLReport.useDataTypeIcon(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeNav().

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.dateToString ( long  date)

Return a String date for the long date given.

Parameters
datedate as a long
Returns
String date as a String

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 1052 of file HTMLReport.java.

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.endDataType ( )

End the current data type. Write the end of the web page and close the output stream.

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 538 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.writePageFooter().

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.addThumbnailRows().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.endReport ( )

End this report. Close the output stream if necessary, and write the navigation menu with the data types given throughout the report.

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 484 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeNav().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.endSet ( )

End the current set.

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 616 of file HTMLReport.java.

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.endTable ( )
boolean org.sleuthkit.autopsy.report.modules.html.HTMLReport.failsContentCheck ( Content  c)
private
String org.sleuthkit.autopsy.report.modules.html.HTMLReport.formatHtmlString ( String  text)
private

Apply escape sequence to special characters. Line feed and carriage return character combinations will be converted to HTML line breaks.

Parameters
textThe text to format.
Returns
The formatted text.

Definition at line 1605 of file HTMLReport.java.

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummaryCaseDetails().

ReportModuleSettings org.sleuthkit.autopsy.report.modules.html.HTMLReport.getConfiguration ( )

Get current configuration for this report module.

Returns
Object which contains current report module settings.

Implements org.sleuthkit.autopsy.report.ReportModule.

Definition at line 150 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.initializePanel().

JPanel org.sleuthkit.autopsy.report.modules.html.HTMLReport.getConfigurationPanel ( )

Returns the configuration panel for the report, which is displayed in the report configuration step of the report wizard.

Returns
Configuration panel or null if the module does not need configuration.

Implements org.sleuthkit.autopsy.report.ReportModule.

Definition at line 123 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.configPanel, and org.sleuthkit.autopsy.report.modules.html.HTMLReport.initializePanel().

static synchronized HTMLReport org.sleuthkit.autopsy.report.modules.html.HTMLReport.getDefault ( )
static
ReportModuleSettings org.sleuthkit.autopsy.report.modules.html.HTMLReport.getDefaultConfiguration ( )

Get default configuration for this report module.

Returns
Object which contains default report module settings.

Implements org.sleuthkit.autopsy.report.ReportModule.

Definition at line 140 of file HTMLReport.java.

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.setConfiguration().

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.getDescription ( )

Gets a one-line, user friendly description of the type of report this module generates.

Implements org.sleuthkit.autopsy.report.ReportModule.

Definition at line 1068 of file HTMLReport.java.

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.getName ( )

Get the name of the report this module generates.

Implements org.sleuthkit.autopsy.report.ReportModule.

Definition at line 1063 of file HTMLReport.java.

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummaryIngestHistoryInfo().

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.getRelativeFilePath ( )

Gets the relative path of the report file, if any, generated by this module. The path should be relative to the location that gets passed in to generateReport() (or similar).

Returns
Relative path to where report will be stored. Return an empty string if the location passed to generateReport() is the output location. Return null to indicate that there is no report file.

Implements org.sleuthkit.autopsy.report.ReportModule.

Definition at line 1058 of file HTMLReport.java.

List<ImageTagRegion> org.sleuthkit.autopsy.report.modules.html.HTMLReport.getTaggedRegions ( List< ContentTag >  contentTags)
private
void org.sleuthkit.autopsy.report.modules.html.HTMLReport.initializePanel ( )
private
String org.sleuthkit.autopsy.report.modules.html.HTMLReport.makeCustomUniqueFilePath ( AbstractFile  file,
String  dirName 
)
private
String org.sleuthkit.autopsy.report.modules.html.HTMLReport.prepareThumbnail ( AbstractFile  file)
private

Create a thumbnail of a given file.

Parameters
fileThe file from which to create the thumbnail.
Returns
The path to the thumbnail file, or null if a thumbnail couldn't be created.

Definition at line 1570 of file HTMLReport.java.

References org.sleuthkit.autopsy.coreutils.FileUtil.escapeFileName(), org.sleuthkit.autopsy.coreutils.ImageUtils.getThumbnail(), and org.sleuthkit.autopsy.coreutils.ImageUtils.ICON_SIZE_MEDIUM.

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.addThumbnailRows().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.refresh ( ) throws NoCurrentCaseException
private
String org.sleuthkit.autopsy.report.modules.html.HTMLReport.saveContent ( AbstractFile  file,
String  dirName 
)

Save a local copy of the given file in the reports folder.

Parameters
fileFile to save
dirNameCustom top-level folder to use to store the files in (tag name, etc.)
Returns
Path to where file was stored (relative to root of HTML folder)

Definition at line 1029 of file HTMLReport.java.

References org.sleuthkit.autopsy.datamodel.ContentUtils.ExtractFscContentVisitor< T, V >.extract(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.makeCustomUniqueFilePath().

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.addRowWithTaggedContentHyperlink(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.addThumbnailRows().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.setConfiguration ( ReportModuleSettings  settings)

Set report module configuration.

Parameters
settingsObject which contains report module settings.

Implements org.sleuthkit.autopsy.report.ReportModule.

Definition at line 161 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.getDefaultConfiguration(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.initializePanel().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.startContentTagsTable ( List< String >  columnHeaders)

Start a new table with the given column headers. Note: This method is a temporary workaround to avoid modifying the TableReportModule interface.

Parameters
columnHeaderscolumn headers

Definition at line 685 of file HTMLReport.java.

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.startDataType ( String  name,
String  description 
)

Start a new HTML page for the given data type. Update the output stream to this page, and setup the web page header. Note: This method is a temporary workaround to avoid modifying the TableReportModule interface.

Parameters
nameName of the data type
descriptionComment on the data type, may be the empty string

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 504 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.dataTypeToFileName(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.writePageHeader().

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.addThumbnailRows().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.startReport ( String  baseReportDir)
void org.sleuthkit.autopsy.report.modules.html.HTMLReport.startSet ( String  setName)

Start a new set under the current data type.

Parameters
setNamename of the new set

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 600 of file HTMLReport.java.

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.startTable ( List< String >  titles)

Start a new table with the given column titles.

Parameters
titlescolumn titles

Implements org.sleuthkit.autopsy.report.infrastructure.TableReportModule.

Definition at line 664 of file HTMLReport.java.

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.addThumbnailRows().

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.useDataTypeIcon ( String  dataType)
private

Copies a suitable icon for the given data type in the output directory and returns the icon file name to use for the given data type.

Definition at line 217 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.dataTypeToFileName().

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeNav().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeCss ( )
private

Write the stylesheet for this report.

Definition at line 1075 of file HTMLReport.java.

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.startReport().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeIndex ( )
private
void org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeNav ( )
private
String org.sleuthkit.autopsy.report.modules.html.HTMLReport.writePageFooter ( )
private

Write HTML-formatted page footer text based on the text provided in the configuration panel.

Returns
The HTML-formatted text.

Definition at line 583 of file HTMLReport.java.

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.endDataType(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummary().

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.writePageHeader ( )
private

Write HTML-formatted page header text based on the text provided in the configuration panel.

Returns
The HTML-formatted text.

Definition at line 566 of file HTMLReport.java.

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.startDataType(), and org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummary().

void org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummary ( )
private
StringBuilder org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummaryCaseDetails ( )
private
StringBuilder org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummaryImageInfo ( )
private

Write the Image Information section of the summary for this report.

Returns
StringBuilder updated html report with Image Information

Definition at line 1460 of file HTMLReport.java.

References org.sleuthkit.autopsy.casemodule.Case.getDataSources().

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummary().

StringBuilder org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummaryIngestHistoryInfo ( SleuthkitCase  skCase,
List< IngestJobInfo >  ingestJobs 
)
private

Write the Ingest History section of the summary for this report.

Returns
StringBuilder updated html report with ingest history

Definition at line 1529 of file HTMLReport.java.

References org.sleuthkit.autopsy.report.modules.html.HTMLReport.getName().

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummary().

StringBuilder org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummarySoftwareInfo ( SleuthkitCase  skCase,
List< IngestJobInfo >  ingestJobs 
)
private

Write the software information section of the summary for this report.

Returns
StringBuilder updated html report with software information

Definition at line 1494 of file HTMLReport.java.

References org.sleuthkit.autopsy.coreutils.Version.getVersion().

Referenced by org.sleuthkit.autopsy.report.modules.html.HTMLReport.writeSummary().

Member Data Documentation

HTMLReportConfigurationPanel org.sleuthkit.autopsy.report.modules.html.HTMLReport.configPanel
private
Case org.sleuthkit.autopsy.report.modules.html.HTMLReport.currentCase
private

Definition at line 94 of file HTMLReport.java.

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.currentDataType
private

Definition at line 101 of file HTMLReport.java.

Map<String, Integer> org.sleuthkit.autopsy.report.modules.html.HTMLReport.dataTypes
private

Definition at line 97 of file HTMLReport.java.

final String org.sleuthkit.autopsy.report.modules.html.HTMLReport.HTML_SUBDIR = "content"
staticprivate

Definition at line 93 of file HTMLReport.java.

HTMLReport org.sleuthkit.autopsy.report.modules.html.HTMLReport.instance
staticprivate
final Logger org.sleuthkit.autopsy.report.modules.html.HTMLReport.logger = Logger.getLogger(HTMLReport.class.getName())
staticprivate

Definition at line 89 of file HTMLReport.java.

final int org.sleuthkit.autopsy.report.modules.html.HTMLReport.MAX_THUMBS_PER_PAGE = 1000
staticprivate

Definition at line 92 of file HTMLReport.java.

Writer org.sleuthkit.autopsy.report.modules.html.HTMLReport.out
private

Definition at line 103 of file HTMLReport.java.

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.path
private

Definition at line 98 of file HTMLReport.java.

final ReportBranding org.sleuthkit.autopsy.report.modules.html.HTMLReport.reportBranding
private

Definition at line 107 of file HTMLReport.java.

Integer org.sleuthkit.autopsy.report.modules.html.HTMLReport.rowCount
private

Definition at line 102 of file HTMLReport.java.

String org.sleuthkit.autopsy.report.modules.html.HTMLReport.subPath
private

Definition at line 100 of file HTMLReport.java.

Integer org.sleuthkit.autopsy.report.modules.html.HTMLReport.THUMBNAIL_COLUMNS = 5
static
final String org.sleuthkit.autopsy.report.modules.html.HTMLReport.THUMBS_REL_PATH = "thumbs" + File.separator
staticprivate
String org.sleuthkit.autopsy.report.modules.html.HTMLReport.thumbsPath
private

Definition at line 99 of file HTMLReport.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2021 Basis Technology. Generated on: Thu Jul 8 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.