org.apache.jetspeed.util
Class OverwriteProperties

java.lang.Object
  extended byorg.apache.jetspeed.util.OverwriteProperties

public class OverwriteProperties
extends java.lang.Object

Task to overwrite Properties: used for JRP, TRP and Torque.properties

Version:
$Id: OverwriteProperties.java,v 1.4 2004/02/23 03:23:42 jford Exp $
Author:
David Sean Taylor, Eric Pugh

Field Summary
protected  java.util.ArrayList baseArray
          An array of all the properties
protected  java.util.HashMap baseMap
          Description of the Field
protected  java.io.File baseProperties
          The file to merge properties into
protected  java.io.File includeRoot
          The directory to look in for include files
protected  java.lang.String lineSeparator
          What to use as a line seperator
protected  java.io.File properties
          The file to pull the properties from
protected  java.util.ArrayList removeArray
          An array of all the properties that will be removed
 boolean verbose
          Description of the Field
 
Constructor Summary
OverwriteProperties()
           
 
Method Summary
 void execute()
          Description of the Method
 java.io.File getBaseProperties()
          Return the file to merge propertie into
 java.io.File getIncludeRoot()
          Gets the includeRoot attribute of the OverwriteProperties object
 java.io.File getProperties()
          Gets the properties attribute of the OverwriteProperties object
 boolean getVerbose()
          Gets the verbose attribute of the OverwriteProperties object
static void main(java.lang.String[] args)
          The main program for the OverwriteProperties class
 void readProperties(java.io.File propFile, int index)
          Reads in the properties from the specified file
 boolean[] removeProperties()
          Description of the Method
 void setBaseProperties(java.io.File baseProperties)
          Sets the file to merge properties into
 void setIncludeRoot(java.io.File includeRoot)
          Sets the directory to look for includes in.
 void setProperties(java.io.File properties)
          Sets the file to pull properties from
 void setVerbose(boolean verbose)
          Sets whether to output extra debugging info
 void writeToFile(boolean[] flags)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

baseProperties

protected java.io.File baseProperties
The file to merge properties into


properties

protected java.io.File properties
The file to pull the properties from


includeRoot

protected java.io.File includeRoot
The directory to look in for include files


verbose

public boolean verbose
Description of the Field


baseArray

protected java.util.ArrayList baseArray
An array of all the properties


removeArray

protected java.util.ArrayList removeArray
An array of all the properties that will be removed


baseMap

protected java.util.HashMap baseMap
Description of the Field


lineSeparator

protected java.lang.String lineSeparator
What to use as a line seperator

Constructor Detail

OverwriteProperties

public OverwriteProperties()
Method Detail

setBaseProperties

public void setBaseProperties(java.io.File baseProperties)
Sets the file to merge properties into

Parameters:
baseProperties - The file path to merge properties into

setProperties

public void setProperties(java.io.File properties)
Sets the file to pull properties from

Parameters:
properties - The file path to the pull the merge properties from

setIncludeRoot

public void setIncludeRoot(java.io.File includeRoot)
Sets the directory to look for includes in.

Parameters:
includeRoot - the directory to look in.

setVerbose

public void setVerbose(boolean verbose)
Sets whether to output extra debugging info

Parameters:
verbose - The new verbose value

getBaseProperties

public java.io.File getBaseProperties()
Return the file to merge propertie into

Returns:
The baseProperties value

getProperties

public java.io.File getProperties()
Gets the properties attribute of the OverwriteProperties object

Returns:
The properties value

getIncludeRoot

public java.io.File getIncludeRoot()
Gets the includeRoot attribute of the OverwriteProperties object

Returns:
The includeRoot value

getVerbose

public boolean getVerbose()
Gets the verbose attribute of the OverwriteProperties object

Returns:
The verbose value

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
The main program for the OverwriteProperties class

Parameters:
args - The command line arguments
Throws:
java.lang.Exception - Description of the Exception

execute

public void execute()
             throws java.io.FileNotFoundException,
                    java.io.IOException,
                    java.lang.SecurityException
Description of the Method

Throws:
java.io.FileNotFoundException
java.io.IOException
java.lang.SecurityException

writeToFile

public void writeToFile(boolean[] flags)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
Description of the Method

Parameters:
flags - Description of the Parameter
Throws:
java.io.FileNotFoundException - Description of the Exception
java.io.IOException - Description of the Exception

removeProperties

public boolean[] removeProperties()
Description of the Method

Returns:
Description of the Return Value

readProperties

public void readProperties(java.io.File propFile,
                           int index)
                    throws java.io.FileNotFoundException,
                           java.io.IOException
Reads in the properties from the specified file

Parameters:
propFile - Description of the Parameter
index - Description of the Parameter
Throws:
java.io.FileNotFoundException - Description of the Exception
java.io.IOException - Description of the Exception


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.