commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r732328 [1/2] - in /commons/proper/vfs/trunk: ./ core/ core/src/main/java/org/apache/commons/vfs/impl/ core/src/main/java/org/apache/commons/vfs/provider/http/ core/src/main/java/org/apache/commons/vfs/provider/webdav/ core/src/test/java/co...
Date Wed, 07 Jan 2009 13:28:51 GMT
Author: rgoers
Date: Wed Jan  7 05:28:48 2009
New Revision: 732328

URL: http://svn.apache.org/viewvc?rev=732328&view=rev
Log:
Maven 2 build works (mostly). Add webdav support. Fix svn flags in the next checkin

Added:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/ExceptionConverter.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileContentInfoFactory.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileNameParser.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileProvider.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystem.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystemConfigBuilder.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavMethodRetryHandler.java
    commons/proper/vfs/trunk/core/src/test/java/code/
    commons/proper/vfs/trunk/core/src/test/java/code/ClassToLoad.java
    commons/proper/vfs/trunk/core/src/test/java/code/sealed/
    commons/proper/vfs/trunk/core/src/test/java/code/sealed/AnotherClass.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/webdav/
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/webdav/test/
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/webdav/test/WebdavProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/test-data/read-tests/
      - copied from r729829, commons/proper/vfs/trunk/core/src/test/test-data/basedir/
    commons/proper/vfs/trunk/core/src/test/test-data/write-tests/
    commons/proper/vfs/trunk/core/src/test/test-data/write-tests/dummy.txt
    commons/proper/vfs/trunk/xdocs/testing.xml   (contents, props changed)
      - copied, changed from r729829, commons/proper/vfs/trunk/xdocs/testserver.xml
Removed:
    commons/proper/vfs/trunk/core/src/test/test-data/basedir/
    commons/proper/vfs/trunk/core/src/test/test-data/code/
    commons/proper/vfs/trunk/sandbox/src/main/java/org/apache/commons/vfs/provider/webdav/
    commons/proper/vfs/trunk/sandbox/src/test/java/org/apache/commons/vfs/provider/webdav/test/
Modified:
    commons/proper/vfs/trunk/core/pom.xml
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/ThreadLocalHttpConnectionManager.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/impl/test/VfsClassLoaderTests.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/ftp/test/FtpProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/http/test/HttpProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/JarProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/NestedJarTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/sftp/test/SftpProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTarTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTbz2TestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTgzTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TarProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/Tbz2ProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TgzProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/url/test/UrlProviderHttpTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/NestedZipTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/ZipProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestCase.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractProviderTestConfig.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/AbstractTestSuite.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderReadTests.java
    commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/test/ProviderTestSuite.java
    commons/proper/vfs/trunk/examples/pom.xml
    commons/proper/vfs/trunk/pom.xml
    commons/proper/vfs/trunk/sandbox/pom.xml
    commons/proper/vfs/trunk/src/site/site.xml
    commons/proper/vfs/trunk/xdocs/api.xml
    commons/proper/vfs/trunk/xdocs/filesystems.xml
    commons/proper/vfs/trunk/xdocs/index.xml
    commons/proper/vfs/trunk/xdocs/navigation.xml

Modified: commons/proper/vfs/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/pom.xml?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/pom.xml (original)
+++ commons/proper/vfs/trunk/core/pom.xml Wed Jan  7 05:28:48 2009
@@ -32,7 +32,8 @@
 		<groupId>org.apache.commons</groupId>
 		<artifactId>commons-vfs-project</artifactId>
 		<version>2.0-SNAPSHOT</version>
-	</parent>
+        <relativePath>../</relativePath>
+    </parent>
 
 	<dependencies>
 		<dependency>
@@ -71,13 +72,25 @@
 			<version>1.0</version>
 			<optional>true</optional>
 		</dependency>
-		<dependency>
-			<groupId>commons-httpclient</groupId>
-			<artifactId>commons-httpclient</artifactId>
-			<version>2.0.2</version>
+      <dependency>
+        <groupId>commons-httpclient</groupId>
+        <artifactId>commons-httpclient</artifactId>
+        <version>3.0</version>
+        <!-- JCR-683: Exclude bad transitive dependencies -->
+        <exclusions>
+          <exclusion>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+        <dependency>
+			<groupId>org.apache.jackrabbit</groupId>
+			<artifactId>jackrabbit-webdav</artifactId>
+			<version>1.4</version>
 			<optional>true</optional>
 		</dependency>
-		<dependency>
+        <dependency>
 			<groupId>com.jcraft</groupId>
 			<artifactId>jsch</artifactId>
 			<version>0.1.31</version>
@@ -145,11 +158,13 @@
             <testResource>
                 <directory>src/test/test-data</directory>
                 <targetPath>test-data</targetPath>
+                <excludes>
+                    <exclude>code/**/*.java</exclude>
+                </excludes>
             </testResource>
         </testResources>
 
 		<plugins>
-
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-jar-plugin</artifactId>
@@ -161,8 +176,28 @@
 					</execution>
 				</executions>
 			</plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>process-test-classes</phase>
+                        <configuration>
+                            <tasks>
+                                <move todir="${project.build.testOutputDirectory}/test-data/code">
+                                    <fileset dir="${project.build.testOutputDirectory}/code"/>
+                                </move>
 
-			<!--<plugin>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                             <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!--<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-antrun-plugin</artifactId>
 				<executions>
@@ -197,10 +232,146 @@
 							<name>test.basedir.res</name>
 							<value>test-data</value>
 						</property>
-					</systemProperties>
+                    </systemProperties>
 				</configuration>
-			</plugin>
+            </plugin>
 
 		</plugins>
 	</build>
+    <profiles>
+        <profile>
+            <id>webdav</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-api</artifactId>
+                    <version>1.5.6</version>
+                    <scope>test</scope>
+                </dependency>
+                <dependency>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                    <version>1.5.6</version>
+                    <scope>test</scope>
+                </dependency>                
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+			        	<groupId>org.apache.maven.plugins</groupId>
+				        <artifactId>maven-surefire-plugin</artifactId>
+				        <configuration>
+					        <systemProperties>
+				        		<property>
+						        	<name>test.basedir</name>
+							        <value>target/test-classes/test-data</value>
+					        	</property>
+					        	<property>
+							        <name>test.basedir.res</name>
+							        <value>test-data</value>
+						        </property>
+                                <property>
+                                    <name>test.webdav.uri</name>
+                                    <value>${test.webdav.uri}</value>
+                                </property>
+                             </systemProperties>
+				        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>ftp</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+			        	<groupId>org.apache.maven.plugins</groupId>
+				        <artifactId>maven-surefire-plugin</artifactId>
+				        <configuration>
+					        <systemProperties>
+				        		<property>
+						        	<name>test.basedir</name>
+							        <value>target/test-classes/test-data</value>
+					        	</property>
+					        	<property>
+							        <name>test.basedir.res</name>
+							        <value>test-data</value>
+						        </property>
+                                <property>
+                                    <name>test.ftp.uri</name>
+                                    <value>${test.ftp.uri}</value>
+                                </property>
+                             </systemProperties>
+				        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>sftp</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+			        	<groupId>org.apache.maven.plugins</groupId>
+				        <artifactId>maven-surefire-plugin</artifactId>
+				        <configuration>
+					        <systemProperties>
+				        		<property>
+						        	<name>test.basedir</name>
+							        <value>target/test-classes/test-data</value>
+					        	</property>
+					        	<property>
+							        <name>test.basedir.res</name>
+							        <value>test-data</value>
+						        </property>
+                                <property>
+                                    <name>test.sftp.uri</name>
+                                    <value>${test.sftp.uri}</value>
+                                </property>
+                             </systemProperties>
+				        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>http</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+			        	<groupId>org.apache.maven.plugins</groupId>
+				        <artifactId>maven-surefire-plugin</artifactId>
+				        <configuration>
+					        <systemProperties>
+				        		<property>
+						        	<name>test.basedir</name>
+							        <value>target/test-classes/test-data</value>
+					        	</property>
+					        	<property>
+							        <name>test.basedir.res</name>
+							        <value>test-data</value>
+						        </property>
+                                <property>
+                                    <name>test.http.uri</name>
+                                    <value>${test.http.uri}</value>
+                                </property>
+                             </systemProperties>
+				        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java Wed Jan  7 05:28:48 2009
@@ -844,8 +844,7 @@
 					new Object[]
 					{ scheme, file });
 		}
-		return provider.createFileSystem(scheme, file, file.getFileSystem()
-				.getFileSystemOptions());
+		return provider.createFileSystem(scheme, file, file.getFileSystem().getFileSystemOptions());
 	}
 
 	/**

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/HttpRandomAccesContent.java Wed Jan  7 05:28:48 2009
@@ -84,7 +84,7 @@
         fileObject.setupMethod(getMethod);
         getMethod.setRequestHeader("Range", "bytes=" + filePointer + "-");
         final int status = fileSystem.getClient().executeMethod(getMethod);
-        if (status != HttpURLConnection.HTTP_PARTIAL)
+        if (status != HttpURLConnection.HTTP_PARTIAL && status != HttpURLConnection.HTTP_OK)
         {
             throw new FileSystemException("vfs.provider.http/get-range.error", new Object[]
             {
@@ -94,6 +94,11 @@
         }
 
         mis = new HttpFileObject.HttpInputStream(getMethod);
+        // If the range request was ignored
+        if (status == HttpURLConnection.HTTP_OK)
+        {
+            mis.skip(filePointer);
+        }
         dis = new DataInputStream(new FilterInputStream(mis)
         {
             public int read() throws IOException

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/ThreadLocalHttpConnectionManager.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/ThreadLocalHttpConnectionManager.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/ThreadLocalHttpConnectionManager.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/http/ThreadLocalHttpConnectionManager.java Wed Jan  7 05:28:48 2009
@@ -19,6 +19,7 @@
 import org.apache.commons.httpclient.HostConfiguration;
 import org.apache.commons.httpclient.HttpConnection;
 import org.apache.commons.httpclient.HttpConnectionManager;
+import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -40,25 +41,10 @@
  */
 public class ThreadLocalHttpConnectionManager implements HttpConnectionManager
 {
-    private static class ConnectionParameters
-    {
-        private boolean staleCheck;
-
-        public boolean isStaleCheckingEnabled()
-        {
-            return staleCheck;
-        }
-
-        public void setStaleCheckingEnabled(boolean b)
-        {
-            staleCheck = b;
-        }
-
-        public void populateParameters(HttpConnection connection)
-        {
-            connection.setStaleCheckingEnabled(staleCheck);
-        }
-    }
+    /**
+     * Collection of parameters associated with this connection manager.
+     */
+    private HttpConnectionManagerParams params = new HttpConnectionManagerParams();
 
     /**
      * Since the same connection is about to be reused, make sure the
@@ -97,11 +83,6 @@
     };
 
     /**
-     * Collection of parameters associated with this connection manager.
-     */
-    private ConnectionParameters params = new ConnectionParameters();
-
-    /**
      * release the connection of the current thread
      */
     public void releaseLocalConnection()
@@ -194,7 +175,7 @@
             httpConnection = new HttpConnection(hostConfiguration);
             setLocalHttpConnection(httpConnection);
             httpConnection.setHttpConnectionManager(this);
-            this.params.populateParameters(httpConnection);
+            httpConnection.getParams().setStaleCheckingEnabled(params.isStaleCheckingEnabled());
         }
         else
         {
@@ -267,4 +248,18 @@
             getLocalHttpConnection().close();
         }
     }
+
+    public HttpConnectionManagerParams getParams()
+    {
+        return this.params;
+    }
+
+    public void setParams(HttpConnectionManagerParams params)
+    {
+        if (params == null)
+        {
+            throw new IllegalArgumentException("Parameters may not be null");
+        }
+        this.params = params;
+    }
 }

Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/ExceptionConverter.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/ExceptionConverter.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/ExceptionConverter.java (added)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/ExceptionConverter.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,89 @@
+/*
+ * 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.vfs.provider.webdav;
+
+import org.apache.jackrabbit.webdav.DavException;
+import org.apache.jackrabbit.webdav.DavConstants;
+import org.apache.jackrabbit.webdav.client.methods.DavMethod;
+import org.apache.jackrabbit.webdav.xml.DomUtil;
+import org.apache.commons.vfs.FileSystemException;
+import org.w3c.dom.Element;
+
+import java.lang.reflect.Constructor;
+
+/**
+ * <code>ExceptionConverter</code>...
+ */
+public class ExceptionConverter
+{
+    // avoid instanciation
+    private ExceptionConverter()
+    {
+    }
+
+    public static FileSystemException generate(DavException davExc) throws FileSystemException
+    {
+        return generate(davExc, null);
+    }
+
+    public static FileSystemException generate(DavException davExc, DavMethod method)
+            throws FileSystemException
+    {
+        String msg = davExc.getMessage();
+        if (davExc.hasErrorCondition())
+        {
+            try
+            {
+                Element error = davExc.toXml(DomUtil.BUILDER_FACTORY.newDocumentBuilder().newDocument());
+                if (DomUtil.matches(error, DavException.XML_ERROR, DavConstants.NAMESPACE))
+                {
+                    if (DomUtil.hasChildElement(error, "exception", null))
+                    {
+                        Element exc = DomUtil.getChildElement(error, "exception", null);
+                        if (DomUtil.hasChildElement(exc, "message", null))
+                        {
+                            msg = DomUtil.getChildText(exc, "message", null);
+                        }
+                        if (DomUtil.hasChildElement(exc, "class", null))
+                        {
+                            Class cl = Class.forName(DomUtil.getChildText(exc, "class", null));
+                            Constructor excConstr = cl.getConstructor(new Class[]{String.class});
+                            if (excConstr != null)
+                            {
+                                Object o = excConstr.newInstance(new String[]{msg});
+                                if (o instanceof FileSystemException)
+                                {
+                                    return (FileSystemException) o;
+                                }
+                                else if (o instanceof Exception)
+                                {
+                                    return new FileSystemException(msg, (Exception) o);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            catch (Exception e)
+            {
+                throw new FileSystemException(e);
+            }
+        }
+
+        return new FileSystemException(msg);
+    }
+}
\ No newline at end of file

Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileContentInfoFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileContentInfoFactory.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileContentInfoFactory.java (added)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileContentInfoFactory.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,68 @@
+/*
+ * 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.vfs.provider.webdav;
+
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HeaderElement;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.util.DateUtil;
+import org.apache.commons.vfs.FileContent;
+import org.apache.commons.vfs.FileContentInfo;
+import org.apache.commons.vfs.FileContentInfoFactory;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.provider.http.HttpFileObject;
+import org.apache.commons.vfs.provider.URLFileName;
+import org.apache.commons.vfs.impl.DefaultFileContentInfo;
+import org.apache.jackrabbit.webdav.property.DavProperty;
+import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
+import org.apache.jackrabbit.webdav.property.DavPropertyName;
+import org.apache.jackrabbit.webdav.property.DavPropertySet;
+import org.apache.jackrabbit.webdav.DavConstants;
+
+/**
+ * Description
+ *
+ * @author
+ * @version $Revision:  $
+ */
+public class WebdavFileContentInfoFactory implements FileContentInfoFactory
+{
+    public FileContentInfo create(FileContent fileContent) throws FileSystemException
+    {
+        WebdavFileObject file = (WebdavFileObject) fileContent.getFile();
+
+        String contentType = null;
+        String contentEncoding = null;
+
+        DavPropertyNameSet nameSet = new DavPropertyNameSet();
+        nameSet.add(DavPropertyName.GETCONTENTTYPE);
+        DavPropertySet propertySet = file.getProperties((URLFileName)file.getName(), nameSet, true);
+
+        DavProperty property = propertySet.get(DavPropertyName.GETCONTENTTYPE);
+        if ( property != null )
+        {
+            contentType = (String) property.getValue();
+        }
+        property = propertySet.get(WebdavFileObject.RESPONSE_CHARSET);
+        if ( property != null )
+        {
+            contentEncoding = (String) property.getValue();
+        }
+
+        return new DefaultFileContentInfo(contentType, contentEncoding);
+    }
+}
\ No newline at end of file

Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileNameParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileNameParser.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileNameParser.java (added)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileNameParser.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,40 @@
+/*
+ * 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.vfs.provider.webdav;
+
+import org.apache.commons.vfs.provider.FileNameParser;
+import org.apache.commons.vfs.provider.URLFileNameParser;
+import org.apache.commons.vfs.provider.http.HttpFileNameParser;
+import org.apache.commons.vfs.FileSystemException;
+
+/**
+ * Implementation for http. set default port to 80
+ */
+public class WebdavFileNameParser extends HttpFileNameParser
+{
+    private final static WebdavFileNameParser INSTANCE = new WebdavFileNameParser();
+
+    public WebdavFileNameParser()
+    {
+        super();
+    }
+
+    public static FileNameParser getInstance()
+    {
+        return INSTANCE;
+    }
+}
\ No newline at end of file

Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java (added)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileObject.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,530 @@
+/*
+ * 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.vfs.provider.webdav;
+
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.URIException;
+import org.apache.commons.httpclient.methods.RequestEntity;
+import org.apache.commons.httpclient.methods.StringRequestEntity;
+import org.apache.commons.httpclient.util.DateUtil;
+import org.apache.commons.vfs.provider.URLFileName;
+import org.apache.commons.vfs.provider.http.HttpFileObject;
+import org.apache.commons.vfs.util.FileObjectUtils;
+import org.apache.commons.vfs.util.MonitorOutputStream;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileType;
+import org.apache.commons.vfs.NameScope;
+import org.apache.commons.vfs.FileNotFolderException;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileNotFoundException;
+import org.apache.commons.vfs.FileContentInfoFactory;
+import org.apache.jackrabbit.webdav.client.methods.DavMethod;
+import org.apache.jackrabbit.webdav.client.methods.MkColMethod;
+import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
+import org.apache.jackrabbit.webdav.client.methods.DeleteMethod;
+import org.apache.jackrabbit.webdav.client.methods.MoveMethod;
+import org.apache.jackrabbit.webdav.client.methods.PutMethod;
+import org.apache.jackrabbit.webdav.DavException;
+import org.apache.jackrabbit.webdav.DavConstants;
+import org.apache.jackrabbit.webdav.MultiStatus;
+import org.apache.jackrabbit.webdav.MultiStatusResponse;
+import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
+import org.apache.jackrabbit.webdav.property.DavPropertyName;
+import org.apache.jackrabbit.webdav.property.DavPropertySet;
+import org.apache.jackrabbit.webdav.property.DavProperty;
+import org.apache.jackrabbit.webdav.property.DefaultDavProperty;
+import org.w3c.dom.Node;
+
+import java.io.IOException;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+import java.util.Iterator;
+
+/**
+ * A WebDAV file.
+ *
+ * @author
+ * @version $Revision:  $
+ */
+public class WebdavFileObject
+    extends HttpFileObject
+    implements FileObject
+{
+    private final WebdavFileSystem fileSystem;
+    private final String urlCharset;
+    public static final DavPropertyName RESPONSE_CHARSET = DavPropertyName.create("response-charset");
+
+    protected WebdavFileObject(final FileName name,
+                               final WebdavFileSystem fileSystem)
+    {
+        super(name, fileSystem);
+        this.fileSystem = fileSystem;
+        this.urlCharset = WebdavFileSystemConfigBuilder.getInstance().getUrlCharset(getFileSystem().getFileSystemOptions());
+    }
+
+    protected void configureMethod(HttpMethodBase httpMethod)
+    {
+        httpMethod.setMethodRetryHandler(WebdavMethodRetryHandler.getInstance());
+    }
+
+    /**
+     * Determines the type of this file.  Must not return null.  The return
+     * value of this method is cached, so the implementation can be expensive.
+     */
+    protected FileType doGetType()
+        throws Exception
+    {
+        try
+        {
+            return isDirectory((URLFileName)getName()) ? FileType.FOLDER : FileType.FILE;
+        }
+        catch (FileNotFolderException fnfe)
+        {
+            return FileType.IMAGINARY;
+        }
+        catch (FileNotFoundException fnfe)
+        {
+            return FileType.IMAGINARY;
+        }
+
+    }
+
+    /**
+     * Lists the children of the file.
+     */
+    protected String[] doListChildren() throws Exception
+    {
+        // use doListChildrenResolved for performance
+        return null;
+    }
+
+    /**
+     * Lists the children of the file.
+     */
+    protected FileObject[] doListChildrenResolved() throws Exception
+    {
+        PropFindMethod method = null;
+        try
+        {
+            URLFileName name = (URLFileName)getName();
+            if ( isDirectory( name ) )
+            {
+                DavPropertyNameSet nameSet = new DavPropertyNameSet();
+                nameSet.add( DavPropertyName.create( DavConstants.PROPERTY_DISPLAYNAME ) );
+
+                method = new PropFindMethod( urlString(name), nameSet,
+                        DavConstants.DEPTH_1 );
+
+                execute( method );
+                List vfs = new ArrayList();
+                if ( method.succeeded() )
+                {
+                    MultiStatusResponse[] responses =
+                            method.getResponseBodyAsMultiStatus().getResponses();
+
+                    for (int i=0; i < responses.length; ++i)
+                    {
+                        MultiStatusResponse response = responses[i];
+                        if (isCurrentFile(response.getHref(), name))
+                        {
+                            continue;
+                        }
+                        String resourceName = resourceName(response.getHref());
+                        if (resourceName != null && resourceName.length() > 0)
+                        {
+                            WebdavFileObject fo = (WebdavFileObject)FileObjectUtils.
+                                getAbstractFileObject(getFileSystem().resolveFile(
+                                    getFileSystem().getFileSystemManager().
+                                        resolveName(getName(), resourceName, NameScope.CHILD)));
+                            vfs.add(fo);
+                        }
+                    }
+                }
+                return (WebdavFileObject[]) vfs.toArray(new WebdavFileObject[vfs.size()]);
+            }
+            throw new FileNotFolderException(getName());
+        }
+        catch ( FileNotFolderException fnfe)
+        {
+            throw fnfe;
+        }
+        catch ( DavException e )
+        {
+            throw new FileSystemException( e.getMessage(), e );
+        }
+        catch ( IOException e )
+        {
+            throw new FileSystemException( e.getMessage(), e );
+        }
+        finally
+        {
+            if ( method != null )
+                method.releaseConnection();
+        }
+    }
+
+    /**
+     * Creates this file as a folder.
+     */
+    protected void doCreateFolder() throws Exception
+    {
+        DavMethod method = new MkColMethod(urlString((URLFileName)getName()));
+        setupMethod(method);
+        try
+        {
+            execute(method);
+        }
+        catch (FileSystemException fse)
+        {
+            throw new FileSystemException("vfs.provider.webdav/create-collection.error", getName(),
+                                          fse);
+        }
+    }
+
+    /**
+     * Deletes the file.
+     */
+    protected void doDelete() throws Exception
+    {
+        DavMethod method = new DeleteMethod(urlString((URLFileName)getName()));
+        setupMethod(method);
+        execute(method);
+    }
+
+    /**
+     * Rename the file.
+     */
+    protected void doRename(FileObject newfile) throws Exception
+    {
+        String url = encodePath(urlString((URLFileName)getName()));
+        String dest = urlString((URLFileName)newfile.getName(), false);
+        DavMethod method = new MoveMethod(url, dest, false);
+        setupMethod(method);
+        execute(method);
+    }
+
+    /**
+     * Returns the size of the file content (in bytes).
+     */
+    protected long doGetContentSize() throws Exception
+    {
+        DavProperty property = getProperty((URLFileName)getName(),
+                DavConstants.PROPERTY_GETCONTENTLENGTH);
+        if ( property != null )
+        {
+            String value = (String) property.getValue();
+            return Long.parseLong(value);
+        }
+        return 0;
+    }
+
+    /**
+     * Returns the last modified time of this file.  Is only called if
+     * {@link #doGetType} does not return {@link FileType#IMAGINARY}.
+     */
+    protected long doGetLastModifiedTime() throws Exception
+    {
+        DavProperty property = getProperty((URLFileName)getName(),
+                DavConstants.PROPERTY_GETLASTMODIFIED);
+        if ( property != null )
+        {
+            String value = (String) property.getValue();
+            return DateUtil.parseDate(value).getTime();
+        }
+        return 0;
+    }
+
+    /**
+     * Returns the properties of the Webdav resource.
+     */
+    protected Map doGetAttributes() throws Exception
+    {
+        final Map attributes = new HashMap();
+        try
+        {
+            String url = urlString((URLFileName)getName());
+            PropFindMethod method = new PropFindMethod(url, DavConstants.PROPFIND_ALL_PROP,
+                    DavConstants.DEPTH_0);
+            execute( method );
+            if ( method.succeeded() )
+            {
+                MultiStatus multiStatus = method.getResponseBodyAsMultiStatus();
+                MultiStatusResponse response = multiStatus.getResponses()[0];
+                DavPropertySet properties = response.getProperties( HttpStatus.SC_OK );
+                Iterator iter = properties.iterator();
+                while (iter.hasNext())
+                {
+                    DavProperty property = (DavProperty)iter.next();
+                    attributes.put(property.getName(), property.getValue());
+                }
+            }
+            return attributes;
+        }
+        catch (Exception e)
+        {
+            throw new FileSystemException("vfs.provider.webdav/propfind.error", getName(), e);
+        }
+    }
+
+    protected OutputStream doGetOutputStream(boolean bAppend) throws Exception
+    {
+        return new WebdavOutputStream();
+    }
+
+    protected FileContentInfoFactory getFileContentInfoFactory()
+    {
+        return new WebdavFileContentInfoFactory();
+    }
+
+    /**
+     * Prepares a Method object.
+     * @param method the HttpMethod.
+     * @throws FileSystemException if an error occurs encoding the uri.
+     * @throws URIException if the URI is in error.
+     */
+    void setupMethod(final HttpMethod method) throws FileSystemException, URIException
+    {
+        String pathEncoded = ((URLFileName) getName()).getPathQueryEncoded(urlCharset);
+        method.setPath(pathEncoded);
+        // All the WebDav methods are EntityEnclosingMethods and are not allowed to redirect.
+        method.setFollowRedirects(false);
+        method.setRequestHeader("User-Agent", "Jakarta-Commons-VFS");
+        method.addRequestHeader( "Cache-control", "no-cache" );
+        method.addRequestHeader( "Cache-store", "no-store" );
+        method.addRequestHeader( "Pragma", "no-cache" );
+        method.addRequestHeader( "Expires", "0" );
+    }
+
+    /**
+     * Execute a 'Workspace' operation.
+     *
+     * @param method The DavMethod to invoke.
+     * @throws FileSystemException If an error occurs.
+     */
+    private void execute(DavMethod method) throws FileSystemException
+    {
+        try
+        {
+            int status = fileSystem.getClient().executeMethod(method);
+            if (status == HttpURLConnection.HTTP_NOT_FOUND
+                 || status == HttpURLConnection.HTTP_GONE)
+            {
+                throw new FileNotFoundException(method.getURI());
+            }
+            method.checkSuccess();
+        }
+        catch (FileSystemException fse)
+        {
+            throw fse;
+        }
+        catch (IOException e)
+        {
+            throw new FileSystemException(e);
+        }
+        catch (DavException e)
+        {
+            throw ExceptionConverter.generate(e);
+        }
+        finally
+        {
+            if (method != null)
+            {
+                method.releaseConnection();
+            }
+        }
+    }
+
+    private boolean isDirectory(URLFileName name) throws IOException, DavException
+    {
+        try
+        {
+            DavProperty property = getProperty(name, DavConstants.PROPERTY_RESOURCETYPE);
+            Node node;
+            if ( property != null && (node = (Node)property.getValue()) != null)
+            {
+                return node.getLocalName().equals( DavConstants.XML_COLLECTION );
+            }
+            else
+            {
+                return false;
+            }
+        }
+        catch (FileNotFoundException fse)
+        {
+            throw new FileNotFolderException(name);
+        }
+    }
+
+    DavProperty getProperty(URLFileName fileName, String property)
+            throws FileSystemException
+    {
+        DavPropertyNameSet nameSet = new DavPropertyNameSet();
+        DavPropertyName name = DavPropertyName.create(property);
+        nameSet.add(name);
+        DavPropertySet propertySet = getProperties(fileName, nameSet, false);
+        return propertySet.get(name);
+    }
+
+
+    DavPropertySet getProperties(URLFileName name, DavPropertyNameSet nameSet, boolean addEncoding)
+            throws FileSystemException
+    {
+        try
+        {
+            String urlStr = urlString(name);
+            PropFindMethod method = new PropFindMethod(urlStr, nameSet, DavConstants.DEPTH_0);
+            setupMethod(method);
+            execute( method );
+            if ( method.succeeded() )
+            {
+                MultiStatus multiStatus = method.getResponseBodyAsMultiStatus();
+                MultiStatusResponse response = multiStatus.getResponses()[0];
+                DavPropertySet props = response.getProperties( HttpStatus.SC_OK );
+                if (addEncoding)
+                {
+                    DavProperty prop = new DefaultDavProperty(RESPONSE_CHARSET,
+                            method.getResponseCharSet());
+                    props.add(prop);
+                }
+                return props;
+            }
+            return new DavPropertySet();
+        }
+        catch (FileSystemException fse)
+        {
+            throw fse;
+        }
+        catch (Exception e)
+        {
+            throw new FileSystemException("vfs.provider.webdav/propfind.error", getName(), e);
+        }
+    }
+
+    /**
+     * Returns the resource name from the path.
+     * @param path the path to the file.
+     * @return The resource name
+     */
+    private String resourceName( String path )
+    {
+        if (path.endsWith("/"))
+        {
+            path = path.substring(0, path.length()-1);
+        }
+        final int i = path.lastIndexOf( "/" );
+        return ( ( i >= 0 ) ? path.substring( i + 1 ) : path );
+    }
+
+    private String urlString(URLFileName name)
+    {
+        return urlString(name, true);
+    }
+
+    /**
+     * Convert the FileName to an encoded url String.
+     * @param name The FileName.
+     * @return The encoded URL String.
+     */
+    private String urlString(URLFileName name, boolean includeUserInfo)
+    {
+        String user = null;
+        String password = null;
+        if (includeUserInfo)
+        {
+            user = name.getUserName();
+            password = name.getPassword();
+        }
+        URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(),
+                name.getDefaultPort(), user, password,
+                name.getPath(), name.getType(), name.getQueryString());
+        try
+        {
+            return newFile.getURIEncoded(urlCharset);
+        }
+        catch (Exception e)
+        {
+            return name.getURI();
+        }
+    }
+
+    private boolean isCurrentFile(String href, URLFileName fileName)
+    {
+        String name = hrefString(fileName);
+        if (href.endsWith("/") && !name.endsWith("/"))
+        {
+            name += "/";
+        }
+        return href.equals(name);
+    }
+
+    /**
+     * Convert the FileName to an encoded url String.
+     * @param name The FileName.
+     * @return The encoded URL String.
+     */
+    private String hrefString(URLFileName name)
+    {
+        URLFileName newFile = new URLFileName("http", name.getHostName(), name.getPort(),
+                name.getDefaultPort(), null, null,
+                name.getPath(), name.getType(), name.getQueryString());
+        try
+        {
+            return newFile.getURIEncoded(urlCharset);
+        }
+        catch (Exception e)
+        {
+            return name.getURI();
+        }
+    }
+
+    /**
+     * An OutputStream that writes to a Webdav resource.
+     *
+     * @todo Use piped stream to avoid temporary file
+     */
+    private class WebdavOutputStream extends MonitorOutputStream
+    {
+        private ByteArrayOutputStream stream;
+
+        public WebdavOutputStream() throws FileSystemException
+        {
+            super(new ByteArrayOutputStream());
+        }
+
+        /**
+         * Called after this stream is closed.
+         */
+        protected void onClose() throws IOException
+        {
+            RequestEntity entity = new StringRequestEntity(out.toString());
+            String urlStr = urlString((URLFileName)getName());
+            PutMethod method = new PutMethod(urlStr);
+            method.setRequestEntity(entity);
+            setupMethod(method);
+            execute(method);
+        }
+    }
+
+}
\ No newline at end of file

Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileProvider.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileProvider.java (added)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileProvider.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,116 @@
+/*
+ * 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.vfs.provider.webdav;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.vfs.Capability;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileSystem;
+import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileSystemOptions;
+import org.apache.commons.vfs.UserAuthenticationData;
+import org.apache.commons.vfs.FileSystemConfigBuilder;
+import org.apache.commons.vfs.util.UserAuthenticatorUtils;
+import org.apache.commons.vfs.provider.AbstractOriginatingFileProvider;
+import org.apache.commons.vfs.provider.GenericFileName;
+import org.apache.commons.vfs.provider.http.HttpFileNameParser;
+import org.apache.commons.vfs.provider.http.HttpFileProvider;
+import org.apache.commons.vfs.provider.http.HttpClientFactory;
+import org.apache.commons.vfs.provider.http.HttpFileSystemConfigBuilder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+
+/**
+ * A provider for WebDAV.
+ *
+ * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
+ * @version $Revision: 659785 $ $Date: 2008-05-24 03:32:41 -0700 (Sat, 24 May 2008) $
+ */
+public class WebdavFileProvider
+    extends HttpFileProvider
+{
+    protected final static Collection capabilities = Collections.unmodifiableCollection(Arrays.asList(new Capability[]
+    {
+        Capability.CREATE,
+        Capability.DELETE,
+        Capability.RENAME,
+        Capability.GET_TYPE,
+        Capability.LIST_CHILDREN,
+        Capability.READ_CONTENT,
+        Capability.URI,
+        Capability.WRITE_CONTENT,
+        Capability.GET_LAST_MODIFIED,
+        Capability.ATTRIBUTES,
+        Capability.RANDOM_ACCESS_READ,
+        Capability.DIRECTORY_READ_CONTENT,
+    }));
+
+	public final static UserAuthenticationData.Type[] AUTHENTICATOR_TYPES = new UserAuthenticationData.Type[]
+		{
+			UserAuthenticationData.USERNAME, UserAuthenticationData.PASSWORD
+		};
+
+	public WebdavFileProvider()
+    {
+        super();
+
+        setFileNameParser(WebdavFileNameParser.getInstance());
+    }
+        /**
+     * Creates a {@link FileSystem}.
+     */
+    protected FileSystem doCreateFileSystem(final FileName name, final FileSystemOptions fileSystemOptions)
+        throws FileSystemException
+    {
+        // Create the file system
+        final GenericFileName rootName = (GenericFileName) name;
+
+		UserAuthenticationData authData = null;
+		HttpClient httpClient;
+		try
+		{
+			authData = UserAuthenticatorUtils.authenticate(fileSystemOptions, AUTHENTICATOR_TYPES);
+
+			httpClient = HttpClientFactory.createConnection(
+                "http",
+                rootName.getHostName(),
+				rootName.getPort(),
+				UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, UserAuthenticatorUtils.toChar(rootName.getUserName()))),
+				UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, UserAuthenticatorUtils.toChar(rootName.getPassword()))),
+				fileSystemOptions);
+		}
+		finally
+		{
+			UserAuthenticatorUtils.cleanup(authData);
+		}
+
+		return new WebdavFileSystem(rootName, httpClient, fileSystemOptions);
+    }
+
+    public FileSystemConfigBuilder getConfigBuilder()
+    {
+        return WebdavFileSystemConfigBuilder.getInstance();
+    }
+
+
+    public Collection getCapabilities()
+    {
+        return capabilities;
+    }
+}

Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystem.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystem.java (added)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystem.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,80 @@
+/*
+ * 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.vfs.provider.webdav;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpConnectionManager;
+import org.apache.commons.vfs.FileName;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystem;
+import org.apache.commons.vfs.FileSystemOptions;
+import org.apache.commons.vfs.provider.AbstractFileSystem;
+import org.apache.commons.vfs.provider.GenericFileName;
+import org.apache.commons.vfs.provider.DefaultURLStreamHandler;
+import org.apache.commons.vfs.provider.http.ThreadLocalHttpConnectionManager;
+import org.apache.commons.vfs.provider.http.HttpFileSystem;
+
+import java.util.Collection;
+import java.net.URLStreamHandler;
+
+/**
+ * A WebDAV file system.
+ *
+ * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
+ * @version $Revision: 548717 $ $Date: 2007-06-19 06:07:40 -0700 (Tue, 19 Jun 2007) $
+ */
+public class WebdavFileSystem
+    extends HttpFileSystem
+    implements FileSystem
+{
+    protected WebdavFileSystem(final GenericFileName rootName, final HttpClient client, final FileSystemOptions fileSystemOptions)
+    {
+        super(rootName, client, fileSystemOptions);
+    }
+
+    protected HttpClient getClient()
+    {
+        return super.getClient();
+    }
+
+    /**
+     * Returns the capabilities of this file system.
+     */
+    protected void addCapabilities(final Collection caps)
+    {
+        caps.addAll(WebdavFileProvider.capabilities);
+    }
+
+    /**
+     * Creates a file object.  This method is called only if the requested
+     * file is not cached.
+     */
+    protected FileObject createFile(final FileName name)
+    {
+
+        return new WebdavFileObject(name, this);
+    }
+
+    /**
+     * Return a URLStreamHandler
+     * @return
+     */
+    public URLStreamHandler getURLStreamHandler()
+    {
+        return new DefaultURLStreamHandler(getContext(), getFileSystemOptions());
+    }
+}

Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystemConfigBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystemConfigBuilder.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystemConfigBuilder.java (added)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavFileSystemConfigBuilder.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,135 @@
+/*
+ * 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.vfs.provider.webdav;
+
+import org.apache.commons.vfs.FileSystemConfigBuilder;
+import org.apache.commons.vfs.FileSystemOptions;
+import org.apache.commons.vfs.UserAuthenticator;
+
+/**
+ * Configuration options for WebDav
+ * 
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
+ */
+public class WebdavFileSystemConfigBuilder extends FileSystemConfigBuilder
+{
+    private final static WebdavFileSystemConfigBuilder builder = new WebdavFileSystemConfigBuilder();
+
+    public static WebdavFileSystemConfigBuilder getInstance()
+    {
+        return builder;
+    }
+
+    private WebdavFileSystemConfigBuilder()
+    {
+    }
+
+    /**
+     * Set the charset used for url encoding<br>
+     *
+     * @param chaset the chaset
+     */
+    public void setUrlCharset(FileSystemOptions opts, String chaset)
+    {
+        setParam(opts, "urlCharset", chaset);
+    }
+
+    /**
+     * Set the charset used for url encoding<br>
+     *
+     * @return the chaset
+     */
+    public String getUrlCharset(FileSystemOptions opts)
+    {
+        return (String) getParam(opts, "urlCharset");
+    }
+
+    /**
+     * Set the proxy to use for webdav connection.<br>
+     * You have to set the ProxyPort too if you would like to have the proxy relly used.
+     *
+     * @param proxyHost the host
+     * @see #setProxyPort
+     */
+    public void setProxyHost(FileSystemOptions opts, String proxyHost)
+    {
+        setParam(opts, "proxyHost", proxyHost);
+    }
+
+    /**
+     * Set the proxy-port to use for webdav connection
+     * You have to set the ProxyHost too if you would like to have the proxy relly used.
+     *
+     * @param proxyPort the port
+     * @see #setProxyHost
+     */
+    public void setProxyPort(FileSystemOptions opts, int proxyPort)
+    {
+        setParam(opts, "proxyPort", new Integer(proxyPort));
+    }
+
+    /**
+     * Get the proxy to use for webdav connection
+     * You have to set the ProxyPort too if you would like to have the proxy relly used.
+     *
+     * @return proxyHost
+     * @see #setProxyPort
+     */
+    public String getProxyHost(FileSystemOptions opts)
+    {
+        return (String) getParam(opts, "proxyHost");
+    }
+
+    /**
+     * Get the proxy-port to use for webdav the connection
+     * You have to set the ProxyHost too if you would like to have the proxy relly used.
+     *
+     * @return proxyPort: the port number or 0 if it is not set
+     * @see #setProxyHost
+     */
+    public int getProxyPort(FileSystemOptions opts)
+    {
+        if (!hasParam(opts, "proxyPort"))
+        {
+            return 0;
+        }
+
+        return ((Number) getParam(opts, "proxyPort")).intValue();
+    }
+
+    /**
+     * Set the proxy authenticator where the system should get the credentials from
+     */
+    public void setProxyAuthenticator(FileSystemOptions opts, UserAuthenticator authenticator)
+    {
+        setParam(opts, "proxyAuthenticator", authenticator);
+    }
+
+    /**
+     * Get the proxy authenticator where the system should get the credentials from
+     */
+    public UserAuthenticator getProxyAuthenticator(FileSystemOptions opts)
+    {
+        return (UserAuthenticator) getParam(opts, "proxyAuthenticator");
+    }
+    
+    protected Class getConfigClass()
+    {
+        return WebdavFileSystem.class;
+    }
+}

Added: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavMethodRetryHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavMethodRetryHandler.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavMethodRetryHandler.java (added)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/webdav/WebdavMethodRetryHandler.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,49 @@
+/*
+ * 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.vfs.provider.webdav;
+
+import org.apache.commons.httpclient.MethodRetryHandler;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.HttpConnection;
+import org.apache.commons.httpclient.HttpRecoverableException;
+
+
+/**
+ * A retry handler which will retry a failed webdav method one time.<br />
+ * Now that webdavlib didnt support adding a MethodRetryHandler only a few operations are restartable yet.
+ *
+ * @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
+ * @version $Revision: 561984 $ $Date: 2007-08-01 15:56:34 -0700 (Wed, 01 Aug 2007) $
+ */
+public class WebdavMethodRetryHandler implements MethodRetryHandler
+{
+    private final static WebdavMethodRetryHandler INSTANCE = new WebdavMethodRetryHandler();
+
+    private WebdavMethodRetryHandler()
+    {
+    }
+
+    public static WebdavMethodRetryHandler getInstance()
+    {
+        return INSTANCE;
+    }
+
+    public boolean retryMethod(HttpMethod method, HttpConnection connection, HttpRecoverableException recoverableException, int executionCount, boolean requestSent)
+    {
+        return executionCount < 2;
+    }
+}

Added: commons/proper/vfs/trunk/core/src/test/java/code/ClassToLoad.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/code/ClassToLoad.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/code/ClassToLoad.java (added)
+++ commons/proper/vfs/trunk/core/src/test/java/code/ClassToLoad.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,33 @@
+/*
+ * 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 code;
+
+/**
+ * The test class for the VFS classloader.
+ *
+ * @author <a href="mailto:brian@mmmanager.org">Brian Olsen</a>
+ * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
+ */
+public class ClassToLoad
+{
+    private String m_message = "**PRIVATE**";
+
+    public String toString()
+    {
+        return m_message;
+    }
+}

Added: commons/proper/vfs/trunk/core/src/test/java/code/sealed/AnotherClass.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/code/sealed/AnotherClass.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/code/sealed/AnotherClass.java (added)
+++ commons/proper/vfs/trunk/core/src/test/java/code/sealed/AnotherClass.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,27 @@
+/*
+ * 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 code.sealed;
+
+/**
+ * A test class for the ClassLoader tests.
+ *
+ * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
+ * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
+ */
+public class AnotherClass
+{
+}

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/impl/test/VfsClassLoaderTests.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/impl/test/VfsClassLoaderTests.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/impl/test/VfsClassLoaderTests.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/impl/test/VfsClassLoaderTests.java Wed Jan  7 05:28:48 2009
@@ -18,6 +18,7 @@
 
 import org.apache.commons.vfs.Capability;
 import org.apache.commons.vfs.FileSystemException;
+import org.apache.commons.vfs.FileObject;
 import org.apache.commons.vfs.impl.VFSClassLoader;
 import org.apache.commons.vfs.test.AbstractProviderTestCase;
 
@@ -50,8 +51,9 @@
      */
     private VFSClassLoader createClassLoader() throws FileSystemException
     {
+        FileObject file = getBaseFolder();
         final VFSClassLoader loader =
-            new VFSClassLoader(getBaseFolder(), getManager());
+            new VFSClassLoader(file , getManager());
         return loader;
     }
 

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/ftp/test/FtpProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/ftp/test/FtpProviderTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/ftp/test/FtpProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/ftp/test/FtpProviderTestCase.java Wed Jan  7 05:28:48 2009
@@ -17,6 +17,7 @@
 package org.apache.commons.vfs.provider.ftp.test;
 
 import junit.framework.Test;
+import junit.framework.TestSuite;
 import org.apache.commons.vfs.FileObject;
 import org.apache.commons.vfs.FileSystemManager;
 import org.apache.commons.vfs.FileSystemOptions;
@@ -36,12 +37,20 @@
     extends AbstractProviderTestConfig
     implements ProviderTestConfig
 {
+    private static final String TEST_URI = "test.ftp.uri";
     /**
      * Creates the test suite for the ftp file system.
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new FtpProviderTestCase());
+        if (System.getProperty(TEST_URI) != null)
+        {
+            return new ProviderTestSuite(new FtpProviderTestCase());
+        }
+        else
+        {
+            return notConfigured(FtpProviderTestCase.class);
+        }
     }
 
     /**
@@ -57,7 +66,7 @@
      */
     public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
     {
-        final String uri = System.getProperty("test.ftp.uri");
+        final String uri = System.getProperty(TEST_URI);
         FileSystemOptions opts = new FileSystemOptions();
         FtpFileSystemConfigBuilder.getInstance().setPassiveMode(opts, true);
         return manager.resolveFile(uri, opts);

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/http/test/HttpProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/http/test/HttpProviderTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/http/test/HttpProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/http/test/HttpProviderTestCase.java Wed Jan  7 05:28:48 2009
@@ -33,9 +33,17 @@
 public class HttpProviderTestCase
     extends AbstractProviderTestConfig
 {
+    private static final String TEST_URI = "test.http.uri";
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new HttpProviderTestCase());
+        if (System.getProperty(TEST_URI) != null)
+        {
+            return new ProviderTestSuite(new HttpProviderTestCase());
+        }
+        else
+        {
+            return notConfigured(HttpProviderTestCase.class);
+        }
     }
 
     /**
@@ -53,7 +61,7 @@
     public FileObject getBaseTestFolder(final FileSystemManager manager)
         throws Exception
     {
-        final String uri = System.getProperty("test.http.uri");
+        final String uri = System.getProperty(TEST_URI);
         return manager.resolveFile(uri);
     }
 }

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/JarProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/JarProviderTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/JarProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/JarProviderTestCase.java Wed Jan  7 05:28:48 2009
@@ -42,7 +42,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new JarProviderTestCase());
+        return new ProviderTestSuite(new JarProviderTestCase(), true);
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/NestedJarTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/NestedJarTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/NestedJarTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/jar/test/NestedJarTestCase.java Wed Jan  7 05:28:48 2009
@@ -42,7 +42,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new NestedJarTestCase());
+        return new ProviderTestSuite(new NestedJarTestCase(), true);
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/sftp/test/SftpProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/sftp/test/SftpProviderTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/sftp/test/SftpProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/sftp/test/SftpProviderTestCase.java Wed Jan  7 05:28:48 2009
@@ -36,9 +36,17 @@
 public class SftpProviderTestCase
     extends AbstractProviderTestConfig
 {
+    private static final String TEST_URI = "test.sftp.uri";
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new SftpProviderTestCase());
+        if (System.getProperty(TEST_URI) != null)
+        {
+            return new ProviderTestSuite(new SftpProviderTestCase());
+        }
+        else
+        {
+            return notConfigured(SftpProviderTestCase.class);
+        }
     }
 
     /**
@@ -55,7 +63,7 @@
      */
     public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception
     {
-        final String uri = System.getProperty("test.sftp.uri");
+        final String uri = System.getProperty(TEST_URI);
 
         FileSystemOptions fileSystemOptions = new FileSystemOptions();
         SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(fileSystemOptions, "no");

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTarTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTarTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTarTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTarTestCase.java Wed Jan  7 05:28:48 2009
@@ -38,7 +38,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new NestedTarTestCase());
+        return new ProviderTestSuite(new NestedTarTestCase(), true);
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTbz2TestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTbz2TestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTbz2TestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTbz2TestCase.java Wed Jan  7 05:28:48 2009
@@ -38,7 +38,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new NestedTbz2TestCase());
+        return new ProviderTestSuite(new NestedTbz2TestCase(), true);
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTgzTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTgzTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTgzTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/NestedTgzTestCase.java Wed Jan  7 05:28:48 2009
@@ -38,7 +38,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new NestedTgzTestCase());
+        return new ProviderTestSuite(new NestedTgzTestCase(), true);
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TarProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TarProviderTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TarProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TarProviderTestCase.java Wed Jan  7 05:28:48 2009
@@ -40,7 +40,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new TarProviderTestCase());
+        return new ProviderTestSuite(new TarProviderTestCase(), true);
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/Tbz2ProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/Tbz2ProviderTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/Tbz2ProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/Tbz2ProviderTestCase.java Wed Jan  7 05:28:48 2009
@@ -40,7 +40,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new Tbz2ProviderTestCase());
+        return new ProviderTestSuite(new Tbz2ProviderTestCase(), true);
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TgzProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TgzProviderTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TgzProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/tar/test/TgzProviderTestCase.java Wed Jan  7 05:28:48 2009
@@ -40,7 +40,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new TgzProviderTestCase());
+        return new ProviderTestSuite(new TgzProviderTestCase(), true);
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/url/test/UrlProviderHttpTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/url/test/UrlProviderHttpTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/url/test/UrlProviderHttpTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/url/test/UrlProviderHttpTestCase.java Wed Jan  7 05:28:48 2009
@@ -33,9 +33,18 @@
 public class UrlProviderHttpTestCase
     extends AbstractProviderTestConfig
 {
+    private static final String TEST_URI = "test.http.uri";
+
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new UrlProviderHttpTestCase());
+        if (System.getProperty(TEST_URI) != null)
+        {
+            return new ProviderTestSuite(new UrlProviderTestCase());
+        }
+        else
+        {
+            return notConfigured(UrlProviderTestCase.class);
+        }
     }
 
     /**
@@ -53,7 +62,7 @@
     public FileObject getBaseTestFolder(final FileSystemManager manager)
         throws Exception
     {
-        final String uri = System.getProperty("test.http.uri");
+        final String uri = System.getProperty(TEST_URI);
         return manager.resolveFile(uri);
     }
 }

Added: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/webdav/test/WebdavProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/webdav/test/WebdavProviderTestCase.java?rev=732328&view=auto
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/webdav/test/WebdavProviderTestCase.java (added)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/webdav/test/WebdavProviderTestCase.java Wed Jan  7 05:28:48 2009
@@ -0,0 +1,69 @@
+/*
+ * 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.vfs.provider.webdav.test;
+
+import junit.framework.Test;
+import org.apache.commons.vfs.FileObject;
+import org.apache.commons.vfs.FileSystemManager;
+import org.apache.commons.vfs.impl.DefaultFileSystemManager;
+import org.apache.commons.vfs.provider.temp.TemporaryFileProvider;
+import org.apache.commons.vfs.provider.webdav.WebdavFileProvider;
+import org.apache.commons.vfs.test.AbstractProviderTestConfig;
+import org.apache.commons.vfs.test.ProviderTestSuite;
+
+/**
+ * Test cases for the WebDAV provider.
+ *
+ * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
+ * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
+ */
+public class WebdavProviderTestCase
+    extends AbstractProviderTestConfig
+{
+    private static final String TEST_URI = "test.webdav.uri";
+    public static Test suite() throws Exception
+    {
+        if (System.getProperty(TEST_URI) != null)
+        {
+            return new ProviderTestSuite(new WebdavProviderTestCase());
+        }
+        else
+        {
+            return notConfigured(WebdavProviderTestCase.class);
+        }
+    }
+
+    /**
+     * Prepares the file system manager.
+     */
+    public void prepare(final DefaultFileSystemManager manager)
+        throws Exception
+    {
+        manager.addProvider("webdav", new WebdavFileProvider());
+        manager.addProvider("tmp", new TemporaryFileProvider());
+    }
+
+    /**
+     * Returns the base folder for tests.
+     */
+    public FileObject getBaseTestFolder(final FileSystemManager manager)
+        throws Exception
+    {
+        final String uri = System.getProperty(TEST_URI);
+        return manager.resolveFile(uri);
+    }
+}

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/NestedZipTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/NestedZipTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/NestedZipTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/NestedZipTestCase.java Wed Jan  7 05:28:48 2009
@@ -40,7 +40,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new NestedZipTestCase());
+        return new ProviderTestSuite(new NestedZipTestCase(), true);
     }
 
     /**

Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/ZipProviderTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/ZipProviderTestCase.java?rev=732328&r1=732327&r2=732328&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/ZipProviderTestCase.java (original)
+++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs/provider/zip/test/ZipProviderTestCase.java Wed Jan  7 05:28:48 2009
@@ -42,7 +42,7 @@
      */
     public static Test suite() throws Exception
     {
-        return new ProviderTestSuite(new ZipProviderTestCase());
+        return new ProviderTestSuite(new ZipProviderTestCase(), true);
     }
 
     /**



Mime
View raw message