Author: carlos Date: Mon Apr 10 19:30:42 2006 New Revision: 393137 URL: http://svn.apache.org/viewcvs?rev=393137&view=rev Log: Use WebdavResource.exist instead of checking exceptions
Modified: maven/sandbox/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java Modified: maven/sandbox/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java URL: http://svn.apache.org/viewcvs/maven/sandbox/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java?rev=393137&r1=393136&r2=393137&view=diff ============================================================================== --- maven/sandbox/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java (original) +++ maven/sandbox/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java Mon Apr 10 19:30:42 2006 @@ -112,6 +112,7 @@ { httpURL = urlToHttpURL( url ); + CorrectedWebdavResource.setDefaultAction( CorrectedWebdavResource.NOACTION ); wdresource = new CorrectedWebdavResource( httpURL ); } catch ( HttpException he ) @@ -225,11 +226,9 @@ } wdresource.setPath( oldpath ); - } - // if dest resource path does not exist, create it - catch ( HttpException e ) - { - if ( e.getReasonCode() == HttpStatus.SC_NOT_FOUND ) + + // if dest resource path does not exist, create it + if ( !wdresource.exists() ) { // mkcolMethod() cannot create a directory heirarchy at once, // it has to create each directory one at a time @@ -251,11 +250,6 @@ throw new TransferFailedException( "Failed to create destination WebDAV collection (directory): " + relpath ); } - } - else - { - throw new TransferFailedException( "Failed to create destination WebDAV collection (directory): " - + relpath ); } } catch ( IOException e )