public class FileBasedSettings extends Settings
| Constructor and Description |
|---|
FileBasedSettings(File stream) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush(boolean metadata)
Flushes file data to stable storage.
|
File |
getStream() |
void |
load() |
void |
setLong(String key,
long value,
boolean flush)
Sets the value corresponding to the given key.
|
getBoolean, getBoolean, getInteger, getInteger, getLong, getLong, getString, getString, isDefined, setBoolean, setBoolean, setInteger, setInteger, setLong, setString, setStringpublic FileBasedSettings(File stream)
public File getStream()
public void flush(boolean metadata)
throws IOException
metadata is true, both file data and metadata (e.g., file size) are forced to disk.
When false, only file data is flushed.metadata - whether file metadata should also be flushedIOException - if the flush operation failspublic void load()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic void setLong(String key, long value, boolean flush) throws IOException
SettingssetLong in class Settingskey - keyvalue - valueflush - whether to save to persistent storage immediatelyIOException - if value storing failedCopyright © 2005–2025 Onix Solutions. All rights reserved.