maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r573479 - in /maven/wagon/branches/wagon-1.x: wagon-provider-api/src/main/java/org/apache/maven/wagon/ wagon-provider-api/src/main/java/org/apache/maven/wagon/events/ wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/ wagon...
Date Fri, 07 Sep 2007 06:50:36 GMT
Author: brett
Date: Thu Sep  6 23:50:32 2007
New Revision: 573479

URL: http://svn.apache.org/viewvc?rev=573479&view=rev
Log:
apply some changes from trunk

Modified:
    maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/Wagon.java
    maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java
    maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java
    maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java
    maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/PutInputStream.java
    maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java
    maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavWagonTest.java

Modified: maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/Wagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/Wagon.java?rev=573479&r1=573478&r2=573479&view=diff
==============================================================================
--- maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/Wagon.java
(original)
+++ maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/Wagon.java
Thu Sep  6 23:50:32 2007
@@ -72,7 +72,8 @@
 
     /**
      * Copy a file from local system to remote
-     * @param source the local file
+     *
+     * @param source      the local file
      * @param destination the remote destination
      * @throws TransferFailedException
      * @throws ResourceDoesNotExistException
@@ -83,7 +84,8 @@
 
     /**
      * Copy a directory from local system to remote
-     * @param sourceDirectory the local directory
+     *
+     * @param sourceDirectory      the local directory
      * @param destinationDirectory the remote destination
      * @throws TransferFailedException
      * @throws ResourceDoesNotExistException
@@ -91,47 +93,48 @@
      */
     void putDirectory( File sourceDirectory, String destinationDirectory )
         throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException;
-    
+
     /**
      * Check if a remote resource exists
-     * 
+     *
      * @param resourceName
-     * @return whether the resource exists or not 
+     * @return whether the resource exists or not
      * @throws TransferFailedException if there's an error trying to access the remote side
-     * @throws AuthorizationException if not authorized to verify the existence of the resource
+     * @throws AuthorizationException  if not authorized to verify the existence of the resource
      */
     boolean resourceExists( String resourceName )
         throws TransferFailedException, AuthorizationException;
-    
+
     /**
-     * <p>
+     * <p/>
      * Returns a {@link List} of strings naming the files and directories in the directory
denoted by
      * this abstract pathname.
      * </p>
-     * <p>
+     * <p/>
      * If this abstract pathname does not denote a directory, or does not exist, then this
method throws
      * {@link ResourceDoesNotExistException}.
      * Otherwise a {@link List} of strings is returned, one for each file or directory in
the directory.
      * Names denoting the directory itself and the directory's parent directory are not included
in
      * the result. Each string is a file name rather than a complete path.
      * </p>
-     * <p>
+     * <p/>
      * There is no guarantee that the name strings in the resulting list will appear in any
specific
      * order; they are not, in particular, guaranteed to appear in alphabetical order.
-     * </p> 
-     * 
+     * </p>
+     *
      * @param destinationDirectory directory to list contents of
      * @return A {@link List} of strings naming the files and directories in the directory
denoted by
-     * this abstract pathname. The {@link List} will be empty if the directory is empty.
-     * @throws TransferFailedException if there's an error trying to access the remote side
+     *         this abstract pathname. The {@link List} will be empty if the directory is
empty.
+     * @throws TransferFailedException       if there's an error trying to access the remote
side
      * @throws ResourceDoesNotExistException if destinationDirectory does not exist or is
not a directory
-     * @throws AuthorizationException if not authorized to list the contents of the directory
+     * @throws AuthorizationException        if not authorized to list the contents of the
directory
      */
     List getFileList( String destinationDirectory )
-        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException;

+        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException;
 
     /**
-     * 
+     * Flag indicating if this wagon supports directory copy operations.
+     *
      * @return whether if this wagon supports directory operations
      */
     boolean supportsDirectoryCopy();
@@ -142,21 +145,70 @@
     // Connection/Disconnection
     // ----------------------------------------------------------------------
 
+    /**
+     * Initiate the connection to the repository.
+     *
+     * @param source the repository to connect to
+     * @throws ConnectionException if there is a problem connecting
+     * @throws org.apache.maven.wagon.authentication.AuthenticationException
+     *                             if ther credentials for connecting are not sufficient
+     */
     void connect( Repository source )
         throws ConnectionException, AuthenticationException;
 
+    /**
+     * Initiate the connection to the repository.
+     *
+     * @param source the repository to connect to
+     * @throws ConnectionException if there is a problem connecting
+     * @throws org.apache.maven.wagon.authentication.AuthenticationException
+     *                             if ther credentials for connecting are not sufficient
+     */
     void connect( Repository source, ProxyInfo proxyInfo )
         throws ConnectionException, AuthenticationException;
 
+    /**
+     * Initiate the connection to the repository.
+     *
+     * @param source             the repository to connect to
+     * @param authenticationInfo authentication credentials for connecting
+     * @throws ConnectionException if there is a problem connecting
+     * @throws org.apache.maven.wagon.authentication.AuthenticationException
+     *                             if ther credentials for connecting are not sufficient
+     */
     void connect( Repository source, AuthenticationInfo authenticationInfo )
         throws ConnectionException, AuthenticationException;
 
+    /**
+     * Initiate the connection to the repository.
+     *
+     * @param source             the repository to connect to
+     * @param authenticationInfo authentication credentials for connecting
+     * @param proxyInfo          the network proxy to use to connect to the remote repository
+     * @throws ConnectionException if there is a problem connecting
+     * @throws org.apache.maven.wagon.authentication.AuthenticationException
+     *                             if ther credentials for connecting are not sufficient
+     */
     void connect( Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo
)
         throws ConnectionException, AuthenticationException;
 
+    /**
+     * Initiate the connection to the repository.
+     *
+     * @throws ConnectionException if there is a problem connecting
+     * @throws org.apache.maven.wagon.authentication.AuthenticationException
+     *                             if ther credentials for connecting are not sufficient
+     * @todo delegate this to a truly internal connection method
+     * @deprecated connect using the {@link #connect(org.apache.maven.wagon.repository.Repository)}
or related methods - this is an internal method
+     */
     void openConnection()
         throws ConnectionException, AuthenticationException;
 
+    /**
+     * Disconnect from the repository.
+     *
+     * @throws ConnectionException if there is a problem disconnecting
+     */
     void disconnect()
         throws ConnectionException;
 

Modified: maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java
URL: http://svn.apache.org/viewvc/maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java?rev=573479&r1=573478&r2=573479&view=diff
==============================================================================
--- maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java
(original)
+++ maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/SessionEvent.java
Thu Sep  6 23:50:32 2007
@@ -178,4 +178,58 @@
         this.exception = exception;
     }
 
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "SessionEvent[" );
+
+        switch ( this.eventType )
+        {
+            case SessionEvent.SESSION_CLOSED:
+                sb.append( "CONNECTION_CLOSED" );
+                break;
+            case SessionEvent.SESSION_DISCONNECTED:
+                sb.append( "CONNECTION_DISCONNECTED" );
+                break;
+            case SessionEvent.SESSION_DISCONNECTING:
+                sb.append( "CONNECTION_DISCONNECTING" );
+                break;
+            case SessionEvent.SESSION_ERROR_OCCURRED:
+                sb.append( "CONNECTION_ERROR_OCCURRED" );
+                break;
+            case SessionEvent.SESSION_LOGGED_IN:
+                sb.append( "CONNECTION_LOGGED_IN" );
+                break;
+            case SessionEvent.SESSION_LOGGED_OFF:
+                sb.append( "CONNECTION_LOGGED_OFF" );
+                break;
+            case SessionEvent.SESSION_OPENED:
+                sb.append( "CONNECTION_OPENED" );
+                break;
+            case SessionEvent.SESSION_OPENING:
+                sb.append( "CONNECTION_OPENING" );
+                break;
+            case SessionEvent.SESSION_CONNECTION_REFUSED:
+                sb.append( "CONNECTION_CONNECTION_REFUSED" );
+                break;
+            default:
+                sb.append( eventType );
+        }
+        sb.append( "|" );
+
+        sb.append( this.repository ).append( "|" );
+        sb.append( this.source );
+
+        if ( exception != null )
+        {
+            sb.append( "|" );
+            sb.append( exception.getClass().getName() ).append( ":" );
+            sb.append( exception.getMessage() );
+        }
+
+        sb.append( "]" );
+
+        return sb.toString();
+    }
 }

Modified: maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java
URL: http://svn.apache.org/viewvc/maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java?rev=573479&r1=573478&r2=573479&view=diff
==============================================================================
--- maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java
(original)
+++ maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/events/TransferEvent.java
Thu Sep  6 23:50:32 2007
@@ -207,4 +207,56 @@
     {
         this.localFile = localFile;
     }
+
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "TransferEvent[" );
+
+        switch ( this.getRequestType() )
+        {
+            case REQUEST_GET:
+                sb.append( "GET" );
+                break;
+            case REQUEST_PUT:
+                sb.append( "PUT" );
+                break;
+            default:
+                sb.append( this.getRequestType() );
+                break;
+        }
+
+        sb.append( "|" );
+        switch ( this.getEventType() )
+        {
+            case TRANSFER_COMPLETED:
+                sb.append( "COMPLETED" );
+                break;
+            case TRANSFER_ERROR:
+                sb.append( "ERROR" );
+                break;
+            case TRANSFER_INITIATED:
+                sb.append( "INITIATED" );
+                break;
+            case TRANSFER_PROGRESS:
+                sb.append( "PROGRESS" );
+                break;
+            case TRANSFER_STARTED:
+                sb.append( "STARTED" );
+                break;
+            default:
+                sb.append( this.getEventType() );
+                break;
+        }
+
+        sb.append( "|" );
+
+        sb.append( this.repository ).append( "|" );
+        sb.append( this.getLocalFile() ).append( "|" );
+        sb.append( this.getResource() );
+        sb.append( "]" );
+
+        return sb.toString();
+    }
 }

Modified: maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java
URL: http://svn.apache.org/viewvc/maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java?rev=573479&r1=573478&r2=573479&view=diff
==============================================================================
--- maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java
(original)
+++ maven/wagon/branches/wagon-1.x/wagon-provider-api/src/main/java/org/apache/maven/wagon/repository/Repository.java
Thu Sep  6 23:50:32 2007
@@ -21,6 +21,7 @@
 
 import org.apache.maven.wagon.PathUtils;
 import org.apache.maven.wagon.WagonConstants;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.io.Serializable;
 import java.util.Properties;
@@ -197,12 +198,19 @@
 
     public String toString()
     {
-        if ( getName() != null )
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "Repository[" );
+
+        if ( StringUtils.isNotEmpty( getName() ) )
         {
-            return "[" + getName() + "] -> " + getUrl();
+            sb.append( getName() ).append( "|" );
         }
 
-        return getUrl();
+        sb.append( getUrl() );
+        sb.append( "]" );
+
+        return sb.toString();
     }
 
     public String getProtocol()

Modified: maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/PutInputStream.java
URL: http://svn.apache.org/viewvc/maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/PutInputStream.java?rev=573479&r1=573478&r2=573479&view=diff
==============================================================================
--- maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/PutInputStream.java
(original)
+++ maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/PutInputStream.java
Thu Sep  6 23:50:32 2007
@@ -34,6 +34,7 @@
  * notify the listeners of transfer events on a put request.
  * 
  * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @todo move to wagon-providers-api
  */
 public class PutInputStream
     extends FileInputStream

Modified: maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java?rev=573479&r1=573478&r2=573479&view=diff
==============================================================================
--- maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java
(original)
+++ maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/main/java/org/apache/maven/wagon/providers/webdav/WebDavWagon.java
Thu Sep  6 23:50:32 2007
@@ -61,16 +61,15 @@
 
 /**
  * <p>WebDavWagon</p>
- * 
+ * <p/>
  * <p>Allows using a webdav remote repository for downloads and deployments</p>
- * 
+ *
  * @author <a href="mailto:hisidro@exist.com">Henry Isidro</a>
  * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
  * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
- * 
- * @plexus.component role="org.apache.maven.wagon.Wagon" 
- *   role-hint="dav"
- *   instantiation-strategy="per-lookup"
+ * @plexus.component role="org.apache.maven.wagon.Wagon"
+ * role-hint="dav"
+ * instantiation-strategy="per-lookup"
  */
 public class WebDavWagon
     extends AbstractWagon
@@ -113,8 +112,8 @@
 
     /**
      * Opens a connection via web-dav resource
-     * 
-     * @throws AuthenticationException 
+     *
+     * @throws AuthenticationException
      * @throws ConnectionException
      */
     public void openConnection()
@@ -149,8 +148,7 @@
 
             if ( hasProxy )
             {
-                
-                
+
                 webdavResource.setProxy( proxyInfo.getHost(), proxyInfo.getPort() );
                 if ( !StringUtils.isEmpty( proxyInfo.getUserName() ) )
                 {
@@ -163,8 +161,8 @@
         }
         catch ( HttpException he )
         {
-            throw new ConnectionException( "Connection Exception: " + url + " " + he.getReasonCode()
+ " "
-                + HttpStatus.getStatusText( he.getReasonCode() ), he );
+            throw new ConnectionException( "Connection Exception: " + url + " " + he.getReasonCode()
+ " " +
+                HttpStatus.getStatusText( he.getReasonCode() ), he );
         }
         catch ( URIException urie )
         {
@@ -178,8 +176,8 @@
 
     /**
      * Closes the connection
-     * 
-     * @throws ConnectionException 
+     *
+     * @throws ConnectionException
      */
     public void closeConnection()
         throws ConnectionException
@@ -204,7 +202,7 @@
     /**
      * Puts a file into the remote repository
      *
-     * @param source the file to transfer
+     * @param source       the file to transfer
      * @param resourceName the name of the resource
      * @throws TransferFailedException
      * @throws ResourceDoesNotExistException
@@ -257,7 +255,7 @@
 
                 case HttpStatus.SC_NOT_FOUND:
                     // should never happen as the destination is created before or fail
-                    throw new TransferFailedException( "Destination does not exist: " + repository.getUrl()
);
+                    throw new TransferFailedException( "Destination folder could not be created:
" + dest );
 
                 case HttpStatus.SC_LENGTH_REQUIRED:
                     throw new TransferFailedException( "Transfer failed, server requires
Content-Length." );
@@ -266,8 +264,8 @@
                 default:
                     if ( !success )
                     {
-                        throw new TransferFailedException( "Failed to transfer file: " +
dest + ". Return code is: "
-                            + statusCode + " " + HttpStatus.getStatusText( statusCode ) );
+                        throw new TransferFailedException( "Failed to transfer file: " +
dest + ". Return code is: " +
+                            statusCode + " " + HttpStatus.getStatusText( statusCode ) );
                     }
             }
         }
@@ -311,11 +309,10 @@
             {
                 webdavResource.setPath( currentPath );
 
-                // set basic properties like 'resourcetype' so we can query for
-                // exists() and isCollection()
+                /* needed to call webdavResource.exists() later */
                 try
                 {
-                    webdavResource.setProperties( WebdavResource.BASIC, DepthSupport.DEPTH_0
);
+                    webdavResource.setProperties( WebdavResource.NAME, DepthSupport.DEPTH_0
);
                 }
                 catch ( HttpException e )
                 {
@@ -332,8 +329,8 @@
                     else
                     {
                         throw new TransferFailedException(
-                                                           "Destination path exists and is
not a WebDAV collection (directory): "
-                                                               + webdavResource.toString()
);
+                            "Destination path exists and is not a WebDAV collection (directory):
" +
+                                webdavResource.toString() );
                     }
                 }
 
@@ -350,6 +347,11 @@
             while ( !directoriesToBeCreated.empty() )
             {
                 currentPath = (String) directoriesToBeCreated.pop();
+                if ( currentPath.equals( "/" ) )
+                {
+                    /* Impossible to create root directory, skip */
+                    continue;
+                }
                 webdavResource.setPath( currentPath );
 
                 try
@@ -357,14 +359,16 @@
                     boolean destinationCreated = webdavResource.mkcolMethod( currentPath
);
                     if ( !destinationCreated )
                     {
-                        throw new TransferFailedException( "Destination folder could not
be created: "
-                            + webdavResource.toString() );
+                        throw new TransferFailedException( "Destination folder [" + currentPath
+
+                            "] could not be created: " + webdavResource.toString() + " -
Server returned error: " +
+                            webdavResource.getStatusCode() + ": " +
+                            HttpStatus.getStatusText( webdavResource.getStatusCode() ) );
                     }
                 }
                 catch ( IOException e )
                 {
-                    throw new TransferFailedException( "Failed to create destination WebDAV
collection (directory): "
-                        + webdavResource.toString(), e );
+                    throw new TransferFailedException( "Failed to create destination WebDAV
collection (directory) [" +
+                        currentPath + "]: " + webdavResource.toString(), e );
                 }
             }
 
@@ -373,14 +377,14 @@
         }
         catch ( HttpException e )
         {
-            throw new TransferFailedException( "Unknown error creating destination WebDAV
collection (directory): "
-                + webdavResource.toString() + ". Server returned error: "
-                + HttpStatus.getStatusText( e.getReasonCode() ), e );
+            throw new TransferFailedException( "Unknown error creating destination WebDAV
collection (directory): " +
+                webdavResource.toString() + ". Server returned error: " + HttpStatus.getStatusText(
e.getReasonCode() ),
+                                               e );
         }
         catch ( IOException e )
         {
-            throw new TransferFailedException( "Unknown error creating destination WebDAV
collection (directory): "
-                + webdavResource.toString(), e );
+            throw new TransferFailedException(
+                "Unknown error creating destination WebDAV collection (directory): " + webdavResource.toString(),
e );
         }
     }
 
@@ -406,10 +410,10 @@
 
     /**
      * Determine which URI to use at the prompt.
-     * @see FileUtils#normalize(String)
      *
      * @param uri the path to be set.
      * @return the normalized path.
+     * @see FileUtils#normalize(String)
      */
     private String checkUri( String uri )
         throws IOException
@@ -443,10 +447,10 @@
 
     /**
      * Get a file from remote server
-     * 
+     *
      * @param resourceName
      * @param destination
-     * @param timestamp the timestamp to check against, only downloading if newer. If <code>0</code>,
always download
+     * @param timestamp    the timestamp to check against, only downloading if newer. If
<code>0</code>, always download
      * @return <code>true</code> if newer version was downloaded, <code>false</code>
otherwise.
      * @throws TransferFailedException
      * @throws ResourceDoesNotExistException
@@ -485,8 +489,8 @@
         catch ( HttpException e )
         {
             fireTransferError( resource, e, TransferEvent.REQUEST_GET );
-            throw new TransferFailedException( "Failed to transfer file: " + url + ".  Return
code is: "
-                + e.getReasonCode(), e );
+            throw new TransferFailedException(
+                "Failed to transfer file: " + url + ".  Return code is: " + e.getReasonCode(),
e );
         }
         catch ( IOException e )
         {
@@ -521,8 +525,8 @@
                     throw new ResourceDoesNotExistException( "File: " + url + " does not
exist" );
 
                 default:
-                    throw new TransferFailedException( "Failed to transfer file: " + url
+ ". Return code is: "
-                        + statusCode, e );
+                    throw new TransferFailedException(
+                        "Failed to transfer file: " + url + ". Return code is: " + statusCode,
e );
             }
         }
         finally
@@ -554,8 +558,8 @@
                 throw new ResourceDoesNotExistException( "File: " + url + " does not exist"
);
 
             default:
-                throw new TransferFailedException( "Failed to transfer file: " + url + ".
Return code is: "
-                    + statusCode );
+                throw new TransferFailedException(
+                    "Failed to transfer file: " + url + ". Return code is: " + statusCode
);
         }
 
     }
@@ -576,7 +580,7 @@
 
     /**
      * This wagon supports directory copying
-     * 
+     *
      * @return <code>true</code> always
      */
     public boolean supportsDirectoryCopy()
@@ -586,8 +590,8 @@
 
     /**
      * Copy a directory from local system to remote webdav server
-     * 
-     * @param sourceDirectory the local directory
+     *
+     * @param sourceDirectory      the local directory
      * @param destinationDirectory the remote destination
      * @throws TransferFailedException
      * @throws ResourceDoesNotExistException
@@ -658,8 +662,8 @@
 
                 if ( !webdavResource.isCollection() )
                 {
-                    throw new ResourceDoesNotExistException( "Destination path exists but
is not a "
-                        + "WebDAV collection (directory): " + cdpath );
+                    throw new ResourceDoesNotExistException(
+                        "Destination path exists but is not a " + "WebDAV collection (directory):
" + cdpath );
                 }
 
                 String[] entries = webdavResource.list();
@@ -680,8 +684,8 @@
                 }
                 else
                 {
-                    throw new TransferFailedException( "Unable to obtain file list from WebDAV
collection, "
-                        + "HTTP error: " + HttpStatus.getStatusText( e.getReasonCode() ),
e );
+                    throw new TransferFailedException( "Unable to obtain file list from WebDAV
collection, " +
+                        "HTTP error: " + HttpStatus.getStatusText( e.getReasonCode() ), e
);
                 }
             }
             finally

Modified: maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavWagonTest.java
URL: http://svn.apache.org/viewvc/maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavWagonTest.java?rev=573479&r1=573478&r2=573479&view=diff
==============================================================================
--- maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavWagonTest.java
(original)
+++ maven/wagon/branches/wagon-1.x/wagon-providers/wagon-webdav/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavWagonTest.java
Thu Sep  6 23:50:32 2007
@@ -19,16 +19,16 @@
  * under the License.
  */
 
-import java.io.File;
-import java.io.IOException;
-
 import org.apache.maven.wagon.FileTestUtils;
 import org.apache.maven.wagon.TransferFailedException;
 import org.apache.maven.wagon.WagonTestCase;
 
+import java.io.File;
+import java.io.IOException;
+
 /**
- * WebDAV Wagon Test 
- * 
+ * WebDAV Wagon Test
+ *
  * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
  * @author <a href="mailto:carlos@apache.org">Carlos Sanchez</a>
  */
@@ -90,8 +90,8 @@
         }
         catch ( TransferFailedException e )
         {
-            assertEquals( "Exception message doesn't match expected", "Destination folder
could not be created: " + url
-                + "/", e.getMessage() );
+            assertEquals( "Exception message doesn't match expected",
+                          "Destination folder could not be created: " + url + "/test-resource",
e.getMessage() );
         }
 
         testRepository.setUrl( getTestRepositoryUrl() );



---------------------------------------------------------------------
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