commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r453502 - /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
Date Fri, 06 Oct 2006 05:37:22 GMT
Author: imario
Date: Thu Oct  5 22:37:21 2006
New Revision: 453502

URL: http://svn.apache.org/viewvc?view=rev&rev=453502
Log:
VFS-93: fixed NPE with urls without password

Modified:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java?view=diff&rev=453502&r1=453501&r2=453502
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
Thu Oct  5 22:37:21 2006
@@ -131,14 +131,17 @@
             session = jsch.getSession(new String(username),
                     hostname,
                     port);
-            session.setPassword(new String(password));
+            if (password != null)
+            {
+                session.setPassword(new String(password));
+            }
 
             Integer timeout = SftpFileSystemConfigBuilder.getInstance().getTimeout(fileSystemOptions);
             if (timeout != null)
             {
             	session.setTimeout(timeout.intValue());
             }
-            
+
             UserInfo userInfo = SftpFileSystemConfigBuilder.getInstance().getUserInfo(fileSystemOptions);
             if (userInfo != null)
             {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message