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;
            
            // 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
         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);
     }
     
 
             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;