public enum Configuration extends Enum<Configuration>
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
String |
get(String key)
Returns the value of a specific entry from the "
configuration.properties " file. |
Configuration |
loadFromFile(File file)
Loads configuration from file.
|
Configuration |
loadFromUserProfile()
Loads configuration from the .fakesmtp.properties file in user profile directory.
|
void |
saveToFile(File file)
Saves configuration to file.
|
void |
saveToUserProfile()
Saves configuration to the
.fakesmtp.properties file in user profile directory. |
void |
set(String key,
String value)
Sets the value of a specific entry.
|
static Configuration |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Configuration[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Configuration INSTANCE
public static Configuration[] values()
for (Configuration c : Configuration.values()) System.out.println(c);
public static Configuration valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String get(String key)
configuration.properties
" file.key
- a string representing the key from a key/value couple.public void set(String key, String value)
key
- a string representing the key from a key/value couple.value
- the value of the key.public void saveToFile(File file) throws IOException
file
- file to save configuration.IOException
public void saveToUserProfile() throws IOException
.fakesmtp.properties
file in user profile directory.
Calls saveToFile(java.io.File)
.IOException
public Configuration loadFromFile(File file) throws IOException
file
- file to load configuration.IOException
public Configuration loadFromUserProfile() throws IOException
loadFromFile(java.io.File)
.IOException
Copyright © 2015. All rights reserved.