|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.util.BasePropertiesFile
com.ibm.di.util.PropertiesFile
public class PropertiesFile
In-memory representation of a TDI properties file. It may contain comments and empty lines as well as property definitions. It may also contain references to other properties files. The properties file could also be encrypted.
A property in a TDI properties file can be protected or non-protected. Protected properties normally have their keys prefixed with PropertiesFile.PROTECT_PREFIX. Protected properties may have their values encrypted. If a property value is encrypted, it will be prefixed with PropertiesFile.PROTECT_VAL_PREFIX. If a property's value is encrypted, the property is considered protected no matter if it is actually marked as protected.
BasePropertiesFile
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.ibm.di.util.BasePropertiesFile |
---|
BasePropertiesFile.Property |
Field Summary | |
---|---|
static String |
INCLUDE_DIRECTIVE
Include directive "!include <other-file/url>" |
static String |
MERGE_DIRECTIVE
Merge directive - "!merge <other-file/url>". |
Fields inherited from class com.ibm.di.util.BasePropertiesFile |
---|
lines, modified, properties, propertyCrypto, PROTECT_PREFIX, PROTECT_VAL_PREFIX, resHash |
Constructor Summary | |
---|---|
PropertiesFile(Crypto propertyCrypto)
Create an empty object. |
|
PropertiesFile(Crypto propertyCrypto,
String path,
boolean resolveReferences)
Load a properties file in memory. |
|
PropertiesFile(Crypto propertyCrypto,
String path,
boolean resolveReferences,
Crypto fileCrypto,
String prefixToSkip)
Load a properties file in memory. |
|
PropertiesFile(String path,
boolean resolveReferences)
Load a properties file in memory. |
Method Summary | |
---|---|
void |
store(String path)
Write the contents of this properties file to disk. |
void |
store(String path,
String header,
Crypto fileCrypto)
Write the contents of this properties file to disk. |
Methods inherited from class com.ibm.di.util.BasePropertiesFile |
---|
getProperty, isModified, isPropertyEncrypted, isPropertyProtected, keys, removeProperty, setProperty, setPropertyEncrypted, setPropertyProtected |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String INCLUDE_DIRECTIVE
Include directive "!include <other-file/url>"
Include one properties file into another properties file. Properties defined in the main properties file before the include directive can be potentially overridden by properties from the included file. Properties defined in the main properties file after the include directive can potentially override properties from the included file.
public static final String MERGE_DIRECTIVE
Merge directive - "!merge <other-file/url>".
Merge the contents of one properties file into another properties file. Properties defined in the main properties file before the merge directive will not be overwritten by the properties from the merged file. Properties defined in the main properties file after the merge directive can potentially override properties from the merged file.
Constructor Detail |
---|
public PropertiesFile(Crypto propertyCrypto)
propertyCrypto
- object used to encrypt/decrypt values of protected propertiespublic PropertiesFile(String path, boolean resolveReferences) throws Exception
path
- properties file to loadresolveReferences
- whether to load the properties files that the specified file
references
Exception
- error while reading the properties filepublic PropertiesFile(Crypto propertyCrypto, String path, boolean resolveReferences) throws Exception
propertyCrypto
- object used to encrypt/decrypt values of protected propertiespath
- properties file to loadresolveReferences
- whether to load the properties files that the specified file
references
Exception
- error while reading the properties filepublic PropertiesFile(Crypto propertyCrypto, String path, boolean resolveReferences, Crypto fileCrypto, String prefixToSkip) throws Exception
propertyCrypto
- object used to encrypt/decrypt values of protected propertiespath
- properties file to loadresolveReferences
- whether to load the properties files that the specified file
referencesfileCrypto
- object used to decrypt the file; pass null if the properties
file is not encrypted as a wholeprefixToSkip
- prefix that matches lines from the properties file, which will
be skipped during processing; pass null to read all lines
Exception
- error while reading the properties file, or error while
decrypting itMethod Detail |
---|
public void store(String path, String header, Crypto fileCrypto) throws Exception
path
- a file, whether the contents will be savedheader
- an optional header, that will be put as the first line in the
properties file; must be a single comment linefileCrypto
- object used to encrypt the file as a whole; if null the file
will not be encrypted as a whole
Exception
- error while writing the file or error while encrypting the
filepublic void store(String path) throws Exception
store
in class BasePropertiesFile
path
- a file, whether the contents will be saved
Exception
- error while writing the file
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |