commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r437653 - in /jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs: provider/smb/SmbFileObject.java util/UserAuthenticatorUtils.java
Date Mon, 28 Aug 2006 11:02:02 GMT
Author: imario
Date: Mon Aug 28 04:02:01 2006
New Revision: 437653

URL: http://svn.apache.org/viewvc?rev=437653&view=rev
Log:
smb: fixed problem with usage of username as password with UserAuthenticator
UserAuthenticator: changed usage of "defaultValue" to "overwriddenValue" so any information
available on the url will override the value returned by the UserAuthenticator

Thanks to Gabriele Bulfon for pointing this out

Modified:
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/smb/SmbFileObject.java
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/UserAuthenticatorUtils.java

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/smb/SmbFileObject.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/smb/SmbFileObject.java?rev=437653&r1=437652&r2=437653&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/smb/SmbFileObject.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/smb/SmbFileObject.java
Mon Aug 28 04:02:01 2006
@@ -100,7 +100,7 @@
 				UserAuthenticatorUtils.toString(
 					UserAuthenticatorUtils.getData(
 						authData,
-						UserAuthenticationData.USERNAME,
+						UserAuthenticationData.PASSWORD,
 						UserAuthenticatorUtils.toChar(smbFileName.getPassword()))));
 
 			file = new SmbFile(path, auth);

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/UserAuthenticatorUtils.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/UserAuthenticatorUtils.java?rev=437653&r1=437652&r2=437653&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/UserAuthenticatorUtils.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/util/UserAuthenticatorUtils.java
Mon Aug 28 04:02:01 2006
@@ -28,20 +28,19 @@
 	/**
 	 * gets data of given type from the UserAuthenticationData or null if there is no data or
data of this type available
 	 */
-	public static char[] getData(UserAuthenticationData data, UserAuthenticationData.Type type,
char[] defaultValue)
+	public static char[] getData(UserAuthenticationData data, UserAuthenticationData.Type type,
char[] overwriddenValue)
 	{
-		if (data == null)
-		{
-			return defaultValue;
-		}
+        if (overwriddenValue != null)
+        {
+            return overwriddenValue;
+        }
 
-		char[] ret = data.getData(type);
-		if (ret == null)
+        if (data == null)
 		{
-			return defaultValue;
+			return null;
 		}
 
-		return ret;
+		return data.getData(type);
 	}
 
 	/**



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