com.ibm.di.util
Class JavaPropertiesFile
java.lang.Object
com.ibm.di.util.BasePropertiesFile
com.ibm.di.util.JavaPropertiesFile
public class JavaPropertiesFile extends BasePropertiesFile
In-memory representation of a Java properties file that can contain protected
properties with encrypted values. This class reads and writes valid Java
properties. When writing the order of the properties and the user comments
are kept. Only the changed properties are stored in the output file.
Since:
7.1
See Also: PropertiesFile
Constructor Summary
JavaPropertiesFile (String path)
Constructs Java properties file without any encryption/decryption of
properties.
JavaPropertiesFile (String path,
String keyStoreProp,
String keyStoreTypeProp,
String keyStoreAliasProp,
String transformationProp,
String stashFileProp)
Constructs Java properties file, obtain keystore and key passwords from
the stash file and encrypt/decrypt protected properties.
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
JavaPropertiesFile
public JavaPropertiesFile (String path)
throws Exception
Constructs Java properties file without any encryption/decryption of
properties.
Parameters: path
- path to properties files
Throws:
Exception
JavaPropertiesFile
public JavaPropertiesFile (String path,
String keyStoreProp,
String keyStoreTypeProp,
String keyStoreAliasProp,
String transformationProp,
String stashFileProp)
throws Exception
Constructs Java properties file, obtain keystore and key passwords from
the stash file and encrypt/decrypt protected properties.
Parameters: path
- path to properties fileskeyStoreProp
- keystore password property namekeyStoreTypeProp
- keystore type property namekeyStoreAliasProp
- alias property nametransformationProp
- transformation property namestashFileProp
- stash file property name
Throws:
Exception
store
public void store (String path)
throws Exception
Write the contents of this properties file to disk. The order of the
properties order and all user comments are kept. Only the modified
properties are overwritten in the file.
Specified by: store
in class BasePropertiesFile
Parameters: path
- a file, whether the contents will be saved
Throws:
Exception
- error while writing the file or error while encrypting the
file
asProperties
public Properties asProperties ()
throws Exception
Returns: Properties object representing the contents of this properties
file
Throws:
Exception
- if not able to decrypt some property value