Class FileReportPublisher
java.lang.Object
com.itextpdf.pdfoptimizer.report.publisher.FileReportPublisher
- All Implemented Interfaces:
-
IReportPublisher
Class is used to configure optimization report and save it to file.
-
Constructor Summary
ConstructorDescriptionFileReportPublisher
(IReportDecorator decorator, File file) Creates a new instance of ReportPublisher with providedIReportDecorator
, a minimal severity level and a path to a file with the report.FileReportPublisher
(File file) Creates a new instance of ReportPublisher withDefaultReportDecorator
as a decorator and withSeverityLevel.INFO
as a minimal severity level. -
Method Summary
Modifier and TypeMethodDescriptionGetsIReportDecorator
of the publisher.getFile()
Gets the file where report should be placed.void
publishReport
(List<ReportMessage> messages) Generates report based onDefaultReportBuilder
and saves it to file.void
setDecorator
(IReportDecorator decorator) SetsIReportDecorator
to the publisher.void
Sets the file where report should be placed.
-
Constructor Details
-
FileReportPublisher
Creates a new instance of ReportPublisher withDefaultReportDecorator
as a decorator and withSeverityLevel.INFO
as a minimal severity level.- Parameters:
-
file
- is a file where report should be placed
-
FileReportPublisher
Creates a new instance of ReportPublisher with providedIReportDecorator
, a minimal severity level and a path to a file with the report.- Parameters:
-
decorator
- is a report decorator to set -
file
- is a file where report should be placed
-
-
Method Details
-
getDecorator
GetsIReportDecorator
of the publisher.- Returns:
- current decorator
-
setDecorator
SetsIReportDecorator
to the publisher.- Parameters:
-
decorator
- is a report decorator to set
-
getFile
Gets the file where report should be placed.- Returns:
- file
-
setFile
Sets the file where report should be placed.- Parameters:
-
file
- is a new file
-
publishReport
Generates report based onDefaultReportBuilder
and saves it to file.- Specified by:
-
publishReport
in interfaceIReportPublisher
- Parameters:
-
messages
- is a list ofReportMessage
to publish - Throws:
-
IOException
- if any IO issue occurs
-