public abstract class AbstractFileConfigFileLoader extends java.lang.Object implements ConfigFileLoaderPlugin
| Constructor and Description |
|---|
AbstractFileConfigFileLoader() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAccessible(java.net.URI fileURI)
Check if the configuration File exists.
|
boolean |
isAccessible(java.net.URI configFileUri,
java.lang.String pathToSubResource)
check if the file exists and can be accessed by the user/template/config/etc...
|
com.google.common.base.Optional<java.lang.Long> |
lastModified(java.net.URI fileURI)
return the last modified time of the file URI.
|
byte[] |
loadFile(java.net.URI fileURI)
Load the config data.
|
byte[] |
loadFile(java.net.URI configFileUri,
java.lang.String pathToSubResource)
Load the file related to the configuration file.
|
protected static java.io.File |
platformIndependentUriToFile(java.net.URI fileURI)
Convert a url to a file object.
|
protected abstract java.util.Iterator<java.io.File> |
resolveFiles(java.net.URI fileURI)
Load the files referenced by the id (in the case of a classpath uri it could references several files,
although normally it will only reference one).
|
com.google.common.base.Optional<java.io.File> |
toFile(java.net.URI fileUri)
Return the file object the uri refers to if it refers to a file.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetUriSchemeprotected static java.io.File platformIndependentUriToFile(java.net.URI fileURI)
fileURI - the uri to convertprotected abstract java.util.Iterator<java.io.File> resolveFiles(java.net.URI fileURI)
fileURI - the uri identifying the config file.public final com.google.common.base.Optional<java.io.File> toFile(java.net.URI fileUri)
ConfigFileLoaderPlugintoFile in interface ConfigFileLoaderPluginfileUri - the uri to use to resolve to a file (or not).public final com.google.common.base.Optional<java.lang.Long> lastModified(java.net.URI fileURI)
ConfigFileLoaderPluginlastModified in interface ConfigFileLoaderPluginfileURI - the uri of the config file to load.public final boolean isAccessible(java.net.URI fileURI)
ConfigFileLoaderPluginisAccessible in interface ConfigFileLoaderPluginfileURI - the uri of the file to load.public final byte[] loadFile(java.net.URI fileURI)
throws java.io.IOException
ConfigFileLoaderPluginloadFile in interface ConfigFileLoaderPluginfileURI - the uri of the config file to load.java.io.IOExceptionpublic final boolean isAccessible(java.net.URI configFileUri,
java.lang.String pathToSubResource)
throws java.io.IOException
ConfigFileLoaderPluginisAccessible in interface ConfigFileLoaderPluginconfigFileUri - 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).java.io.IOExceptionpublic final byte[] loadFile(java.net.URI configFileUri,
java.lang.String pathToSubResource)
throws java.io.IOException
ConfigFileLoaderPluginloadFile in interface ConfigFileLoaderPluginconfigFileUri - 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).java.io.IOException