maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r662025 - /maven/wagon/trunk/wagon-providers/wagon-webdav-jackrabbit/src/main/java/org/apache/maven/wagon/providers/webdav/jackrabbit/WebDavWagon.java
Date Sat, 31 May 2008 13:34:55 GMT
Author: brett
Date: Sat May 31 06:34:55 2008
New Revision: 662025

URL: http://svn.apache.org/viewvc?rev=662025&view=rev
Log:
improve error handling for webdav directory creation

Modified:
    maven/wagon/trunk/wagon-providers/wagon-webdav-jackrabbit/src/main/java/org/apache/maven/wagon/providers/webdav/jackrabbit/WebDavWagon.java

Modified: maven/wagon/trunk/wagon-providers/wagon-webdav-jackrabbit/src/main/java/org/apache/maven/wagon/providers/webdav/jackrabbit/WebDavWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-webdav-jackrabbit/src/main/java/org/apache/maven/wagon/providers/webdav/jackrabbit/WebDavWagon.java?rev=662025&r1=662024&r2=662025&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-webdav-jackrabbit/src/main/java/org/apache/maven/wagon/providers/webdav/jackrabbit/WebDavWagon.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-webdav-jackrabbit/src/main/java/org/apache/maven/wagon/providers/webdav/jackrabbit/WebDavWagon.java
Sat May 31 06:34:55 2008
@@ -106,6 +106,8 @@
         catch ( IOException e )
         {
             fireTransferError( resource, e, TransferEvent.REQUEST_GET );
+            
+            throw new TransferFailedException( e.getMessage() );
         }
 
         super.put(source, resource);
@@ -128,9 +130,10 @@
      * @param dir path to be created in server from repository basedir
      * @throws IOException 
      * @throws HttpException 
+     * @throws AuthorizationException 
      * @throws TransferFailedException
      */
-    private void mkdirs( String dir ) throws HttpException, IOException
+    private void mkdirs( String dir ) throws HttpException, IOException, AuthorizationException
     {
         Repository repository = getRepository();
         String basedir = repository.getBasedir();
@@ -151,6 +154,16 @@
             {
                 break;
             }
+
+            if ( status == HttpStatus.SC_UNAUTHORIZED )
+            {
+                throw new AuthorizationException( "Unable to create collection: " + url );
+            }
+            
+            if ( status != HttpStatus.SC_CONFLICT )
+            {
+                throw new IOException( "Unable to create collection: " + url + "; status
code = " + status );
+            }
         }
 
         // traverse forward creating missing directories



---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-commits-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-commits-help@maven.apache.org


Mime
View raw message