Package org.mapfish.print.config
Class WorkingDirectories
java.lang.Object
org.mapfish.print.config.WorkingDirectories
Class for configuring the working directories and ensuring they exist correctly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal FilegetBuildFileFor(Configuration configuration, File jasperFileXml, String extension, org.slf4j.Logger logger) Calculate the file to compile a jasper report template to.final Runnablefinal FilegetJasperCompilation(Configuration configuration) Get the directory where the compiled jasper reports should be put.final FileGet the directory where the reports are written to.final FileCreates and returns a temporary directory for a printing task.final Filefinal FilegetWorking(Configuration configuration) Get the working directory for the configuration.final voidinit()Called by spring after bean has been created and populated.final voidremoveDirectory(File directory) Deletes the given directory.final voidsetMaxAgeReport(int maxAgeReport) final voidsetMaxAgeTaskDir(int maxAgeTaskDir) final voidsetWorking(String working) Defines what is the root directory used to store every temporary files.
-
Constructor Details
-
WorkingDirectories
public WorkingDirectories()
-
-
Method Details
-
getWorking
-
setWorking
Defines what is the root directory used to store every temporary files.The given path can contain the pattern "{WEBAPP}" and it will be replaced by the webapp name.
- Parameters:
working- The path
-
setMaxAgeReport
public final void setMaxAgeReport(int maxAgeReport) -
setMaxAgeTaskDir
public final void setMaxAgeTaskDir(int maxAgeTaskDir) -
init
@PostConstruct public final void init()Called by spring after bean has been created and populated. -
getJasperCompilation
Get the directory where the compiled jasper reports should be put.- Parameters:
configuration- the configuration for the current app.
-
getReports
Get the directory where the reports are written to. This may be a temporary location before sending the files to a central repository that can better handle clustering. -
getTaskDirectory
Creates and returns a temporary directory for a printing task. -
removeDirectory
Deletes the given directory.- Parameters:
directory- The directory to delete.
-
getBuildFileFor
public final File getBuildFileFor(Configuration configuration, File jasperFileXml, String extension, org.slf4j.Logger logger) Calculate the file to compile a jasper report template to.- Parameters:
configuration- the configuration for the current app.jasperFileXml- the jasper report template in xml format.extension- the extension of the compiled report template.logger- the logger to log errors to if an occur.
-
getWorking
Get the working directory for the configuration.- Parameters:
configuration- the configuration for the current app.
-
getCleanUpTask
-