svn commit: r747720 - /commons/sandbox/dbutils/bugfixing/src/test/org/apache/commons/dbutils/BaseTestCase.java

2009-02-25 Thread bayard
Author: bayard
Date: Wed Feb 25 09:47:47 2009
New Revision: 747720

URL: http://svn.apache.org/viewvc?rev=747720view=rev
Log:
Hooking in the QueryRunnerTest that Dan just added; while wondering why suites 
are being used in this component

Modified:

commons/sandbox/dbutils/bugfixing/src/test/org/apache/commons/dbutils/BaseTestCase.java

Modified: 
commons/sandbox/dbutils/bugfixing/src/test/org/apache/commons/dbutils/BaseTestCase.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/dbutils/bugfixing/src/test/org/apache/commons/dbutils/BaseTestCase.java?rev=747720r1=747719r2=747720view=diff
==
--- 
commons/sandbox/dbutils/bugfixing/src/test/org/apache/commons/dbutils/BaseTestCase.java
 (original)
+++ 
commons/sandbox/dbutils/bugfixing/src/test/org/apache/commons/dbutils/BaseTestCase.java
 Wed Feb 25 09:47:47 2009
@@ -144,6 +144,7 @@
 suite.addTestSuite(ProxyFactoryTest.class);
 suite.addTestSuite(ResultSetIteratorTest.class);
 suite.addTestSuite(QueryLoaderTest.class);
+suite.addTestSuite(QueryRunnerTest.class);
 
 // test handler implementations
 suite.addTestSuite(ArrayHandlerTest.class);




svn commit: r747810 - in /commons/sandbox/compress/trunk/src: main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java test/java/org/apache/commons/compress/archivers/zip/UTF8Zi

2009-02-25 Thread bodewig
Author: bodewig
Date: Wed Feb 25 15:05:53 2009
New Revision: 747810

URL: http://svn.apache.org/viewvc?rev=747810view=rev
Log:
Use a less technical name for method

Modified:

commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java

commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java

Modified: 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java?rev=747810r1=747809r2=747810view=diff
==
--- 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
 Wed Feb 25 15:05:53 2009
@@ -345,11 +345,12 @@
 }
 
 /**
- * Whether to set the EFS flag if the file name encoding is UTF-8.
+ * Whether to set the language encoding flag if the file name
+ * encoding is UTF-8.
  *
  * pDefaults to true./p
  */
-public void setUseEFS(boolean b) {
+public void setUseLanguageEncodingFlag(boolean b) {
 useEFS = b  isUTF8(encoding);
 }
 

Modified: 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java?rev=747810r1=747809r2=747810view=diff
==
--- 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
 Wed Feb 25 15:05:53 2009
@@ -105,7 +105,7 @@
 try {
 zos = new ZipArchiveOutputStream(file);
 zos.setEncoding(encoding);
-zos.setUseEFS(withEFS);
+zos.setUseLanguageEncodingFlag(withEFS);
 
 ZipArchiveEntry ze = new ZipArchiveEntry(OIL_BARREL_TXT);
 if (!ZipEncodingHelper.canEncodeName(ze.getName(),




svn commit: r747841 - in /commons/sandbox/compress/trunk/src: main/java/org/apache/commons/compress/archivers/zip/ test/java/org/apache/commons/compress/archivers/zip/

2009-02-25 Thread bodewig
Author: bodewig
Date: Wed Feb 25 16:09:12 2009
New Revision: 747841

URL: http://svn.apache.org/viewvc?rev=747841view=rev
Log:
add an option to implicitly create Unicode Extra Fields in 
ZiparchiveOutputStream

Modified:

commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java

commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java

commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java

Modified: 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java?rev=747841r1=747840r2=747841view=diff
==
--- 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
 Wed Feb 25 16:09:12 2009
@@ -270,6 +270,11 @@
 private boolean useEFS = true; 
 
 /**
+ * whether to create UnicodePathExtraField-s for each entry.
+ */
+private boolean createUnicodeExtraFields = false;
+
+/**
  * Creates a new ZIP OutputStream filtering the underlying stream.
  * @param out the outputstream to zip
  * @since 1.1
@@ -355,6 +360,15 @@
 }
 
 /**
+ * Whether to create Unicode Extra Fields for all entries.
+ *
+ * pDefaults to false./p
+ */
+public void setCreateUnicodeExtraFields(boolean b) {
+createUnicodeExtraFields = b;
+}
+
+/**
  * Finishs writing the contents and closes this as well as the
  * underlying stream.
  *
@@ -450,6 +464,14 @@
 closeEntry();
 
 entry = ze;
+if (createUnicodeExtraFields) {
+ze.addExtraField(new UnicodePathExtraField(ze.getName(),
+   encoding));
+if (ze.getComment() != null) {
+ze.addExtraField(new UnicodeCommentExtraField(ze.getComment(),
+  encoding));
+}
+}
 entries.add(entry);
 
 if (entry.getMethod() == -1) { // not specified

Modified: 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java?rev=747841r1=747840r2=747841view=diff
==
--- 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java
 Wed Feb 25 16:09:12 2009
@@ -75,17 +75,23 @@
  * /pre
  * 
  * @param name The filename or comment with possible non-ASCII
- * unicode characters.
+ * unicode characters.  Must not be null.
  * @param encoding A valid encoding name. The standard zip
  * encoding is codeCP437/code,
  * codeUTF-8/code is supported in ZIP file
- * version code6.3/code or later.
+ * version code6.3/code or later.  If null,
+ * will use the platform's {...@link
+ * java.lang.String#getBytes default encoding}.
  * @return A byte array containing the mapped file
  * name. Unmappable characters or malformed character
  * sequences are mapped to a sequence of utf-16 words
  * encoded in the format code%U/code.
  */
 static final byte[] encodeName(String name, String encoding) {
+if (encoding == null) {
+return name.getBytes();
+}
+
 Charset cs = Charset.forName(encoding);
 CharsetEncoder enc = cs.newEncoder();
 

Modified: 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java?rev=747841r1=747840r2=747841view=diff
==
--- 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
 (original)
+++ 
commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/UTF8ZipFilesTest.java
 Wed Feb 25 16:09:12 2009
@@ -39,20 +39,44 @@
 private static final String 

svn commit: r748044 - /commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java

2009-02-25 Thread oheger
Author: oheger
Date: Thu Feb 26 07:05:33 2009
New Revision: 748044

URL: http://svn.apache.org/viewvc?rev=748044view=rev
Log:
New interface for hierarchical configuration sources.

Added:

commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java
   (with props)

Added: 
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java
URL: 
http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java?rev=748044view=auto
==
--- 
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java
 (added)
+++ 
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java
 Thu Feb 26 07:05:33 2009
@@ -0,0 +1,83 @@
+/*
+ * 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.base;
+
+import org.apache.commons.configuration2.expr.NodeHandler;
+import org.apache.commons.configuration2.expr.NodeList;
+
+/**
+ * p
+ * A specialized {...@code ConfigurationSource} that organizes its data in a
+ * hierarchical node structure.
+ * /p
+ * p
+ * This interface extends the {...@code ConfigurationSource} interface by some
+ * methods providing a hierarchical view on the data stored in this
+ * configuration source. There is one method returning the root node of the
+ * hierarchy. A {...@link NodeHandler} can also be queried for performing
+ * operations on the node structure. Concrete implementations can use different
+ * node classes; therefore the concrete type of the nodes is determined using a
+ * type parameter.
+ * /p
+ *
+ * @author Commons Configuration team
+ * @version $Id$
+ * @param T the type of the nodes used by this hierarchical configuration
+ *source
+ */
+public interface HierarchicalConfigurationSourceT extends ConfigurationSource
+{
+/**
+ * Returns the {...@code NodeHandler} for dealing with the nodes used by 
this
+ * {...@code HierarchicalConfigurationSource}.
+ *
+ * @return the {...@code NodeHandler} for the nodes used by this 
implementation
+ */
+NodeHandlerT getNodeHandler();
+
+/**
+ * Returns the root node of the hierarchy managed by this source.
+ *
+ * @return the root node
+ */
+T getRootNode();
+
+/**
+ * Sets the root node of the hierarchy managed by this source. Using this
+ * method the whole content of this source can be changed. This operation
+ * may not be supported by all implementations. An implementation that does
+ * not allow changing the root node may throw an {...@code
+ * UnsupportedOperationException} exception.
+ *
+ * @param root the new root node (must not be bnull/b)
+ * @throws UnsupportedOperationException if this operation is not allowed
+ * for this source
+ * @throws IllegalArgumentException if the root node is bnull/b
+ */
+void setRootNode(T root);
+
+/**
+ * Evaluates the specified expression and returns a {...@code NodeList} 
with
+ * the results. An implementation must use the current {...@code
+ * ExpressionEngine} to execute the query on the hierarchical node 
structure
+ * maintained by this source.
+ *
+ * @param expr the expression to be evaluated
+ * @return a {...@code NodeList} with the results
+ */
+NodeListT find(String expr);
+}

Propchange: 
commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/base/HierarchicalConfigurationSource.java
--
svn:eol-style = native

Propchange: