Filewatcher File Search
FTP Search
  
Directory (beta)
  
Content Search (beta)
   
pkg://jakarta-commons-configuration-1.0.d3-1jpp.src.rpm:139534/commons-configuration-src-20040113.tar.gz  info  downloads

commons-configuration/0040775000076400007640000000000010000764227015514 5ustar  craigmcccraigmcccommons-configuration/.cvsignore0100664000076400007640000000016510000764226017512 0ustar  craigmcccraigmcc*~
.nbattrs
docs
target
test-reports
velocity.log*
maven.log
STRING0
lib
.classpath
.project
*.ser
junit*.properties
commons-configuration/LICENSE.txt0100664000076400007640000000515310000764226017337 0ustar  craigmcccraigmcc

/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowledgement:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgement may appear in the software itself,
 *    if and wherever such third-party acknowledgements normally appear.
 *
 * 4. The names "The Jakarta Project", "Commons", and "Apache Software
 *    Foundation" must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache"
 *    nor may "Apache" appear in their names without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */
commons-configuration/PROPOSAL.html0100664000076400007640000000412510000764226017637 0ustar  craigmcccraigmcc<html>
<head>
<title>Proposal for Configuration Package</title>
</head>
<body bgcolor="white">

<div align="center">
<h1>Proposal for <em>Configuration</em> Package</h1>
</div>

<h3>(0) Rationale</h3>

<p>There is currently no configuration package that can work with multiple
sources of data, and provide configuration capabilities for multiple applications.
This package provides a simple to use api for performing configuration.
</p>


<h3>(1) Scope of the Package</h3>

<p>This proposal is to create a package of Java utility classes to read
simplify configuring a java application.</p>


<h3>(1.5) Interaction With Other Packages</h3>

<p><em>Configuration</em> relies on many other commons packages.  It will utilize 
the JUnit unit testing framework for developing and executing unit tests, but 
this is of interest only to developers of the component.</p>



<h3>(2) Initial Source of the Package</h3>

<p>This code originated in JServ, was brought into Turbine,
moved to Velocity and improved, and then moved into the Commons
as Configurations sub-project.</p>

<p>The proposed package name for the new component is
<code>org.apache.commons.configuration</code>.</p>


<h3>(3)  Required Jakarta-Commons Resources</h3>

<ul>
<li>CVS Repository - New directory <code>configuration</code> in the
    <code>jakarta-commons</code> CVS repository.</li>
<li>Mailing List - Discussions will take place on the general
    <em>commons-dev@jakarta.apache.org</em> mailing list.  To help
    list subscribers identify messages of interest, it is suggested that
    the message subject of messages about this component be prefixed with
    [Configuration].</li>
<li>Bugzilla - New component "Configuration" under the "Commons" product
    category, with appropriate version identifiers as needed.</li>
<li>Jyve FAQ - New category "commons-configuration" (when available).</li>
</ul>


<h3>(4) Initial Committers</h3>

<p>The initial committers on the Configuration component shall be as follows:
<ul>
<li>Eric Pugh (epugh)</li>
<li>Henning P. Schmiedehausen (henning)</li>
<li>Martin Poeschl (mpoeschl)</li>

</ul>
</p>

</body>
</html>
commons-configuration/RELEASE-NOTES.txt0100664000076400007640000000100210000764226020210 0ustar  craigmcccraigmcc$Id: RELEASE-NOTES.txt,v 1.1.1.1 2003/12/23 15:09:05 epugh Exp $

                           Commons Configuration Package
                               Version 1.0
                                 Release Notes


INTRODUCTION
============

This document contains the release notes for this version of the Commons
Configuration component, and highlights changes since the previous version.


NEW FEATURES
============

This is the first milestone release of this component.


BUG FIXES
=========

Not applicable.
commons-configuration/build-gump.xml0100664000076400007640000000133710000764226020303 0ustar  craigmcccraigmcc<!--

  WARNING: This file is generated! Do not edit by hand!
  
-->

<project name="maven" default="jar" basedir=".">

  <target
    name="jar">
    
    <property name="maven.build.dir" value="target"/>
    <property name="maven.build.dest" value="${maven.build.dir}/classes"/>
    
    <mkdir dir="${maven.build.dest}"/>
    
    <javac
      destdir="${maven.build.dest}"
      excludes="**/package.html"
      debug="false"
      deprecation="false"
      optimize="false">
      <src>
         <pathelement location="src/java"/>
      </src>
    </javac>

    <jar
      jarfile="${maven.build.dir}/${maven.final.name}.jar"
      basedir="${maven.build.dest}"
      excludes="**/package.html"
    />
    
  </target>

</project>
commons-configuration/build.xml0100664000076400007640000001710710000764226017337 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="UTF-8"?>

<!--build.xml generated by maven from project.xml version 1.0-dev-3
  on date December 6 2003, time 2357-->

<project default="jar" name="commons-configuration" basedir=".">
  <property name="defaulttargetdir" value="target">
  </property>
  <property name="libdir" value="target/lib">
  </property>
  <property name="classesdir" value="target/classes">
  </property>
  <property name="testclassesdir" value="target/test-classes">
  </property>
  <property name="testreportdir" value="target/test-reports">
  </property>
  <property name="distdir" value="dist">
  </property>
  <property name="javadocdir" value="dist/docs/api">
  </property>
  <property name="final.name" value="commons-configuration-1.0-dev-3">
  </property>
  <target name="init" description="o Initializes some properties">
    <mkdir dir="${libdir}">
    </mkdir>
    <condition property="noget">
      <equals arg2="only" arg1="${build.sysclasspath}">
      </equals>
    </condition>
  </target>
  <target name="compile" description="o Compile the code" depends="get-deps">
    <mkdir dir="${classesdir}">
    </mkdir>
    <javac destdir="${classesdir}" deprecation="true" debug="true" optimize="false" excludes="**/package.html">
      <src>
        <pathelement location="src/java">
        </pathelement>
      </src>
      <classpath>
        <fileset dir="${libdir}">
          <include name="*.jar">
          </include>
        </fileset>
      </classpath>
    </javac>
    <copy todir="${classesdir}">
      <fileset dir="conf">
        <include name="*">
        </include>
      </fileset>
    </copy>
    <copy todir="${testclassesdir}/org/apache/commons/configuration">
      <fileset dir="conf">
        <include name="testClasspath.properties">
        </include>
      </fileset>
    </copy>
    <copy todir="${testclassesdir}/org/apache/commons/configuration">
      <fileset dir="conf">
        <include name="*.properties">
        </include>
        <exclude name="testClasspath.properties">
        </exclude>
      </fileset>
    </copy>
  </target>
  <target name="jar" description="o Create the jar" depends="compile,test">
    <jar jarfile="target/${final.name}.jar" excludes="**/package.html" basedir="${classesdir}">
    </jar>
  </target>
  <target name="clean" description="o Clean up the generated directories">
    <delete dir="${defaulttargetdir}">
    </delete>
    <delete dir="${distdir}">
    </delete>
  </target>
  <target name="dist" description="o Create a distribution" depends="jar, javadoc">
    <mkdir dir="dist">
    </mkdir>
    <copy todir="dist">
      <fileset dir="${defaulttargetdir}" includes="*.jar">
      </fileset>
      <fileset dir="${basedir}" includes="LICENSE*, README*">
      </fileset>
    </copy>
  </target>
  <target name="test" description="o Run the test cases" if="test.failure" depends="internal-test">
    <fail message="There were test failures.">
    </fail>
  </target>
  <target name="internal-test" depends="compile-tests">
    <mkdir dir="${testreportdir}">
    </mkdir>
    <junit dir="./" failureproperty="test.failure" printSummary="yes" fork="true" haltonerror="true">
      <sysproperty key="basedir" value=".">
      </sysproperty>
      <formatter type="xml">
      </formatter>
      <formatter usefile="false" type="plain">
      </formatter>
      <classpath>
        <fileset dir="${libdir}">
          <include name="*.jar">
          </include>
        </fileset>
        <pathelement path="${testclassesdir}">
        </pathelement>
        <pathelement path="${classesdir}">
        </pathelement>
      </classpath>
      <batchtest todir="${testreportdir}">
        <fileset dir="src/test">
          <include name="**/*Test*.java">
          </include>
          <exclude name="**/TestBasePropertiesConfiguration.java">
          </exclude>
          <exclude name="**/NonStringTestHolder.java">
          </exclude>
        </fileset>
      </batchtest>
    </junit>
  </target>
  <target name="compile-tests" depends="compile">
    <mkdir dir="${testclassesdir}">
    </mkdir>
    <javac destdir="${testclassesdir}" deprecation="true" debug="true" optimize="false" excludes="**/package.html">
      <src>
        <pathelement location="src/test">
        </pathelement>
      </src>
      <classpath>
        <fileset dir="${libdir}">
          <include name="*.jar">
          </include>
        </fileset>
        <pathelement path="${classesdir}">
        </pathelement>
      </classpath>
    </javac>
  </target>
  <target name="javadoc" description="o Generate javadoc" depends="jar">
    <mkdir dir="${javadocdir}">
    </mkdir>
    <tstamp>
      <format pattern="2001-yyyy" property="year">
      </format>
    </tstamp>
    <property name="copyright" value="Copyright &amp;copy;  Apache Software Foundation. All Rights Reserved.">
    </property>
    <property name="title" value="commons-configuration 1.0-dev-3 API">
    </property>
    <javadoc use="true" private="true" destdir="${javadocdir}" author="true" version="true" sourcepath="src/java" packagenames="org.apache.commons.configuration.*">
      <classpath>
        <fileset dir="${libdir}">
          <include name="*.jar">
          </include>
        </fileset>
        <pathelement location="target/${final.name}.jar">
        </pathelement>
      </classpath>
    </javadoc>
  </target>
  <target name="get-deps" unless="noget" depends="init">
    <get dest="${libdir}/commons-collections-2.1.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/commons-collections/jars/commons-collections-2.1.jar">
    </get>
    <get dest="${libdir}/commons-lang-2.0.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/commons-lang/jars/commons-lang-2.0.jar">
    </get>
    <get dest="${libdir}/commons-logging-1.0.3.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/commons-logging/jars/commons-logging-1.0.3.jar">
    </get>
    <get dest="${libdir}/dom4j-1.4.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/dom4j/jars/dom4j-1.4.jar">
    </get>
    <get dest="${libdir}/commons-digester-1.5.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/commons-digester/jars/commons-digester-1.5.jar">
    </get>
    <get dest="${libdir}/commons-beanutils-1.7-dev.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/commons-beanutils/jars/commons-beanutils-1.7-dev.jar">
    </get>
    <get dest="${libdir}/junit-3.8.1.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar">
    </get>
    <get dest="${libdir}/xerces-2.2.1.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/xerces/jars/xerces-2.2.1.jar">
    </get>
    <get dest="${libdir}/xml-apis-2.0.2.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/xml-apis/jars/xml-apis-2.0.2.jar">
    </get>
    <get dest="${libdir}/junit-3.8.1.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar">
    </get>
    <get dest="${libdir}/ant-1.5.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/ant/jars/ant-1.5.jar">
    </get>
    <get dest="${libdir}/ant-optional-1.5.jar" usetimestamp="true" ignoreerrors="true" src="http://www.ibiblio.org/maven/ant/jars/ant-optional-1.5.jar">
    </get>
  </target>
  <target name="install-maven">
    <get dest="${user.home}/maven-install-latest.jar" usetimestamp="true" src="${repo}/maven/maven-install-latest.jar">
    </get>
    <unjar dest="${maven.home}" src="${user.home}/maven-install-latest.jar">
    </unjar>
  </target>
</project>
commons-configuration/gump.xml0100664000076400007640000000265510000764226017212 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="UTF-8"?>

<module name="commons-configuration">
  <description>Common ConfigurationTools</description>
  <url href="http://jakarta.apache.org/commons/configuration/">
  </url>
  <cvs module="jakarta-commons" repository="jakarta">
  </cvs>
  <project name="commons-configuration">
    <ant buildfile="build.xml" target="dist">
      <property name="final.name" value="commons-configuration-@@DATE@@">
      </property>
    </ant>
    <package>org.apache.commons.configuration</package>
    <depend project="commons-beanutils">
    </depend>
    <depend project="commons-collections">
    </depend>
    <depend project="commons-digester">
    </depend>
    <depend project="commons-lang">
    </depend>
    <depend project="commons-logging">
    </depend>
    <depend project="dom4j">
    </depend>
    <depend project="jakarta-ant">
    </depend>
    <depend project="junit">
    </depend>
    <depend project="xml-apis">
    </depend>
    <depend project="xml-xerces">
    </depend>
    <depend project="xml-xerces2">
    </depend>
    <work nested="target/classes">
    </work>
    <home nested="target">
    </home>
    <jar name="commons-configuration-@@DATE@@.jar">
    </jar>
    <javadoc module="jakarta-commons" nested="target/docs/apidocs">
    </javadoc>
    <nag to="commons-dev@jakarta.apache.org" from="commons-configuration development &lt;commons-dev@jakarta.apache.org&gt;">
    </nag>
  </project>
</module>commons-configuration/maven.xml0100664000076400007640000000164010000764226017341 0ustar  craigmcccraigmcc<?xml version="1.0"?>

<!-- ===================================================================== -->
<!--                                                                       -->
<!-- $Id: maven.xml,v 1.1.1.1 2003/12/23 15:09:05 epugh Exp $ -->
<!--                                                                       -->
<!-- ===================================================================== -->

<project default="jar:jar">
  <!-- NonStringTestHolder.java contains tests shared by JUnit and Cactus
  tests.  This ugly hack moves the src from /src/test to /src/test-cactus
  so the Cactus tests will compile.  Not sure what is worse, this hack, or
  just duplicating the code!
  -->
  <preGoal name="cactus:compile">
    <copy todir="${basedir}/src/test-cactus/org/apache/commons/configuration">
        <fileset dir="${basedir}/src/test/" includes="**/NonStringTestHolder.java"/>
    </copy>
  </preGoal>
</project>


commons-configuration/project.properties0100664000076400007640000000113410000764226021273 0ustar  craigmcccraigmcc# -------------------------------------------------------------------
# P R O J E C T  P R O P E R T I E S
# -------------------------------------------------------------------

maven.xdoc.date=left
maven.xdoc.version=${pom.currentVersion}
maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html


compile.debug = on
compile.optimize = off
compile.deprecation = off

maven.checkstyle.format = turbine

maven.junit.fork=true

#cactus settings.  Make sure to point to your Tomcat!
cactus.home.tomcat4x = c:/java/tomcat
cactus.src.mergewebxml=src/test-cactus/testapp/WEB-INF/web.xml
commons-configuration/project.xml0100664000076400007640000001732310000764226017706 0ustar  craigmcccraigmcc<?xml version="1.0"?>

<!-- ===================================================================== -->
<!--                                                                       -->
<!-- $Id: project.xml,v 1.4 2004/01/11 00:59:10 tobrien Exp $ -->
<!--                                                                       -->
<!-- ===================================================================== -->

<project>
  <pomVersion>3</pomVersion>
  <name>commons-configuration</name>
  <id>commons-configuration</id>
  <currentVersion>1.0-dev-3</currentVersion>

  <organization>
    <name>Apache Software Foundation</name>
    <url>http://www.apache.org</url>
    <logo>http://jakarta.apache.org/images/jakarta-logo.gif</logo>
  </organization>

  <inceptionYear>2001</inceptionYear>
  <package>org.apache.commons.configuration</package>

  <shortDescription>Common ConfigurationTools</shortDescription>

  <!-- Gump integration -->
  <gumpRepositoryId>jakarta</gumpRepositoryId>
  <logo>/images/logo.png</logo>

  <description>
    Tools to assist in the reading of configuration/preferences files in
    various formats
  </description>

  <url>http://jakarta.apache.org/commons/configuration/</url>
  <issueTrackingUrl>http://nagoya.apache.org/scarab/servlet/scarab/</issueTrackingUrl>
  <siteAddress>jakarta.apache.org</siteAddress>
  <siteDirectory>/www/jakarta.apache.org/commons/configuration/</siteDirectory>
  <distributionDirectory>/www/jakarta.apache.org/builds/jakarta-commons/</distributionDirectory>

  <repository>
    <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-commons</connection>
    <url>http://cvs.apache.org/viewcvs/jakarta-commons/configuration/</url>
  </repository>

  <branches>
  </branches>

  <mailingLists>
    <mailingList>
      <name>Configuration List</name>
      <subscribe>commons-dev-subscribe@jakarta.apache.org</subscribe>
      <unsubscribe>commons-dev-unsubscribe@jakarta.apache.org</unsubscribe>
      <archive>http://nagoya.apache.org/eyebrowse/SummarizeList?listName=commons-dev@jakarta.apache.org</archive>
    </mailingList>
  </mailingLists>

  <developers>

    <developer>
      <name>Daniel Rall</name>
      <id>dlr</id>
      <email>dlr@finemaltcoding.com</email>
      <organization>CollabNet, Inc.</organization>
    </developer>

    <developer>
      <name>Jason van Zyl</name>
      <id>jvanzyl</id>
      <email>jason@zenplex.com</email>
      <organization>Zenplex</organization>
    </developer>

    <developer>
      <name>Martin Poeschl</name>
      <id>mpoeschl</id>
      <email>mpoeschl@marmot.at</email>
      <organization>tucana.at</organization>
    </developer>

    <developer>
      <name>dIon Gillard</name>
      <id>dion</id>
      <email>dion@multitask.com.au</email>
      <organization>Multitask Consulting</organization>
    </developer>

    <developer>
      <name>Henning P. Schmiedehausen</name>
      <id>henning</id>
      <email>hps@intermeta.de</email>
      <organization>INTERMETA - Gesellschaft fuer Mehrwertdienste mbH</organization>
    </developer>

    <developer>
      <name>Eric Pugh</name>
      <id>epugh</id>
      <email>epugh@upstate.com</email>
      <organization>upstate.com</organization>
    </developer>

    <developer>
      <name>Brian E. Dunbar</name>
      <id>bdunbar</id>
      <email>bdunbar@dunbarconsulting.org</email>
      <organization>dunbarconsulting.org</organization>
    </developer>
  </developers>
  
  <contributors>  
    <contributor>
      <name>Emmanuel Bourg</name>
      <id>ebourg</id>
      <email>e.bourg@cross-systems.com</email>
    </contributor>  	
    <contributor>
      <name>Konstantin Shaposhnikov</name>
      <id>kshaposhnikov</id>
      <email>ksh@scand.com</email>
      <organization>scand.com</organization>
    </contributor>
    <contributor>
      <name>Oliver Heger</name>
      <id>oheger</id>
      <email>oliver.heger@t-online.de</email>
    </contributor>    
  </contributors>
  
  <dependencies>
    <dependency>
      <id>commons-collections</id>
      <version>2.1</version>
      <properties>        
        <war.bundle>true</war.bundle>
      </properties>      
    </dependency>

    <dependency>
      <id>commons-lang</id>
      <version>2.0</version>
      <properties>        
        <war.bundle>true</war.bundle>
      </properties>      
    </dependency>

    <dependency>
      <id>commons-logging</id>
      <version>1.0.3</version>
      <properties>        
        <war.bundle>true</war.bundle>
      </properties>      
    </dependency>

    <dependency>
      <id>dom4j</id>
      <version>1.4</version>
      <properties>        
        <war.bundle>true</war.bundle>
      </properties>            
    </dependency>
    <dependency>
      <id>commons-digester</id>      
      <version>1.5</version>
      <properties>        
        <war.bundle>true</war.bundle>
      </properties>            
    </dependency>                    
    <dependency>
      <id>commons-beanutils</id>      
      <version>1.7-dev</version>
      <properties>        
        <war.bundle>true</war.bundle>
      </properties>            
    </dependency>                        
    <dependency>
      <id>junit</id>
      <version>3.8.1</version>
      <url>http://www.junit.org</url>
    </dependency>
    <dependency>
      <id>xerces</id>
      <version>2.2.1</version>
      <url>http://xml.apache.org/xerces2-j/</url>
      <properties>        
        <war.bundle>true</war.bundle>
      </properties> 
    </dependency>

    <dependency>
      <id>xml-apis</id>
      <version>2.0.2</version>
      <url>http://xml.apache.org/commons/</url>
      <properties>        
        <war.bundle>true</war.bundle>
      </properties>  
    </dependency>
  </dependencies>

  <build>
    <nagEmailAddress>commons-dev@jakarta.apache.org</nagEmailAddress>

    <sourceDirectory>src/java</sourceDirectory>
    <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
    <integrationUnitTestSourceDirectory/>
    <aspectSourceDirectories/>

    <!-- Unit test classes -->
    <unitTest>
      <includes>
        <include>**/*Test*.java</include>
      </includes>
      <excludes>
        <exclude>**/TestBasePropertiesConfiguration.java</exclude>
        <exclude>**/NonStringTestHolder.java</exclude>
      </excludes>
      <resources>
        <resource>
          <directory>conf</directory>
          <includes>
            <include>testClasspath.properties</include>
          </includes>
        </resource>
      </resources>
      <resources>
        <resource>
          <directory>conf</directory>
          <targetPath>org/apache/commons/configuration</targetPath> 
          <includes>
            <include>*.properties</include>
          </includes>
          <excludes>
            <exclude>testClasspath.properties</exclude>
          </excludes>          
        </resource>
      </resources>
    </unitTest>

    <!-- J A R  R E S O U R C E S -->
    <!-- Resources that are packaged up inside the JAR file -->

    <resources>
      <resource>
        <directory>conf</directory>
        <includes>
          <include>*</include>
        </includes>
      </resource>
    </resources>

    <jars>
    </jars>
  </build>
  <reports>
    <report>maven-jdepend-plugin</report>
    <report>maven-checkstyle-plugin</report>
    <report>maven-changes-plugin</report>
    <report>maven-changelog-plugin</report>
    <report>maven-file-activity-plugin</report>
    <report>maven-developer-activity-plugin</report>
    <report>maven-javadoc-plugin</report>
    <report>maven-jxr-plugin</report>
    <report>maven-junit-report-plugin</report>
    <report>maven-tasklist-plugin</report>
    <report>maven-pmd-plugin</report>
    <report>maven-simian-plugin</report>
    <report>maven-faq-plugin</report>
    <report>maven-jcoverage-plugin</report>    
  </reports>
</project>
commons-configuration/conf/0040775000076400007640000000000010000764227016441 5ustar  craigmcccraigmcccommons-configuration/conf/README0100664000076400007640000000016410000764226017316 0ustar  craigmcccraigmccDO NOT DELETE THESE FILES! 

They're used for testing the PropertiesLoader in
the TestPropertiesConfiguration class
commons-configuration/conf/digesterRules.xml0100664000076400007640000000220410000764226021776 0ustar  craigmcccraigmcc<?xml version="1.0"?>
<!DOCTYPE digester-rules PUBLIC "-//Jakarta Apache //DTD digester-rules XML V1.0//EN" "http://jakarta.apache.org/commons/digester/dtds/digester-rules.dtd">
<digester-rules>
  <pattern value="configuration/properties">
    <object-create-rule classname="org.apache.commons.configuration.PropertiesConfiguration"/>
    <set-properties-rule/>
    <set-next-rule methodname="addConfiguration" paramtype="org.apache.commons.configuration.Configuration"/>
    <call-method-rule methodname="load"/>
  </pattern>
  <pattern value="configuration/dom4j">
    <object-create-rule classname="org.apache.commons.configuration.DOM4JConfiguration"/>
    <set-properties-rule/>
    <set-next-rule methodname="addConfiguration" paramtype="org.apache.commons.configuration.Configuration"/>
    <call-method-rule methodname="load"/>
  </pattern>  
  <pattern value="configuration/jndi">
    <object-create-rule classname="org.apache.commons.configuration.JNDIConfiguration"/>
    <set-properties-rule/>
    <set-next-rule methodname="addConfiguration" paramtype="org.apache.commons.configuration.Configuration"/>
    
  </pattern>    
</digester-rules>
commons-configuration/conf/include.properties0100664000076400007640000000006710000764226022201 0ustar  craigmcccraigmccinclude.loaded = true

packages = packageb, packagec


commons-configuration/conf/test.properties0100664000076400007640000000144610000764226021537 0ustar  craigmcccraigmccconfiguration.loaded = true

packages = packagea

include = include.properties

#
# Other test properties
#

test.equals = value=one

test.empty=

#
# Test a property that uses a previous property
#
base=base
base.reference=${base}extra

#
# Non String Properties
#

test.boolean       = true
test.boolean.array = false
test.boolean.array = true

test.byte       = 10
test.byte.array = 20
test.byte.array = 30

test.double       = 10.25
test.double.array = 20.35
test.double.array = 30.45

test.float       = 20.25
test.float.array = 30.35
test.float.array = 40.45

test.integer       = 10
test.integer.array = 20
test.integer.array = 30

test.long       = 1000000
test.long.array = 2000000
test.long.array = 3000000

test.short       = 1
test.short.array = 2
test.short.array = 3

test.overwrite       = 1commons-configuration/conf/test.xml0100664000076400007640000000031610000764226020136 0ustar  craigmcccraigmcc<baseElement>
  <element>value</element>
  <element2>
    <subelement>
      <subsubelement>I'm complex!</subsubelement>
    </subelement>
  </element2>
  <test>
  	<short>8</short>
  </test>
</baseElement>commons-configuration/conf/test2.properties0100664000076400007640000000123610000764226021616 0ustar  craigmcccraigmccconfiguration.loaded = true

packages = override.packages


#
# Other test properties
#

test.equals = value=one

test.empty=

#
# Non String Properties
#

test.boolean       = true
test.boolean.array = false
test.boolean.array = true

test.byte       = 10
test.byte.array = 20
test.byte.array = 30

test.double       = 10.25
test.double.array = 20.35
test.double.array = 30.45

test.float       = 20.25
test.float.array = 30.35
test.float.array = 40.45

test.integer       = 10
test.integer.array = 20
test.integer.array = 30

test.long       = 1000000
test.long.array = 2000000
test.long.array = 3000000

test.short       = 1
test.short.array = 2
test.short.array = 3
commons-configuration/conf/testClasspath.properties0100664000076400007640000000144610000764226023402 0ustar  craigmcccraigmccconfiguration.loaded = true

packages = packagea

include = include.properties

#
# Other test properties
#

test.equals = value=one

test.empty=

#
# Test a property that uses a previous property
#
base=base
base.reference=${base}extra

#
# Non String Properties
#

test.boolean       = true
test.boolean.array = false
test.boolean.array = true

test.byte       = 10
test.byte.array = 20
test.byte.array = 30

test.double       = 10.25
test.double.array = 20.35
test.double.array = 30.45

test.float       = 20.25
test.float.array = 30.35
test.float.array = 40.45

test.integer       = 10
test.integer.array = 20
test.integer.array = 30

test.long       = 1000000
test.long.array = 2000000
test.long.array = 3000000

test.short       = 1
test.short.array = 2
test.short.array = 3

test.overwrite       = 1commons-configuration/conf/testConfigurationXMLDocument.xml0100664000076400007640000000072410000764226024751 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- Configuration test file that demonstrates usage of ConfigurationXMLDocument -->

<configuration>
  <additional>
    <hierarchicalDom4j fileName="testHierarchicalDOM4JConfiguration.xml" at="database"/>
    <hierarchicalDom4j fileName="testDigesterConfigurationInclude1.xml" at="database.tables"/>
    <hierarchicalDom4j fileName="testDigesterCreateObject.xml" at="database"/>
  </additional>
</configuration>

  
  



commons-configuration/conf/testDigesterConfiguration.xml0100664000076400007640000000046210000764226024357 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>

<configuration>
  <properties className="org.apache.commons.configuration.PropertiesConfiguration" fileName="conf/test.properties"/>
  <dom4j className="org.apache.commons.configuration.DOM4JConfiguration" fileName="conf/test.xml"/>
</configuration>

  
  



commons-configuration/conf/testDigesterConfiguration2.xml0100664000076400007640000000106110000764226024435 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- Configuration test file that demonstrates the
     override and additional sections -->

<configuration>
  <additional>
    <hierarchicalDom4j fileName="testHierarchicalDOM4JConfiguration.xml"/>
    <hierarchicalDom4j fileName="testDigesterConfigurationInclude1.xml" at="tables"/>
    <properties fileName="testDigesterConfigurationInclude2.properties" at="mail"/>
  </additional>

  <override>
    <properties fileName="testDigesterConfigurationOverwrite.properties"/>
  </override>
</configuration>

  
  



commons-configuration/conf/testDigesterConfigurationBasePath.xml0100664000076400007640000000031110000764226025760 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>

<configuration>
  <properties className="org.apache.commons.configuration.PropertiesConfiguration" fileName="test.properties"/>
</configuration>

  
  



commons-configuration/conf/testDigesterConfigurationInclude1.xml0100664000076400007640000000144110000764226025742 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>

<config>
  <table tableType="application">
    <name>tasks</name>
    <fields>
      <field>
        <name>taskid</name>
        <type>long</type>
      </field>
      <field>
        <name>name</name>
        <type>java.lang.String</type>
      </field>
      <field>
        <name>description</name>
        <type>java.lang.String</type>
      </field>
      <field>
        <name>responsibleID</name>
        <type>long</type>
      </field>
      <field>
        <name>creatorID</name>
        <type>long</type>
      </field>
      <field>
        <name>startDate</name>
        <type>java.util.Date</type>
      </field>
      <field>
        <name>endDate</name>
        <type>java.util.Date</type>
      </field>
    </fields>
  </table>
</config>commons-configuration/conf/testDigesterConfigurationInclude2.properties0100664000076400007640000000024610000764226027341 0ustar  craigmcccraigmcc# Properties for Email configuration

host.smtp = smtp.mydomain.org
host.pop = pop3.mydomain.org
account.user = postmaster
account.psswd = secret
account.type = pop3
commons-configuration/conf/testDigesterConfigurationNamespaceAware.xml0100664000076400007640000000060010000764226027146 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>



<configuration xmlns:foo="namespace-one"
               xmlns:bar="namespace-two">
  <foo:properties className="org.apache.commons.configuration.PropertiesConfiguration" fileName="conf/test.properties"/>
  <bar:dom4j className="org.apache.commons.configuration.DOM4JConfiguration" fileName="conf/test.xml"/>
</configuration>


  
  



commons-configuration/conf/testDigesterConfigurationOverwrite.properties0100664000076400007640000000021510000764226027656 0ustar  craigmcccraigmcc# Properties for Email configuration

mail.account.user = masterOfPost
mail.account.psswd = topsecret

test.configuration = enhanced factory
commons-configuration/conf/testDigesterConfigurationReverseOrder.xml0100664000076400007640000000046510000764226026712 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>

<configuration>
  <dom4j className="org.apache.commons.configuration.DOM4JConfiguration" fileName="conf/test.xml"/>
  <properties className="org.apache.commons.configuration.PropertiesConfiguration" fileName="conf/test.properties"/>
  
</configuration>

  
  



commons-configuration/conf/testDigesterConfigurationWJNDI.xml0100664000076400007640000000063010000764226025150 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>

<configuration>
  <jndi className="org.apache.commons.configuration.JNDIConfiguration" prefix="java:comp/env"/>
  <properties className="org.apache.commons.configuration.PropertiesConfiguration" fileName="conf/test.properties"/>
  <dom4j className="org.apache.commons.configuration.DOM4JConfiguration" fileName="conf/test.xml"/>
  
  
</configuration>

  
  



commons-configuration/conf/testDigesterCreateObject.xml0100664000076400007640000000051210000764226024076 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<connection>
		<class name="org.apache.commons.configuration.TestConfigurationXMLDocument$ConnectionData">
			<property name="dsn" value="MyData"/>
			<property name="user" value="scott"/>
			<property name="passwd" value="tiger"/>
		</class>
	</connection>
</configuration>commons-configuration/conf/testEqual.properties0100664000076400007640000000021610000764226022521 0ustar  craigmcccraigmccproperty.a = a
property.b = b
property.c = 100

#
# Value set twice
property.a = aa

clear.property = delete me

existing.property = i exist

commons-configuration/conf/testEqualDigester.xml0100664000076400007640000000032310000764226022613 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>

<configuration>
  <properties className="org.apache.commons.configuration.PropertiesConfiguration" fileName="conf/testEqual.properties"/>
</configuration>

  
  



commons-configuration/conf/testHierarchicalDOM4JConfiguration.xml0100664000076400007640000000206410000764226025725 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>

<database>
  <tables>
    <table tableType="system">
      <name>users</name>
      <fields>
        <field>
	  <name>uid</name>
	  <type>long</type>
	</field>
        <field>
	  <name>uname</name>
	  <type>java.lang.String</type>
	</field>
        <field>
	  <name>firstName</name>
	  <type>java.lang.String</type>
	</field>
        <field>
	  <name>lastName</name>
	  <type>java.lang.String</type>
	</field>
        <field>
	  <name>email</name>
	  <type>java.lang.String</type>
	</field>
      </fields>
    </table>
    <table tableType="application">
      <name>documents</name>
      <fields>
        <field>
	  <name>docid</name>
	  <type>long</type>
	</field>
        <field>
	  <name>name</name>
	  <type>java.lang.String</type>
	</field>
        <field>
	  <name>creationDate</name>
	  <type>java.util.Date</type>
	</field>
        <field>
	  <name>authorID</name>
	  <type>long</type>
	</field>
        <field>
	  <name>version</name>
	  <type>int</type>
	</field>
      </fields>
    </table>
  </tables>
</database>
commons-configuration/conf/testSequence.properties0100664000076400007640000000036310000764226023225 0ustar  craigmcccraigmccprefix.Fa.postfix=value.Fa
prefix.Po.postfix=value.Po
prefix.Ru.postfix=value.Ru
prefix.Se.postfix=value.Se
prefix.As.postfix=value.As
prefix.Gl.postfix=value.Gl
prefix.Pu.postfix=value.Pu
prefix.Te.postfix=value.Te
prefix.Ve.postfix=value.Ve
commons-configuration/conf/testSequenceDigester.xml0100664000076400007640000000032610000764226023317 0ustar  craigmcccraigmcc<?xml version="1.0" encoding="ISO-8859-1" ?>

<configuration>
  <properties className="org.apache.commons.configuration.PropertiesConfiguration" fileName="conf/testSequence.properties"/>
</configuration>

  
  



commons-configuration/src/0040775000076400007640000000000010000764227016303 5ustar  craigmcccraigmcccommons-configuration/src/java/0040775000076400007640000000000010000764227017224 5ustar  craigmcccraigmcccommons-configuration/src/java/org/0040775000076400007640000000000010000764227020013 5ustar  craigmcccraigmcccommons-configuration/src/java/org/apache/0040775000076400007640000000000010000764227021234 5ustar  craigmcccraigmcccommons-configuration/src/java/org/apache/commons/0040775000076400007640000000000010000764227022707 5ustar  craigmcccraigmcccommons-configuration/src/java/org/apache/commons/configuration/0040775000076400007640000000000010000764227025556 5ustar  craigmcccraigmcccommons-configuration/src/java/org/apache/commons/configuration/AbstractConfiguration.java0100664000076400007640000013335610000764227032724 0ustar  craigmcccraigmccpackage org.apache.commons.configuration;

/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowledgement:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgement may appear in the software itself,
 *    if and wherever such third-party acknowledgements normally appear.
 *
 * 4. The names "The Jakarta Project", "Commons", and "Apache Software
 *    Foundation" must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache"
 *    nor may "Apache" appear in their names without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Properties;
import java.util.StringTokenizer;

/**
 * Abstract configuration class. Provide basic functionality but does not
 * store any data. If you want to write your own Configuration class
 * then you should implement only abstract methods from this class.
 *
 * @author <a href="mailto:ksh@scand.com">Konstantin Shaposhnikov</a>
 * @author <a href="mailto:oliver.heger@t-online.de">Oliver Heger</a>
 * @version $Id: AbstractConfiguration.java,v 1.2 2003/12/24 14:28:22 epugh Exp $
 */
public abstract class AbstractConfiguration implements Configuration
{
    /** how big the initial arraylist for splitting up name value pairs */
    private static final int INITIAL_LIST_SIZE = 2;

    /**
     * stores the configuration key-value pairs
     */
    protected Configuration defaults = null;

    /** start token */
    protected static final String START_TOKEN = "${";
    /** end token */
    protected static final String END_TOKEN = "}";

    /**
     * Empty constructor.
     */
    public AbstractConfiguration()
    {
    }

    /**
     * Creates an empty AbstractConfiguration object with
     * a Super-Object which is queries for every key.
     *
     * @param defaults Configuration defaults to use if key not in file
     */
    public AbstractConfiguration(Configuration defaults)
    {
        this();
        this.defaults = defaults;
    }

    /**
     * Add a property to the configuration. If it already exists then the value
     * stated here will be added to the configuration entry. For example, if
     *
     * resource.loader = file
     *
     * is already present in the configuration and you
     *
     * addProperty("resource.loader", "classpath")
     *
     * Then you will end up with a List like the following:
     *
     * ["file", "classpath"]
     *
     * @param key The Key to add the property to.
     * @param token The Value to add.
     */
    public void addProperty(String key, Object token)
    {
        if (token instanceof String)
        {
            for(Iterator it = processString((String) token).iterator();
            it.hasNext();)
            {
                addPropertyDirect(key, it.next());
            }
        }
        else if (token instanceof Collection)
        {
            for (Iterator it = ((Collection) token).iterator(); it.hasNext();)
            {
                addProperty(key, it.next());
            }
        }
        else
        {
            addPropertyDirect(key, token);
        }
    }

    /**
     * Read property. Should return <code>null</code> if the key doesn't
     * map to an existing object.
     *
     * @param key key to use for mapping
     *
     * @return object associated with the given configuration key.
     */
    protected abstract Object getPropertyDirect(String key);

    /**
     * Adds a key/value pair to the Configuration. Override this method to
     * provide write acces to underlying Configuration store.
     *
     * @param key key to use for mapping
     * @param obj object to store
     */
    protected abstract void addPropertyDirect(String key, Object obj);

    /**
     * interpolate key names to handle ${key} stuff
     *
     * @param base string to interpolate
     *
     * @return returns the key name with the ${key} substituted
     */
    protected String interpolate(String base)
    {
        return (interpolateHelper(base, null));
    }

    /**
     * Recursive handler for multple levels of interpolation.
     *
     * When called the first time, priorVariables should be null.
     *
     * @param base string with the ${key} variables
     * @param priorVariables serves two purposes: to allow checking for
     * loops, and creating a meaningful exception message should a loop
     * occur.  It's 0'th element will be set to the value of base from
     * the first call.  All subsequent interpolated variables are added
     * afterward.
     *
     * @return the string with the interpolation taken care of
     */
    protected String interpolateHelper(String base, List priorVariables)
    {
        if (base == null)
        {
            return null;
        }

        // on the first call initialize priorVariables
        // and add base as the first element
        if (priorVariables == null)
        {
            priorVariables = new ArrayList();
            priorVariables.add(base);
        }

        int begin = -1;
        int end = -1;
        int prec = 0 - END_TOKEN.length();
        String variable = null;
        StringBuffer result = new StringBuffer();

        // FIXME: we should probably allow the escaping of the start token
        while (((begin = base.indexOf(START_TOKEN, prec + END_TOKEN.length()))
            > -1)
            && ((end = base.indexOf(END_TOKEN, begin)) > -1))
        {
            result.append(base.substring(prec + END_TOKEN.length(), begin));
            variable = base.substring(begin + START_TOKEN.length(), end);

            // if we've got a loop, create a useful exception message and throw
            if (priorVariables.contains(variable))
            {
                String initialBase = priorVariables.remove(0).toString();
                priorVariables.add(variable);
                StringBuffer priorVariableSb = new StringBuffer();

                // create a nice trace of interpolated variables like so:
                // var1->var2->var3
                for (Iterator it = priorVariables.iterator(); it.hasNext();)
                {
                    priorVariableSb.append(it.next());
                    if (it.hasNext())
                    {
                        priorVariableSb.append("->");
                    }
                }

                throw new IllegalStateException(
                    "infinite loop in property interpolation of "
                        + initialBase
                        + ": "
                        + priorVariableSb.toString());
            }
            // otherwise, add this variable to the interpolation list.
            else
            {
                priorVariables.add(variable);
            }

            //QUESTION: getProperty or getPropertyDirect
            Object value = getProperty(variable);
            if (value != null)
            {
                result.append(interpolateHelper(value.toString(),
                    priorVariables));

                // pop the interpolated variable off the stack
                // this maintains priorVariables correctness for
                // properties with multiple interpolations, e.g.
                // prop.name=${some.other.prop1}/blahblah/${some.other.prop2}
                priorVariables.remove(priorVariables.size() - 1);
            }
            else if (defaults != null && defaults.getString(variable,
                null) != null)
            {
                result.append(defaults.getString(variable));
            }
            else
            {
                //variable not defined - so put it back in the value
                result.append(START_TOKEN).append(variable).append(END_TOKEN);
            }
            prec = end;
        }
        result.append(base.substring(prec + END_TOKEN.length(), base.length()));

        return result.toString();
    }

    /**
     * Returns a List of Strings built from the supplied
     * String. Splits up CSV lists. If no commas are in the
     * String, simply returns a List with the String as its
     * first element
     *
     * @param token The String to tokenize
     *
     * @return A List of Strings
     */
    protected List processString(String token)
    {
        List retList = new ArrayList(INITIAL_LIST_SIZE);

        if (token.indexOf(PropertiesTokenizer.DELIMITER) > 0)
        {
            PropertiesTokenizer tokenizer =
                new PropertiesTokenizer((String) token);

            while (tokenizer.hasMoreTokens())
            {
                String value = tokenizer.nextToken();
                retList.add(value);
            }
        }
        else
        {
            retList.add(token);
        }

        //
        // We keep the sequence of the keys here and
        // we also keep it in the Container. So the
        // Keys are added to the store in the sequence that
        // is given in the properties
        return retList;
    }


    /**
     * Test whether the string represent by value maps to a boolean
     * value or not. We will allow <code>true</code>, <code>on</code>,
     * and <code>yes</code> for a <code>true</code> boolean value, and
     * <code>false</code>, <code>off</code>, and <code>no</code> for
     * <code>false</code> boolean values. Case of value to test for
     * boolean status is ignored.
     *
     * @param value The value to test for boolean state.
     * @return <code>true</code> or <code>false</code> if the supplied
     * text maps to a boolean value, or <code>null</code> otherwise.
     */
    protected final Boolean testBoolean(String value)
    {
        String s = value.toLowerCase();

        if (s.equals("true") || s.equals("on") || s.equals("yes"))
        {
            return Boolean.TRUE;
        }
        else if (s.equals("false") || s.equals("off") || s.equals("no"))
        {
            return Boolean.FALSE;
        }
        else
        {
            return null;
        }
    }

    /**
     * Create an BaseConfiguration object that is a subset
     * of this one.
     *
     * @param prefix prefix string for keys
     *
     * @return subset of configuration if there is keys, that match
     * given prefix, or <code>null</code> if there is no such keys.
     */
    public Configuration subset(String prefix)
    {
        BaseConfiguration c = new BaseConfiguration();
        Iterator keys = this.getKeys();
        boolean validSubset = false;

        while (keys.hasNext())
        {
            Object key = keys.next();

            if (key instanceof String && ((String) key).startsWith(prefix))
            {
                if (!validSubset)
                {
                    validSubset = true;
                }

                String newKey = null;

                /*
                 * Check to make sure that c.subset(prefix) doesn't blow up when
                 * there is only a single property with the key prefix. This is
                 * not a useful subset but it is a valid subset.
                 */
                if (((String) key).length() == prefix.length())
                {
                    newKey = prefix;
                }
                else
                {
                    newKey = ((String) key).substring(prefix.length() + 1);
                }

                /*
                 * use addPropertyDirect() - this will plug the data as is into
                 * the Map, but will also do the right thing re key accounting
                 *
                 * QUESTION: getProperty or getPropertyDirect
                 */
                Object value = getProperty((String) key);
                if (value instanceof String)
                {
                    c.addPropertyDirect(newKey, interpolate((String) value));
                }
                else
                {
                    c.addProperty(newKey, value);
                }
            }
        }

        if (validSubset)
        {
            return c;
        }
        else
        {
            return null;
        }
    }

    /**
     * Check if the configuration is empty
     *
     * @return <code>true</code> if Configuration is empty,
     * <code>false</code> otherwise.
     */
    public abstract boolean isEmpty();

    /**
     * check if the configuration contains the key
     *
     * @param key the configuration key
     *
     * @return <code>true</code> if Configuration contain given key,
     * <code>false</code> otherwise.
     */
    public abstract boolean containsKey(String key);

    /**
     * Set a property, this will replace any previously
     * set values. Set values is implicitly a call
     * to clearProperty(key), addProperty(key,value).
     *
     * @param key the configuration key
     * @param value the property value
     */
    public void setProperty(String key, Object value)
    {
        clearProperty(key);
        addProperty(key, value); // QUESTION: or addPropertyDirect?
    }

    /**
     * Clear a property in the configuration.
     *
     * @param key the key to remove along with corresponding value.
     */
    public  abstract void clearProperty(String key);

    /**
     * Get the list of the keys contained in the configuration
     * repository.
     *
     * @return An Iterator.
     */
    public abstract Iterator getKeys();

    /**
     * Get the list of the keys contained in the configuration
     * repository that match the specified prefix.
     *
     * @param prefix The prefix to test against.
     *
     * @return An Iterator of keys that match the prefix.
     */
    public Iterator getKeys(String prefix)
    {
        Iterator keys = getKeys();
        ArrayList matchingKeys = new ArrayList();

        while (keys.hasNext())
        {
            Object key = keys.next();

            if (key instanceof String && ((String) key).startsWith(prefix))
            {
                matchingKeys.add(key);
            }
        }
        return matchingKeys.iterator();
    }

    /**
     * Get a list of properties associated with the given
     * configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated properties if key is found.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a String/List.
     * @throws IllegalArgumentException if one of the tokens is
     * malformed (does not contain an equals sign).
     *
     * @see #getProperties(String, Properties)
     */
    public Properties getProperties(String key)
    {
        return getProperties(key, null);
    }

    /**
     * Get a list of properties associated with the given
     * configuration key.
     *
     * @param key The configuration key.
     * @param defaults Any default values for the returned
     * <code>Properties</code> object.  Ignored if <code>null</code>.
     *
     * @return The associated properties if key is found.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a String/List of Strings.
     * @throws IllegalArgumentException if one of the tokens is
     * malformed (does not contain an equals sign).
     */
    public Properties getProperties(String key, Properties defaults)
    {
        /*
         * Grab an array of the tokens for this key.
         */
        String[] tokens = getStringArray(key);

        /*
         * Each token is of the form 'key=value'.
         */
        Properties props =
            (defaults == null ? new Properties() : new Properties(defaults));
        for (int i = 0; i < tokens.length; i++)
        {
            String token = tokens[i];
            int equalSign = token.indexOf('=');
            if (equalSign > 0)
            {
                String pkey = token.substring(0, equalSign).trim();
                String pvalue = token.substring(equalSign + 1).trim();
                props.put(pkey, pvalue);
            }
            else if (tokens.length == 1 && "".equals(token))
            {
                // Semantically equivalent to an empty Properties
                // object.
                break;
            }
            else
            {
                throw new IllegalArgumentException(
                    '\'' + token + "' does not contain an equals sign");
            }
        }
        return props;
    }

    /**
     *  Gets a property from the configuration.
     *
     *  @param key property to retrieve
     *  @return value as object. Will return user value if exists,
     *          if not then default value if exists, otherwise null
     */
    public Object getProperty(String key)
    {
        // first, try to get from the 'user value' store
        Object o = getPropertyDirect(key);

        if (o == null)
        {
            // if there isn't a value there, get it from the defaults if we have
            // them
            if (defaults != null)
            {
                o = defaults.getProperty(key);
            }
        }

        //
        // We must never give a Container Object out. So if the
        // Return Value is a Container, we fix it up to be a
        // List
        //
        if (o instanceof Container)
        {
            o = ((Container) o).asList();
        }
        return o;
   }

    /**
     * Get a boolean associated with the given configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated boolean.
     *
     * @throws NoSuchElementException is thrown if the key doesn't
     * map to an existing object.
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Boolean.
     */
    public boolean getBoolean(String key)
    {
        Boolean b = getBoolean(key, (Boolean) null);
        if (b != null)
        {
            return b.booleanValue();
        }
        else
        {
            throw new NoSuchElementException(
                '\'' + key + "' doesn't map to an existing object");
        }
    }

    /**
     * Get a boolean associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated boolean.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Boolean.
     */
    public boolean getBoolean(String key, boolean defaultValue)
    {
        return getBoolean(key, new Boolean(defaultValue)).booleanValue();
    }

    /**
     * Get a boolean associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated boolean if key is found and has valid
     * format, default value otherwise.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Boolean.
     */
    public Boolean getBoolean(String key, Boolean defaultValue)
    {
        Object value = resolveContainerStore(key);

        if (value instanceof Boolean)
        {
            return (Boolean) value;
        }
        else if (value instanceof String)
        {
            return testBoolean((String) value);
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                return defaults.getBoolean(key, defaultValue);
            }
            else
            {
                return defaultValue;
            }
        }
        else
        {
            throw new ClassCastException(
                '\'' + key + "' doesn't map to a Boolean object");
        }
    }

    /**
     * Get a byte associated with the given configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated byte.
     *
     * @throws NoSuchElementException is thrown if the key doesn't
     * map to an existing object.
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Byte.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public byte getByte(String key)
    {
        Byte b = getByte(key, null);
        if (b != null)
        {
            return b.byteValue();
        }
        else
        {
            throw new NoSuchElementException(
                '\'' + key + " doesn't map to an existing object");
        }
    }

    /**
     * Get a byte associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated byte.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Byte.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public byte getByte(String key, byte defaultValue)
    {
        return getByte(key, new Byte(defaultValue)).byteValue();
    }

    /**
     * Get a byte associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated byte if key is found and has valid format, default
     *         value otherwise.
     *
     * @throws ClassCastException is thrown if the key maps to an object that
     *            is not a Byte.
     * @throws NumberFormatException is thrown if the value mapped by the key
     *            has not a valid number format.
     */
    public Byte getByte(String key, Byte defaultValue)
    {
        Object value = resolveContainerStore(key);

        if (value instanceof Byte)
        {
            return (Byte) value;
        }
        else if (value instanceof String)
        {
            Byte b = new Byte((String) value);
            return b;
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                return defaults.getByte(key, defaultValue);
            }
            else
            {
                return defaultValue;
            }
        }
        else
        {
            throw new ClassCastException(
                '\'' + key + "' doesn't map to a Byte object");
        }
    }

    /**
     * Get a double associated with the given configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated double.
     *
     * @throws NoSuchElementException is thrown if the key doesn't
     * map to an existing object.
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Double.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public double getDouble(String key)
    {
        Double d = getDouble(key, null);
        if (d != null)
        {
            return d.doubleValue();
        }
        else
        {
            throw new NoSuchElementException(
                '\'' + key + "' doesn't map to an existing object");
        }
    }

    /**
     * Get a double associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated double.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Double.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public double getDouble(String key, double defaultValue)
    {
        return getDouble(key, new Double(defaultValue)).doubleValue();
    }

    /**
     * Get a double associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated double if key is found and has valid
     * format, default value otherwise.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Double.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public Double getDouble(String key, Double defaultValue)
    {
        Object value = resolveContainerStore(key);

        if (value instanceof Double)
        {
            return (Double) value;
        }
        else if (value instanceof String)
        {
            Double d = new Double((String) value);
            return d;
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                return defaults.getDouble(key, defaultValue);
            }
            else
            {
                return defaultValue;
            }
        }
        else
        {
            throw new ClassCastException(
                '\'' + key + "' doesn't map to a Double object");
        }
    }

    /**
     * Get a float associated with the given configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated float.
     *
     * @throws NoSuchElementException is thrown if the key doesn't
     * map to an existing object.
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Float.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public float getFloat(String key)
    {
        Float f = getFloat(key, null);
        if (f != null)
        {
            return f.floatValue();
        }
        else
        {
            throw new NoSuchElementException(
                '\'' + key + "' doesn't map to an existing object");
        }
    }

    /**
     * Get a float associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated float.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Float.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public float getFloat(String key, float defaultValue)
    {
        return getFloat(key, new Float(defaultValue)).floatValue();
    }

    /**
     * Get a float associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated float if key is found and has valid
     * format, default value otherwise.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Float.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public Float getFloat(String key, Float defaultValue)
    {
        Object value = resolveContainerStore(key);

        if (value instanceof Float)
        {
            return (Float) value;
        }
        else if (value instanceof String)
        {
            Float f = new Float((String) value);
            return f;
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                return defaults.getFloat(key, defaultValue);
            }
            else
            {
                return defaultValue;
            }
        }
        else
        {
            throw new ClassCastException(
                '\'' + key + "' doesn't map to a Float object");
        }
    }

    /**
     * Get a int associated with the given configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated int.
     *
     * @throws NoSuchElementException is thrown if the key doesn't
     * map to an existing object.
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Integer.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public int getInt(String key)
    {
        Integer i = getInteger(key, null);
        if (i != null)
        {
            return i.intValue();
        }
        else
        {
            throw new NoSuchElementException(
                '\'' + key + "' doesn't map to an existing object");
        }
    }

    /**
     * Get a int associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated int.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Integer.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public int getInt(String key, int defaultValue)
    {
        Integer i = getInteger(key, null);

        if (i == null)
        {
            return defaultValue;
        }

        return i.intValue();
    }

    /**
     * Get a int associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated int if key is found and has valid format, default
     *         value otherwise.
     *
     * @throws ClassCastException is thrown if the key maps to an object that
     *         is not a Integer.
     * @throws NumberFormatException is thrown if the value mapped by the key
     *         has not a valid number format.
     */
    public Integer getInteger(String key, Integer defaultValue)
    {
        Object value = resolveContainerStore(key);

        if (value instanceof Integer)
        {
            return (Integer) value;
        }
        else if (value instanceof String)
        {
            Integer i = new Integer((String) value);
            return i;
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                return defaults.getInteger(key, defaultValue);
            }
            else
            {
                return defaultValue;
            }
        }
        else
        {
            throw new ClassCastException(
                '\'' + key + "' doesn't map to a Integer object");
        }
    }

    /**
     * Get a long associated with the given configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated long.
     *
     * @throws NoSuchElementException is thrown if the key doesn't
     * map to an existing object.
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Long.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public long getLong(String key)
    {
        Long l = getLong(key, null);
        if (l != null)
        {
            return l.longValue();
        }
        else
        {
            throw new NoSuchElementException(
                '\'' + key + "' doesn't map to an existing object");
        }
    }

    /**
     * Get a long associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated long.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Long.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public long getLong(String key, long defaultValue)
    {
        return getLong(key, new Long(defaultValue)).longValue();
    }

    /**
     * Get a long associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated long if key is found and has valid
     * format, default value otherwise.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Long.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public Long getLong(String key, Long defaultValue)
    {
        Object value = resolveContainerStore(key);

        if (value instanceof Long)
        {
            return (Long) value;
        }
        else if (value instanceof String)
        {
            Long l = new Long((String) value);
            return l;
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                return defaults.getLong(key, defaultValue);
            }
            else
            {
                return defaultValue;
            }
        }
        else
        {
            throw new ClassCastException(
                '\'' + key + "' doesn't map to a Long object");
        }
    }

    /**
     * Get a short associated with the given configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated short.
     *
     * @throws NoSuchElementException is thrown if the key doesn't
     * map to an existing object.
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Short.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public short getShort(String key)
    {
        Short s = getShort(key, null);
        if (s != null)
        {
            return s.shortValue();
        }
        else
        {
            throw new NoSuchElementException(
                '\'' + key + "' doesn't map to an existing object");
        }
    }

    /**
     * Get a short associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated short.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Short.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public short getShort(String key, short defaultValue)
    {
        return getShort(key, new Short(defaultValue)).shortValue();
    }

    /**
     * Get a short associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated short if key is found and has valid
     * format, default value otherwise.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a Short.
     * @throws NumberFormatException is thrown if the value mapped
     * by the key has not a valid number format.
     */
    public Short getShort(String key, Short defaultValue)
    {
        Object value = resolveContainerStore(key);

        if (value instanceof Short)
        {
            return (Short) value;
        }
        else if (value instanceof String)
        {
            Short s = new Short((String) value);
            return s;
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                return defaults.getShort(key, defaultValue);
            }
            else
            {
                return defaultValue;
            }
        }
        else
        {
            throw new ClassCastException(
                '\'' + key + "' doesn't map to a Short object");
        }
    }

    /**
     * Get a string associated with the given configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated string.
     *
     * @throws ClassCastException is thrown if the key maps to an object that
     *            is not a String.
     * @throws NoSuchElementException is thrown if the key doesn't
     *         map to an existing object.
     */
    public String getString(String key)
    {
        String s = getString(key, null);
        if (s != null)
        {
            return s;
        }
        else
        {
            throw new NoSuchElementException(
                '\'' + key + "' doesn't map to an existing object");
        }
    }

    /**
     * Get a string associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated string if key is found, default value otherwise.
     *
     * @throws ClassCastException is thrown if the key maps to an object that
     *            is not a String.
     */
    public String getString(String key, String defaultValue)
    {
        Object value = resolveContainerStore(key);

        if (value instanceof String)
        {
            return (String) interpolate((String) value);
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                return interpolate(defaults.getString(key, defaultValue));
            }
            else
            {
                return interpolate(defaultValue);
            }
        }
        else
        {
            throw new ClassCastException(
                '\'' + key + "' doesn't map to a String object");
        }
    }

    /**
     * Get an array of strings associated with the given configuration
     * key.
     *
     * @param key The configuration key.
     *
     * @return The associated string array if key is found.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a String/List of Strings.
     */
    public String[] getStringArray(String key)
    {
        Object value = getPropertyDirect(key);

        String[] tokens;

        if (value instanceof String)
        {
            tokens = new String[1];

            tokens[0] = interpolate((String) value);
        }
        else if (value instanceof Container)
        {
            tokens = new String[((Container) value).size()];

            for (int i = 0; i < tokens.length; i++)
            {
                tokens[i] = interpolate((String) ((Container) value).get(i));
            }
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                tokens = defaults.getStringArray(key);
            }
            else
            {
                tokens = new String[0];
            }
        }
        else
        {
            throw new ClassCastException(
                '\'' + key + "' doesn't map to a String/List object");
        }
        return tokens;
    }

    /**
     * Get a List of strings associated with the given configuration key.
     *
     * @param key The configuration key.
     *
     * @return The associated List.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a List.
     * @throws NoSuchElementException is thrown if the key doesn't
     *         map to an existing object.
     */
    public List getList(String key)
    {
        List list = getList(key, null);
        if (list != null)
        {
            return list;
        }
        else
        {
            throw new NoSuchElementException(
                '\'' + key + "' doesn't map to an existing object");
        }
    }

    /**
     * Get a List of strings associated with the given configuration key.
     *
     * @param key The configuration key.
     * @param defaultValue The default value.
     *
     * @return The associated List.
     *
     * @throws ClassCastException is thrown if the key maps to an
     * object that is not a List.
     */
    public List getList(String key, List defaultValue)
    {
        Object value = getPropertyDirect(key);
        List list = null;

        if (value instanceof String)
        {
            list = new ArrayList(1);
            list.add(value);
        }
        else if (value instanceof Container)
        {
            list = ((Container) value).asList();
        }
        else if (value == null)
        {
            if (defaults != null)
            {
                list = defaults.getList(key, defaultValue);
            }
            else
            {
                list = ((defaultValue == null) ? new ArrayList() : defaultValue);
            }
        }
        else
        {
            throw new ClassCastException(
                '\''
                    + key
                    + "' doesn't map to a List object: "
                    + value
                    + ", a "
                    + value.getClass().getName());
        }
        return list;
    }

    /**
     * Returns an object from the store described by the key.
     * If the value is a Container object, replace it with the
     * first object in the container
     *
     * @param key The property key.
     *
     * @return value Value, transparently resolving a possible
     *               Container dependency.
     */
    private Object resolveContainerStore(String key)
    {
        Object value = getPropertyDirect(key);
        if (value != null && value instanceof Container)
        {
            value = ((Container) value).get(0);
        }
        return value;
    }

    /**
     * This class divides into tokens a property value.  Token
     * separator is "," but commas into the property value are escaped
     * using the backslash in front.
     */
    class PropertiesTokenizer extends StringTokenizer
    {
        /** The property delimiter used while parsing (a comma). */
        static final String DELIMITER = ",";

        /**
         * Constructor.
         *
         * @param string A String.
         */
        public PropertiesTokenizer(String string)
        {
            super(string, DELIMITER);
        }

        /**
         * Check whether the object has more tokens.
         *
         * @return True if the object has more tokens.
         */
        public boolean hasMoreTokens()
        {
            return super.hasMoreTokens();
        }

        /**
         * Get next token.
         *
         * @return A String.
         */
        public String nextToken()
        {
            StringBuffer buffer = new StringBuffer();

            while (hasMoreTokens())
            {
                String token = super.nextToken();
                if (token.endsWith("\\"))
                {
                    buffer.append(token.substring(0, token.length() - 1));
                    buffer.append(DELIMITER);
                }
                else
                {
                    buffer.append(token);
                    break;
                }
            }
            return buffer.toString().trim();
        }
    } // class PropertiesTokenizer

    /**
     * Private Wrapper class for List, so we can distinguish between
     * List objects and our container
     */
    static class Container
    {
        /** We're wrapping a List object (A List) */
        private List list = null;

        /**
         * C'tor
         */
        public Container()
        {
            list = new ArrayList(INITIAL_LIST_SIZE);
        }

        /**
         * Add an Object to the Container
         *
         * @param o The Object
         */
        public void add(Object o)
        {
            list.add(o);
        }

        /**
         * Returns the current size of the Container
         *
         * @return The Number of elements in the container
         */
        public int size()
        {
            return list.size();
        }

        /**
         * Returns the Element at an index
         *
         * @param index The Index
         * @return The element at that index
         */
        public Object get(int index)
        {
            return list.get(index);
        }

        /**
         * Returns an Iterator over the container objects
         *
         * @return An Iterator
         */
        public Iterator iterator()
        {
            return list.iterator();
        }

        /**
         * Returns the Elements of the Container as
         * a List. This is not the internal list
         * element but a shallow copy of the internal
         * list. You may modify the returned list without
         * modifying the container.
         *
         * @return A List containing the elements of the Container.
         */
        public List asList()
        {
            return new ArrayList(list);
        }
    }
}
commons-configuration/src/java/org/apache/commons/configuration/BaseConfiguration.java0100664000076400007640000001601710000764227032025 0ustar  craigmcccraigmccpackage org.apache.commons.configuration;

/* ====================================================================
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999-2003 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowledgement:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgement may appear in the software itself,
 *    if and wherever such third-party acknowledgements normally appear.
 *
 * 4. The names "The Jakarta Project", "Commons", and "Apache Software
 *    Foundation" must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache"
 *    nor may "Apache" appear in their names without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS