Package org.mapfish.print.config
Class WorkingDirectories
- java.lang.Object
-
- org.mapfish.print.config.WorkingDirectories
-
public class WorkingDirectories extends java.lang.Object
Class for configuring the working directories and ensuring they exist correctly.
-
-
Constructor Summary
Constructors Constructor Description WorkingDirectories()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File
getBuildFileFor(Configuration configuration, java.io.File jasperFileXml, java.lang.String extension, org.slf4j.Logger logger)
Calculate the file to compile a jasper report template to.java.lang.Runnable
getCleanUpTask()
java.io.File
getJasperCompilation(Configuration configuration)
Get the directory where the compiled jasper reports should be put.java.io.File
getReports()
Get the directory where the reports are written to.java.io.File
getTaskDirectory()
Creates and returns a temporary directory for a printing task.java.io.File
getWorking()
java.io.File
getWorking(Configuration configuration)
Get the working directory for the configuration.void
init()
Called by spring after bean has been created and populated.void
removeDirectory(java.io.File directory)
Deletes the given directory.void
setMaxAgeReport(int maxAgeReport)
void
setMaxAgeTaskDir(int maxAgeTaskDir)
void
setWorking(java.lang.String working)
Defines what is the root directory used to store every temporary files.
-
-
-
Method Detail
-
getWorking
public final java.io.File getWorking()
-
setWorking
public final void setWorking(java.lang.String working)
Defines what is the root directory used to store every temporary files.The given path can contain the pattern "{WEBAPP}" and it will 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
public final java.io.File getJasperCompilation(Configuration configuration)
Get the directory where the compiled jasper reports should be put.- Parameters:
configuration
- the configuration for the current app.
-
getReports
public final java.io.File 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
public final java.io.File getTaskDirectory()
Creates and returns a temporary directory for a printing task.
-
removeDirectory
public final void removeDirectory(java.io.File directory)
Deletes the given directory.- Parameters:
directory
- The directory to delete.
-
getBuildFileFor
public final java.io.File getBuildFileFor(Configuration configuration, java.io.File jasperFileXml, java.lang.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
public final java.io.File getWorking(Configuration configuration)
Get the working directory for the configuration.- Parameters:
configuration
- the configuration for the current app.
-
getCleanUpTask
public final java.lang.Runnable getCleanUpTask()
-
-