X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/7a9149a66ab8caffbec4f0eaf46cd5615e19e1e4..fe4fc7a61283b74a89f3586d51363ca32cd59db0:/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java diff --git a/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java b/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java index c6703161..b817e724 100644 --- a/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java +++ b/src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java @@ -64,14 +64,17 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation { } private Context mContext; + private String mWebDavUrl; /** * Constructor * * @param context Android context of the caller. + * @param webdavUrl */ - public DetectAuthenticationMethodOperation(Context context) { + public DetectAuthenticationMethodOperation(Context context, String webdavUrl) { mContext = context; + mWebDavUrl = webdavUrl; } @@ -90,6 +93,7 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation { AuthenticationMethod authMethod = AuthenticationMethod.UNKNOWN; RemoteOperation operation = new ExistenceCheckRemoteOperation("", mContext, false); + client.setWebdavUri(Uri.parse(mWebDavUrl)); client.setBasicCredentials("", ""); client.setFollowRedirects(false); @@ -122,6 +126,9 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation { // else - fall back to UNKNOWN Log.d(TAG, "Authentication method found: " + authenticationMethodToString(authMethod)); + if (!authMethod.equals(AuthenticationMethod.UNKNOWN)) { + result = new RemoteOperationResult(true, result.getHttpCode(), null); + } ArrayList data = new ArrayList(); data.add(authMethod); result.setData(data);