Package com.openstego.desktop
Class OpenStegoConfig
- java.lang.Object
-
- com.openstego.desktop.OpenStegoConfig
-
public class OpenStegoConfig extends Object
Class to store configuration data for OpenStego
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENCRYPTION_ALGORITHM
Key string for configuration item - encryptionAlgorithmstatic String
PASSWORD
Key string for configuration item - passwordstatic String
USE_COMPRESSION
Key string for configuration item - useCompressionstatic String
USE_ENCRYPTION
Key string for configuration item - useEncryption
-
Constructor Summary
Constructors Constructor Description OpenStegoConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
convertCmdLineOptionsToMap(CmdLineOptions options)
Converts command line options to Map formString
getEncryptionAlgorithm()
Get Method for encryptionAlgorithmString
getPassword()
Get Method for passwordvoid
initialize(CmdLineOptions options)
Initialize the configuration from command-line options.void
initialize(Map<String,Object> propMap)
Initialize the configuration with map data.boolean
isUseCompression()
Get method for configuration item - useCompressionboolean
isUseEncryption()
Get Method for useEncryptionprotected void
processConfigItem(String key, Object value)
Processes a configuration item.void
setEncryptionAlgorithm(String encryptionAlgorithm)
Set Method for encryptionAlgorithmvoid
setPassword(String password)
Set Method for passwordvoid
setUseCompression(boolean useCompression)
Set method for configuration item - useCompressionvoid
setUseEncryption(boolean useEncryption)
Set Method for useEncryption
-
-
-
Field Detail
-
USE_COMPRESSION
public static final String USE_COMPRESSION
Key string for configuration item - useCompressionFlag to indicate whether compression should be used or not
- See Also:
- Constant Field Values
-
USE_ENCRYPTION
public static final String USE_ENCRYPTION
Key string for configuration item - useEncryptionFlag to indicate whether encryption should be used or not
- See Also:
- Constant Field Values
-
PASSWORD
public static final String PASSWORD
Key string for configuration item - passwordPassword for encryption in case "useEncryption" is set to true
- See Also:
- Constant Field Values
-
ENCRYPTION_ALGORITHM
public static final String ENCRYPTION_ALGORITHM
Key string for configuration item - encryptionAlgorithmAlgorithm to be used for encryption
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public final void initialize(Map<String,Object> propMap) throws OpenStegoException
Initialize the configuration with map data. Please make sure that only valid keys for configuration items are provided, and the values for those items are also valid.- Parameters:
propMap
- Map containing the configuration data- Throws:
OpenStegoException
- Processing issues
-
initialize
public final void initialize(CmdLineOptions options) throws OpenStegoException
Initialize the configuration from command-line options.- Parameters:
options
- Command-line options- Throws:
OpenStegoException
- Processing issues
-
convertCmdLineOptionsToMap
protected Map<String,Object> convertCmdLineOptionsToMap(CmdLineOptions options) throws OpenStegoException
Converts command line options to Map form- Parameters:
options
- Command-line options- Returns:
- Options in Map form
- Throws:
OpenStegoException
- Processing issues
-
processConfigItem
protected void processConfigItem(String key, Object value) throws OpenStegoException
Processes a configuration item.- Parameters:
key
- Configuration item keyvalue
- Configuration item value- Throws:
OpenStegoException
- Processing issues
-
isUseCompression
public boolean isUseCompression()
Get method for configuration item - useCompression- Returns:
- useCompression
-
setUseCompression
public void setUseCompression(boolean useCompression)
Set method for configuration item - useCompression- Parameters:
useCompression
- Value to be set
-
isUseEncryption
public boolean isUseEncryption()
Get Method for useEncryption- Returns:
- useEncryption
-
setUseEncryption
public void setUseEncryption(boolean useEncryption)
Set Method for useEncryption- Parameters:
useEncryption
- Value to be set
-
getPassword
public String getPassword()
Get Method for password- Returns:
- password
-
setPassword
public void setPassword(String password)
Set Method for password- Parameters:
password
- Value to be set
-
getEncryptionAlgorithm
public String getEncryptionAlgorithm()
Get Method for encryptionAlgorithm- Returns:
- encryptionAlgorithm
-
setEncryptionAlgorithm
public void setEncryptionAlgorithm(String encryptionAlgorithm)
Set Method for encryptionAlgorithm- Parameters:
encryptionAlgorithm
- Value to be set
-
-