public class FSConnector extends AbstractConnector
Connector
.Modifier | Constructor and Description |
---|---|
|
FSConnector()
Default Constructor (e.g. use in settings4j.xml).
|
protected |
FSConnector(FSContentResolver fsContentResolver)
protected Constructor for extensions and Unit-Tests.
|
Modifier and Type | Method and Description |
---|---|
String |
getCharset() |
byte[] |
getContent(String key)
return a byte[]-Value for the given key or
null if no file-content for the key where found. |
protected ContentResolver |
getContentResolver() |
Object |
getObject(String key)
return a Object-Value for the given key.
|
File |
getRootFolder()
return the root of this FileSystem ContenResolver.
|
String |
getString(String key)
return a String-Value for the given key.
|
void |
setCharset(String charset) |
void |
setContent(String key,
byte[] value) |
void |
setContentResolver(ContentResolver contentResolver)
set a ContentResolver as Helper for
Connector.getContent(String) . |
void |
setRootFolderPath(String rootFolderPath)
Delegate the rootFolderPath to the
FSContentResolver.setRootFolderPath(String) . |
void |
setString(String key,
String value) |
addConnector, getConnectors, getName, getObjectResolver, init, setName, setObjectResolver
public FSConnector()
protected FSConnector(FSContentResolver fsContentResolver)
fsContentResolver
- FSContentResolver
public byte[] getContent(String key)
Connector
null
if no file-content for the key where found.
The concrete implementation can use the ContentResolver if required
key
- the Key for the configuration-property. e.g.: "com/mycompany/myapp/myParameterKey"public Object getObject(String key)
Connector
The concrete implementation can use the ObjectResolver if required
key
- the Key for the configuration-property. e.g.: "com/mycompany/myapp/myParameterKey"public String getString(String key)
Connector
key
- the Key for the configuration-property. e.g.: "com/mycompany/myapp/myParameterKey"public void setContent(String key, byte[] value) throws IOException
key
- The Settings4j Key.value
- The value to Store.IOException
- if an error occured.public void setString(String key, String value) throws IOException
key
- The Settings4j Key.value
- The value to Store.IOException
- if an error occured.public String getCharset()
public void setCharset(String charset)
charset
- a valid Charset
Charset.isSupported(String)
public void setRootFolderPath(String rootFolderPath)
FSContentResolver.setRootFolderPath(String)
.rootFolderPath
- The root Folder Path where the settings could be stored.public void setContentResolver(ContentResolver contentResolver)
Connector
Connector.getContent(String)
.setContentResolver
in interface Connector
setContentResolver
in class AbstractConnector
contentResolver
- the ContentResolver to set.protected ContentResolver getContentResolver()
getContentResolver
in class AbstractConnector
public File getRootFolder()
if no one is set, the "." will be returned.
Copyright © 2008–2016 Brabenetz Harald, Austria. All rights reserved.