Class AbstractViewerService

    • Constructor Detail

      • AbstractViewerService

        public AbstractViewerService()
    • Method Detail

      • generateTmpFile

        protected File generateTmpFile​(ViewerContext viewerContext,
                                       String fileExtension)
        Generates a temporary file.
        Parameters:
        fileExtension - the extension of the temporary file.
        Returns:
        the generated temporary file.
      • changeFileExtension

        protected File changeFileExtension​(File file,
                                           String fileExtension)
        Changes the extension of the specified file with the given one.
        Parameters:
        fileExtension - the extension to use.
        Returns:
        the file with the new extension.
      • process

        protected <R extends SerializableAbstractViewerService.ViewerProcess<R> process​(String processName,
                                                                                          AbstractViewerService.ViewerTreatment<R> viewerTreatment)
        This method allows to start the setting of a AbstractViewerService.ViewerTreatment.
        It manages also a cache mechanism in order to avoid taking too much resources at the same time and also in order to preserve space in the filesystem.
        Type Parameters:
        R - the concrete type of the object on which the treatment works.
        Parameters:
        processName - the name of the process (preview for example).
        viewerTreatment - the treatment to perform.
        Returns:
        the result of the process.