Merge pull request #1088 from owncloud/updated_docs_about_target_of_PRs
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / GetServerInfoOperation.java
index 712e7d5..1b4b7a9 100644 (file)
@@ -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;