X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/06d5cc94778ee4fe5ec49cd9061c039283ea7cdc..ff82b51e49f40155e7c340090f5ee759af2bf3ad:/src/com/owncloud/android/operations/GetServerInfoOperation.java diff --git a/src/com/owncloud/android/operations/GetServerInfoOperation.java b/src/com/owncloud/android/operations/GetServerInfoOperation.java index 712e7d5c..1b4b7a9b 100644 --- a/src/com/owncloud/android/operations/GetServerInfoOperation.java +++ b/src/com/owncloud/android/operations/GetServerInfoOperation.java @@ -23,7 +23,6 @@ package com.owncloud.android.operations; import java.util.ArrayList; -import com.owncloud.android.MainApp; import com.owncloud.android.authentication.AccountUtils; import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.operations.RemoteOperation; @@ -79,7 +78,7 @@ public class GetServerInfoOperation extends RemoteOperation { // first: check the status of the server (including its version) GetRemoteStatusOperation getStatus = new GetRemoteStatusOperation(mContext); - RemoteOperationResult result = getStatus.execute(client, MainApp.getUserAgent()); + RemoteOperationResult result = getStatus.execute(client); if (result.isSuccess()) { // second: get authentication method required by the server @@ -107,7 +106,7 @@ public class GetServerInfoOperation extends RemoteOperation { Log_OC.d(TAG, "Trying empty authorization to detect authentication method"); DetectAuthenticationMethodOperation operation = new DetectAuthenticationMethodOperation(mContext); - return operation.execute(client, MainApp.getUserAgent()); + return operation.execute(client); } @@ -118,12 +117,8 @@ public class GetServerInfoOperation extends RemoteOperation { if (url.endsWith("/")) { url = url.substring(0, url.length() - 1); } - if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_4_0)){ - url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_4_0.length()); - } else if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_2_0)){ - url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_2_0.length()); - } else if (url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_1_2)){ - url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_1_2.length()); + if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_4_0_AND_LATER)){ + url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_4_0_AND_LATER.length()); } } return url;