org.tigris.scarab.util.build
Class PropertyFileGenerator

java.lang.Object
  extended byorg.tigris.scarab.util.build.PropertyFileGenerator

public class PropertyFileGenerator
extends java.lang.Object

This class is used as ant task backend for the generation of a property file by use of a template file.

Version:
$Id: PropertyFileGenerator.java 9429 2005-02-25 21:24:30Z dabbous $
Author:
Hussayn Dabbous

Constructor Summary
PropertyFileGenerator()
           
 
Method Summary
 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.
 java.lang.String getCustom()
          Return the absoute path to the customFile, or null, if no path has been set.
 java.lang.String getTemplate()
          Return the absolute path to the templateFile, or null, if no template file has been set.
 boolean setCustom(java.lang.String theCustomPath)
          Setter: set the path to the final property file.
 boolean setProperties(java.lang.String theUserPathes)
          Setter: Create a Map of unresolved properties from the files defined in theUserpathes.
 boolean setTemplate(java.lang.String theTemplatePath)
          Setter: set the path to the template file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyFileGenerator

public PropertyFileGenerator()
Method Detail

setTemplate

public boolean setTemplate(java.lang.String theTemplatePath)
Setter: set the path to the template file. Throws an exception, if the template file does not exist.

Parameters:
theTemplatePath -
Returns:

getTemplate

public java.lang.String getTemplate()
Return the absolute path to the templateFile, or null, if no template file has been set.

Returns:

setCustom

public boolean setCustom(java.lang.String theCustomPath)
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 -

getCustom

public java.lang.String getCustom()
Return the absoute path to the customFile, or null, if no path has been set.

Returns:

setProperties

public boolean setProperties(java.lang.String theUserPathes)
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.


execute

public void execute(PropertyGetter props)
             throws java.io.IOException
Read the templateFile and behave according to following rule set:

Throws:
java.io.IOException


Copyright © 2000-2004 Tigris.org. All Rights Reserved.