maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r528237 - /maven/wagon/trunk/wagon-providers/wagon-ftp/src/main/java/org/apache/maven/wagon/providers/ftp/FtpWagon.java
Date Thu, 12 Apr 2007 21:07:01 GMT
Author: carlos
Date: Thu Apr 12 14:07:00 2007
New Revision: 528237

URL: http://svn.apache.org/viewvc?view=rev&rev=528237
Log:
[WAGONFTP-17] Show errors in case that username or password is not defined

Modified:
    maven/wagon/trunk/wagon-providers/wagon-ftp/src/main/java/org/apache/maven/wagon/providers/ftp/FtpWagon.java

Modified: maven/wagon/trunk/wagon-providers/wagon-ftp/src/main/java/org/apache/maven/wagon/providers/ftp/FtpWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-ftp/src/main/java/org/apache/maven/wagon/providers/ftp/FtpWagon.java?view=diff&rev=528237&r1=528236&r2=528237
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-ftp/src/main/java/org/apache/maven/wagon/providers/ftp/FtpWagon.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-ftp/src/main/java/org/apache/maven/wagon/providers/ftp/FtpWagon.java
Thu Apr 12 14:07:00 2007
@@ -85,6 +85,15 @@
 
         String password = authInfo.getPassword();
 
+        if ( username == null )
+        {
+            throw new AuthenticationException( "Username not specified for repository " +
getRepository().getId() );
+        }
+        if ( password == null )
+        {
+            throw new AuthenticationException( "Password not specified for repository " +
getRepository().getId() );
+        }
+
         String host = getRepository().getHost();
 
         ftp = new FTPClient();
@@ -145,7 +154,7 @@
 
         try
         {
-            if ( !ftp.login( username.trim(), password.trim() ) )
+            if ( !ftp.login( username, password ) )
             {
                 fireSessionConnectionRefused();
 



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