public class ConfigurableResources extends java.lang.Object implements Resources
Constructor and Description |
---|
ConfigurableResources() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAbsolutePath(java.lang.String relative)
Convert a relative path to an absolute path.
|
java.util.List<java.lang.String> |
listAll(java.lang.String path)
List all resources contained in the specified relative path to a directory.
|
java.util.Map<java.lang.String,java.lang.String> |
loadIniFile(java.lang.String path)
Load an ini file.
|
java.lang.String |
loadString(java.lang.String path)
Read a resource and return the contents as a String.
|
void |
storeIniFile(java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> properties)
Overwrite the contents of an ini file.
|
void |
storeString(java.lang.String path,
java.lang.String data)
Store a string as the contents of a resource.
|
public void storeString(java.lang.String path, java.lang.String data) throws java.io.IOException
Resources
storeString
in interface Resources
path
- relative path to the resource.data
- data to store as the contents of the resource.java.io.IOException
public void storeIniFile(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> properties) throws java.io.IOException
Resources
storeIniFile
in interface Resources
path
- relative path to the resource.properties
- Every entry in this map will be stored as an entry in the ini file. Keys should not contain '='.java.io.IOException
public java.util.Map<java.lang.String,java.lang.String> loadIniFile(java.lang.String path)
Resources
loadIniFile
in interface Resources
path
- relative path to the resource.public java.util.List<java.lang.String> listAll(java.lang.String path) throws java.io.IOException
Resources
public java.lang.String loadString(java.lang.String path) throws java.io.IOException
Resources
loadString
in interface Resources
path
- relative path to the resource.java.io.IOException
public java.lang.String getAbsolutePath(java.lang.String relative) throws java.io.IOException
Resources
getAbsolutePath
in interface Resources
relative
- relative path to the resource.java.io.IOException