| java.lang.Object org.tigris.scarab.util.build.PropertyFileGenerator
PropertyFileGenerator | public class PropertyFileGenerator (Code) | | This class is used as ant task backend for the generation
of a property file by use of a template file.
author: Hussayn Dabbous version: $Id: PropertyFileGenerator.java 9429 2005-02-25 21:24:30Z dabbous $ |
Method Summary | |
public void | execute(PropertyGetter props) Read the templateFile and behave according to
following rule set:
- rule 1: Copy every line, which does NOT contain
a property verbatim to the customFile.
- rule 2: Retrieve the current online value of each
property found in the templateFile and generate an
appropriate name/value pair in the customFile.
- rule 3: If a property value starts with a "${" in
the templateFile, keep the value as is.
| public String | getCustom() Return the absoute path to the customFile, or null, if no path
has been set. | public String | getTemplate() Return the absolute path to the templateFile, or null, if
no template file has been set. | public boolean | setCustom(String theCustomPath) Setter: set the path to the final property file. | public boolean | setProperties(String theUserPathes) Setter: Create a Map of unresolved properties from
the files defined in theUserpathes. | public boolean | setTemplate(String theTemplatePath) Setter: set the path to the template file. |
execute | public void execute(PropertyGetter props) throws IOException(Code) | | Read the templateFile and behave according to
following rule set:
- rule 1: Copy every line, which does NOT contain
a property verbatim to the customFile.
- rule 2: Retrieve the current online value of each
property found in the templateFile and generate an
appropriate name/value pair in the customFile.
- rule 3: If a property value starts with a "${" in
the templateFile, keep the value as is. By this we
can propagate ${variables} to the customFile, which
will be resolved during startup of Scarab.
|
getCustom | public String getCustom()(Code) | | Return the absoute path to the customFile, or null, if no path
has been set.
|
getTemplate | public String getTemplate()(Code) | | Return the absolute path to the templateFile, or null, if
no template file has been set.
|
setCustom | public boolean setCustom(String theCustomPath)(Code) | | Setter: set the path to the final property file.
Throws an exception, if the customFile exist,
but can't be overwritten (due to permission settings).
Parameters: theCustomPath - |
setProperties | public boolean setProperties(String theUserPathes)(Code) | | Setter: Create a Map of unresolved properties from
the files defined in theUserpathes.
Throws an exception, if a customFile exist,
but can't be read (due to permission settings).
First definition of a property wins.
Parameters: theUserPath - |
setTemplate | public boolean setTemplate(String theTemplatePath)(Code) | | Setter: set the path to the template file.
Throws an exception, if the template file does not exist.
Parameters: theTemplatePath - |
|
|