Package com.nilhcem.fakesmtp.core
Enum Class Configuration
- All Implemented Interfaces:
Serializable
,Comparable<Configuration>
,java.lang.constant.Constable
Contains and returns some project-specific configuration variables.
- Since:
- 1.0
- Author:
- Nilhcem
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of a specific entry from the "configuration.properties
" file.loadFromFile
(File file) Loads configuration from file.Loads configuration from the .fakesmtp.properties file in user profile directory.void
saveToFile
(File file) Saves configuration to file.void
Saves configuration to the.fakesmtp.properties
file in user profile directory.void
Sets the value of a specific entry.static Configuration
Returns the enum constant of this class with the specified name.static Configuration[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
get
Returns the value of a specific entry from the "configuration.properties
" file.- Parameters:
key
- a string representing the key from a key/value couple.- Returns:
- the value of the key, or an empty string if the key was not found.
-
set
Sets the value of a specific entry.- Parameters:
key
- a string representing the key from a key/value couple.value
- the value of the key.
-
saveToFile
Saves configuration to file.- Parameters:
file
- file to save configuration.- Throws:
IOException
-
saveToUserProfile
Saves configuration to the.fakesmtp.properties
file in user profile directory. CallssaveToFile(java.io.File)
.- Throws:
IOException
-
loadFromFile
Loads configuration from file.- Parameters:
file
- file to load configuration.- Returns:
- INSTANCE.
- Throws:
IOException
-
loadFromUserProfile
Loads configuration from the .fakesmtp.properties file in user profile directory. CallsloadFromFile(java.io.File)
.- Returns:
- INSTANCE.
- Throws:
IOException
-