Interface ResourceSystemContext
- All Known Implementing Classes:
HttpResourceStoreImpl
ResourceSystem.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptioncreateDirectory(String name) Creates a new directory.createFile(String name) Creates a new file.String[]Obtains the directory default resource names.Obtains theHttpResourceStore.Obtains the location for theResourceSystem.voidnotifyResourceChanged(String resourcePath) Allows theResourceSystemto notify that a resource has changed.voidsetCharset(Charset charset) Specifies theCharsetfor files within theResourceSystem.
-
Method Details
-
getLocation
String getLocation()Obtains the location for the
ResourceSystem.The location is a free text value that is interpreted specific to the
ResourceSystemimplementation. For example:- path to a directory of a file system
- class path prefix
- etc
- Returns:
- Location for the
ResourceSystem.
-
getDirectoryDefaultResourceNames
String[] getDirectoryDefaultResourceNames()Obtains the directory default resource names.- Returns:
- Directory default resource names.
-
getHttpResourceStore
HttpResourceStore getHttpResourceStore()Obtains theHttpResourceStore.- Returns:
HttpResourceStore.
-
createFile
Creates a new file.
All files required should be created via this method. This is to ensure the files are managed.
- Parameters:
name- Name to aid in identifying the file for debugging.- Returns:
Pathto the new file.- Throws:
IOException- If fails to create the new file.
-
createDirectory
Creates a new directory.
All directories should be created via this method. THis is to ensure the directories are managed.
- Parameters:
name- Name to aid in identifying the directory for debugging.- Returns:
Pathto the new directory.- Throws:
IOException- If fails to create the new directory.
-
setCharset
Specifies the
Charsetfor files within theResourceSystem.This is optional to invoke. If not configured (or configured with
null) then theCharset.defaultCharset()will be used as theCharsetfor the files.- Parameters:
charset-Charsetof the files within theResourceSystem.
-
notifyResourceChanged
Allows the
ResourceSystemto notify that a resource has changed.The
HttpResourceStorewill then discard theHttpResourcefor the path. Should the path benullthen allHttpResourceinstances are discarded.- Parameters:
resourcePath- Path for the resource. Ifnullthen all resources will be discarded.
-