public class Configuration extends Object implements Closeable
| Constructor and Description |
|---|
Configuration() |
Configuration(File propertyFile) |
Configuration(File propertyFile,
Map<String,String> placeholders) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Map<String,String> |
getPlaceholders() |
String |
getProperty(String name) |
String |
getProperty(String name,
String defaultValue) |
boolean |
getPropertyAsBoolean(String name) |
boolean |
getPropertyAsBoolean(String name,
boolean defaultValue) |
File |
getPropertyAsDirectory(String name) |
File |
getPropertyAsDirectory(String name,
File defaultValue) |
File |
getPropertyAsFile(String name) |
File |
getPropertyAsFile(String name,
File defaultValue) |
Integer |
getPropertyAsInteger(String name) |
Integer |
getPropertyAsInteger(String name,
Integer defaultValue) |
Long |
getPropertyAsLong(String name) |
Long |
getPropertyAsLong(String name,
Long defaultValue) |
File |
getPropertyFile() |
Set<Object> |
getPropertyNames() |
boolean |
hasProperty(String name) |
void |
load() |
void |
putProperty(String name,
String value) |
public Configuration()
public Configuration(File propertyFile) throws IOException
IOExceptionpublic Configuration(File propertyFile, Map<String,String> placeholders) throws IOException
IOExceptionpublic void load()
throws FileNotFoundException,
IOException
FileNotFoundExceptionIOExceptionpublic boolean getPropertyAsBoolean(String name)
public boolean hasProperty(String name)
public boolean getPropertyAsBoolean(String name, boolean defaultValue)
public File getPropertyFile()
public Set<Object> getPropertyNames()
Set of property names (keys) contained in this Configurationpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2019. All rights reserved.