Class ConfigFileLoaderManager
java.lang.Object
org.mapfish.print.servlet.fileloader.ConfigFileLoaderManager
- All Implemented Interfaces:
ConfigFileLoaderPlugin
Processes all
ConfigFileLoaderPlugin
s and loads the files.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Method is called by spring and verifies that there is only one plugin per URI scheme.Return all URI schemes that are supported in the system.Returns the URI scheme that this loader supports.boolean
isAccessible
(URI fileURI) Check if the configuration File exists.boolean
isAccessible
(URI configFileUri, String pathToSubResource) check if the file exists and can be accessed by the user/template/config/etc...lastModified
(URI fileURI) return the last modified time of the file URI.byte[]
Load the config data.byte[]
Load the file related to the configuration file.Return the file object the uri refers to if it refers to a file.Return the file object the uri refers to if it refers to a file.
-
Constructor Details
-
ConfigFileLoaderManager
public ConfigFileLoaderManager()
-
-
Method Details
-
checkUniqueSchemes
@PostConstruct public void checkUniqueSchemes()Method is called by spring and verifies that there is only one plugin per URI scheme. -
toFile
Description copied from interface:ConfigFileLoaderPlugin
Return the file object the uri refers to if it refers to a file. Otherwise Optional.absent().- Specified by:
toFile
in interfaceConfigFileLoaderPlugin
- Parameters:
fileUri
- the uri to use to resolve to a file (or not).
-
getUriScheme
Description copied from interface:ConfigFileLoaderPlugin
Returns the URI scheme that this loader supports.- Specified by:
getUriScheme
in interfaceConfigFileLoaderPlugin
-
getSupportedUriSchemes
Return all URI schemes that are supported in the system. -
lastModified
Description copied from interface:ConfigFileLoaderPlugin
return the last modified time of the file URI.- Specified by:
lastModified
in interfaceConfigFileLoaderPlugin
- Parameters:
fileURI
- the uri of the config file to load.- Returns:
- return the last modified date of the file
-
isAccessible
Description copied from interface:ConfigFileLoaderPlugin
Check if the configuration File exists.- Specified by:
isAccessible
in interfaceConfigFileLoaderPlugin
- Parameters:
fileURI
- the uri of the file to load.
-
loadFile
Description copied from interface:ConfigFileLoaderPlugin
Load the config data.- Specified by:
loadFile
in interfaceConfigFileLoaderPlugin
- Parameters:
fileURI
- the uri of the config file to load.- Returns:
- the file that make up the file.
- Throws:
IOException
-
isAccessible
Description copied from interface:ConfigFileLoaderPlugin
check if the file exists and can be accessed by the user/template/config/etc...- Specified by:
isAccessible
in interfaceConfigFileLoaderPlugin
- Parameters:
configFileUri
- the uri of the configuration filepathToSubResource
- a string representing a file that is accessible for use in printing templates within the configuration file. In the case of a file based URI the path could be a relative path (relative to the configuration file) or an absolute path, but it must be an allowed file (you can't allow access to any file on the file system).- Throws:
IOException
-
loadFile
Description copied from interface:ConfigFileLoaderPlugin
Load the file related to the configuration file.- Specified by:
loadFile
in interfaceConfigFileLoaderPlugin
- Parameters:
configFileUri
- the uri of the configuration filepathToSubResource
- a string representing a file that is accessible for use in printing templates within the configuration file. In the case of a file based URI the path could be a relative path (relative to the configuration file) or an absolute path, but it must be an allowed file (you can't allow access to any file on the file system).- Throws:
IOException
-
toFile
Description copied from interface:ConfigFileLoaderPlugin
Return the file object the uri refers to if it refers to a file. Otherwise Optional.absent().- Specified by:
toFile
in interfaceConfigFileLoaderPlugin
- Parameters:
configFileUri
- the uri of the configuration filepathToSubResource
- a string representing a file that is accessible for use in printing templates within the configuration file. In the case of a file based URI the path could be a relative path (relative to the configuration file) or an absolute path, but it must be an allowed file (you can't allow access to any file on the file system).- Throws:
IOException
-