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
ConstructorsConstructorDescriptionFileReportPublisher(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 withDefaultReportDecoratoras a decorator and withSeverityLevel.INFOas a minimal severity level. -
Method Summary
Modifier and TypeMethodDescriptionGetsIReportDecoratorof the publisher.getFile()Gets the file where report should be placed.voidpublishReport(List<ReportMessage> messages) Generates report based onDefaultReportBuilderand saves it to file.voidsetDecorator(IReportDecorator decorator) SetsIReportDecoratorto the publisher.voidSets the file where report should be placed.
-
Constructor Details
-
FileReportPublisher
Creates a new instance of ReportPublisher withDefaultReportDecoratoras a decorator and withSeverityLevel.INFOas 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
GetsIReportDecoratorof the publisher.- Returns:
- current decorator
-
setDecorator
SetsIReportDecoratorto 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 onDefaultReportBuilderand saves it to file.- Specified by:
-
publishReportin interfaceIReportPublisher - Parameters:
-
messages- is a list ofReportMessageto publish - Throws:
-
IOException- if any IO issue occurs
-