|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.common.config.TungstenPropertiesIO
public class TungstenPropertiesIO
This class reads and writes TungstenProperties data safely on a file system. It uses the generic FileIO class to ensure that properties files are handled as efficiently as possible.
| Field Summary | |
|---|---|
java.lang.String |
JAVA_PROPERTIES
Process file using Java properties format serialization. |
java.lang.String |
JSON
Process file using JSON format serialization. |
| Constructor Summary | |
|---|---|
TungstenPropertiesIO(java.io.File path)
Creates a new instance for OS file system operating on the caller-specified file. |
|
TungstenPropertiesIO(FileIO fileIO,
FilePath filePath)
Creates a new instance with user-specified FileIO implementation and file path. |
|
| Method Summary | |
|---|---|
boolean |
delete()
Delete the properties file. |
boolean |
exists()
Returns true if the properties file exists. |
java.lang.String |
getCharset()
|
java.lang.String |
getFormat()
|
TungstenProperties |
read()
Read properties file from the file system using selected serialization format and character set. |
void |
setCharset(java.lang.String charset)
Sets the character set to use. |
void |
setFormat(java.lang.String format)
Sets the serialization format to use. |
void |
write(TungstenProperties properties,
boolean fsync)
Write properties file to the file system using selected serialization format and character set. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.String JSON
public final java.lang.String JAVA_PROPERTIES
| Constructor Detail |
|---|
public TungstenPropertiesIO(FileIO fileIO,
FilePath filePath)
public TungstenPropertiesIO(java.io.File path)
| Method Detail |
|---|
public java.lang.String getFormat()
public void setFormat(java.lang.String format)
public java.lang.String getCharset()
public void setCharset(java.lang.String charset)
public boolean exists()
public boolean delete()
public void write(TungstenProperties properties,
boolean fsync)
throws FileIOException
properties - Properties to be writtenfsync - If true issue an fsync, otherwise just flush
FileIOException - Thrown if file is not writable
public TungstenProperties read()
throws FileIOException
FileIOException - Thrown if file is not readable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||