Author: ebourg
Date: Fri Feb 15 09:19:52 2008
New Revision: 628126
URL: http://svn.apache.org/viewvc?rev=628126&view=rev
Log:
Removed the dependency on commons-codec
XMLPropertyListConfiguration now use the internal base64 encoder of the
Preferences API
Added:
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java
(with props)
Modified:
commons/proper/configuration/branches/configuration2_experimental/build.xml
commons/proper/configuration/branches/configuration2_experimental/gump.xml
commons/proper/configuration/branches/configuration2_experimental/pom.xml
commons/proper/configuration/branches/configuration2_experimental/project.xml
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java
commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml
commons/proper/configuration/branches/configuration2_experimental/xdocs/dependencies.xml
Modified:
commons/proper/configuration/branches/configuration2_experimental/build.xml
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/build.xml?rev=628126&r1=628125&r2=628126&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/build.xml
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/build.xml
Fri Feb 15 09:19:52 2008
@@ -233,8 +233,6 @@
</get>
<get dest="${libdir}/commons-beanutils-core-1.7.0.jar" usetimestamp="true"
ignoreerrors="true"
src="http://www.ibiblio.org/maven/commons-beanutils/jars/commons-beanutils-core-1.7.0.jar">
</get>
- <get dest="${libdir}/commons-codec-1.3.jar" usetimestamp="true"
ignoreerrors="true"
src="http://www.ibiblio.org/maven/commons-codec/jars/commons-codec-1.3.jar">
- </get>
<get dest="${libdir}/commons-jxpath-1.2.jar" usetimestamp="true"
ignoreerrors="true"
src="http://www.ibiblio.org/maven/commons-jxpath/jars/commons-jxpath-1.2.jar">
</get>
<get dest="${libdir}/servletapi-2.4.jar" usetimestamp="true"
ignoreerrors="true"
src="http://www.ibiblio.org/maven/servletapi/jars/servletapi-2.4.jar">
Modified:
commons/proper/configuration/branches/configuration2_experimental/gump.xml
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/gump.xml?rev=628126&r1=628125&r2=628126&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/gump.xml
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/gump.xml
Fri Feb 15 09:19:52 2008
@@ -18,8 +18,6 @@
</depend>
<depend project="commons-lang">
</depend>
- <depend project="commons-codec">
- </depend>
<depend project="dom4j">
</depend>
<depend project="junit">
Modified:
commons/proper/configuration/branches/configuration2_experimental/pom.xml
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/pom.xml?rev=628126&r1=628125&r2=628126&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/pom.xml
(original)
+++ commons/proper/configuration/branches/configuration2_experimental/pom.xml
Fri Feb 15 09:19:52 2008
@@ -209,13 +209,6 @@
</dependency>
<dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <optional>true</optional>
- </dependency>
-
- <dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
<version>1.2</version>
Modified:
commons/proper/configuration/branches/configuration2_experimental/project.xml
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/project.xml?rev=628126&r1=628125&r2=628126&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/project.xml
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/project.xml
Fri Feb 15 09:19:52 2008
@@ -261,16 +261,6 @@
</dependency>
<dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <properties>
- <war.bundle>true</war.bundle>
- <optional>true</optional>
- </properties>
- </dependency>
-
- <dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
<version>1.2</version>
Added:
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java?rev=628126&view=auto
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java
(added)
+++
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java
Fri Feb 15 09:19:52 2008
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.commons.configuration2.plist;
+
+import java.util.prefs.AbstractPreferences;
+import java.util.prefs.BackingStoreException;
+
+/**
+ * A Base64 encoder/decoder that leverages the internal Base64 encoder of the
Preferences API.
+ *
+ * @author Emmanuel Bourg
+ * @version $Revision$, $Date$
+ * @since 2.0
+ */
+class Base64 extends AbstractPreferences
+{
+ private static final Base64 instance = new Base64();
+
+ /** The current value being converted. */
+ private String value;
+
+ private Base64()
+ {
+ super(null, "");
+ }
+
+ public static synchronized String encodeBase64(byte[] array)
+ {
+ instance.putByteArray(null, array);
+ return instance.get(null, null);
+ }
+
+ public static synchronized byte[] decodeBase64(String base64String)
+ {
+ instance.put(null, base64String);
+ return instance.getByteArray(null, null);
+ }
+
+ public String get(String key, String defaultValue)
+ {
+ return value;
+ }
+
+ /**
+ * Overrides the default implementation to avoid the constraint on the
length of the value.
+ */
+ public void put(String key, String value)
+ {
+ this.value = value;
+ }
+
+ protected void putSpi(String key, String value)
+ {
+ }
+
+ protected String getSpi(String key)
+ {
+ return null;
+ }
+
+ protected void removeSpi(String key)
+ {
+ }
+
+ protected void removeNodeSpi() throws BackingStoreException
+ {
+ }
+
+ protected String[] keysSpi() throws BackingStoreException
+ {
+ return new String[0];
+ }
+
+ protected String[] childrenNamesSpi() throws BackingStoreException
+ {
+ return new String[0];
+ }
+
+ protected AbstractPreferences childSpi(String name)
+ {
+ return null;
+ }
+
+ protected void syncSpi() throws BackingStoreException
+ {
+ }
+
+ protected void flushSpi() throws BackingStoreException
+ {
+ }
+}
Propchange:
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Base64.java
------------------------------------------------------------------------------
svn:keywords = Revision Id Date Author
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java?rev=628126&r1=628125&r2=628126&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/Hex.java
Fri Feb 15 09:19:52 2008
@@ -20,7 +20,7 @@
/**
* Hex encoder and decoder. This is a modified copy of the Hex class in
Commons Codec
*
- * @since 1.1
+ * @since 2.0
* @author Apache Software Foundation
* @version $Id$
*/
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java?rev=628126&r1=628125&r2=628126&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/PropertyListConfiguration.java
Fri Feb 15 09:19:52 2008
@@ -86,7 +86,10 @@
/** The default date format, its use must be synchronized */
private static final SimpleDateFormat DEFAULT_DATE_FORMAT = new
SimpleDateFormat("<*'D'yyyy-MM-dd HH:mm:ss Z>");
- /** Instance specific format that can be used to format date in differents
time zones */
+ /**
+ * Instance specific format that can be used to format a date in
differents time zones.
+ * Its use must be synchronized
+ */
final SimpleDateFormat DATE_FORMAT = new
SimpleDateFormat(DEFAULT_DATE_FORMAT.toPattern());
/** The serial version UID. */
Modified:
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java?rev=628126&r1=628125&r2=628126&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/plist/XMLPropertyListConfiguration.java
Fri Feb 15 09:19:52 2008
@@ -35,7 +35,6 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.apache.commons.codec.binary.Base64;
import org.apache.commons.configuration2.AbstractHierarchicalFileConfiguration;
import org.apache.commons.configuration2.Configuration;
import org.apache.commons.configuration2.ConfigurationException;
@@ -614,7 +613,7 @@
*/
public void addDataValue(String value)
{
- addValue(Base64.decodeBase64(value.getBytes()));
+ addValue(Base64.decodeBase64(value));
}
/**
Modified:
commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml?rev=628126&r1=628125&r2=628126&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml
Fri Feb 15 09:19:52 2008
@@ -42,7 +42,7 @@
(see
http://people.apache.org/~psmith/logging.apache.org/sandbox/jul-log4j-bridge/).
</action>
<action dev="ebourg" type="update">
- PropertyListConfiguration no longer requires commons-codec
+ The dependency to commons-codec is no longer needed.
</action>
<action dev="ebourg" type="update">
Calendar objects in PropertyListConfiguration are now saved with their
own time zone.
Modified:
commons/proper/configuration/branches/configuration2_experimental/xdocs/dependencies.xml
URL:
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/xdocs/dependencies.xml?rev=628126&r1=628125&r2=628126&view=diff
==============================================================================
---
commons/proper/configuration/branches/configuration2_experimental/xdocs/dependencies.xml
(original)
+++
commons/proper/configuration/branches/configuration2_experimental/xdocs/dependencies.xml
Fri Feb 15 09:19:52 2008
@@ -48,7 +48,7 @@
<td>Core</td>
<td>
Java 5<br/>
- commons-lang<br/>
+ commons-lang
</td>
</tr>
<tr>
@@ -63,10 +63,6 @@
<td>commons-beanutils</td>
</tr>
<tr>
- <td>XMLPropertyListConfiguration</td>
- <td>commons-codec</td>
- </tr>
- <tr>
<td>ConfigurationDynaBean</td>
<td>commons-beanutils</td>
</tr>
@@ -107,10 +103,6 @@
<tr>
<td>commons-beanutils</td>
<td>1.7.0</td>
- </tr>
- <tr>
- <td>commons-codec</td>
- <td>1.3</td>
</tr>
<tr>
<td>commons-jxpath</td>