Class WorkingDirectories

java.lang.Object
org.mapfish.print.config.WorkingDirectories

public class WorkingDirectories extends Object
Class for configuring the working directories and ensuring they exist correctly.
  • Constructor Details

    • WorkingDirectories

      public WorkingDirectories()
  • Method Details

    • getWorking

      public final File getWorking()
    • setWorking

      public final void setWorking(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 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

      public final 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 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 File getTaskDirectory()
      Creates and returns a temporary directory for a printing task.
    • removeDirectory

      public final void removeDirectory(File directory)
      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

      public final File getWorking(Configuration configuration)
      Get the working directory for the configuration.
      Parameters:
      configuration - the configuration for the current app.
    • getCleanUpTask

      public final Runnable getCleanUpTask()