java.lang.Object
io.sf.jclf.util.locale.ResourceFactory
io.sf.jclf.util.locale.FileResourceFactory
Factory of localized objects through filesystem.
Loads files from filesystem according to basename, extension and locale name.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionloadLocalFile(String baseFileName, String ext, String localeName) Load a resource file.protected InputStreamopenInputStream(String path) Opens an input stream to read the specified resource.Methods inherited from class io.sf.jclf.util.locale.ResourceFactory
getLastModified, instantiateObject, loadLocalObject, readURL, setLastModified
-
Constructor Details
-
FileResourceFactory
-
FileResourceFactory
public FileResourceFactory()
-
-
Method Details
-
loadLocalFile
public InputStream loadLocalFile(String baseFileName, String ext, String localeName) throws IOException Description copied from class:ResourceFactoryLoad a resource file.- Specified by:
loadLocalFilein classResourceFactory- Parameters:
baseFileName- the basename of the pathext- the extension.localeName- the name of the locale, eg. es_ES.- Returns:
- the input stream with the file contents.
- Throws:
IOException- if the file cannot be loaded.
-
openInputStream
Opens an input stream to read the specified resource.- Parameters:
path- the path to the resource.- Returns:
- the input stream, or null if the resource does not exist.
-