X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/261aaf50019732a4e766d6b3e9e07576a64f5504..bb257ec72911fa0418c7093863bac51d589419fa:/src/com/owncloud/android/network/OwnCloudClientUtils.java diff --git a/src/com/owncloud/android/network/OwnCloudClientUtils.java b/src/com/owncloud/android/network/OwnCloudClientUtils.java index 9cbc3fdc..efbc81f3 100644 --- a/src/com/owncloud/android/network/OwnCloudClientUtils.java +++ b/src/com/owncloud/android/network/OwnCloudClientUtils.java @@ -1,5 +1,5 @@ /* ownCloud Android client application - * Copyright (C) 2011 Bartek Przybylski + * Copyright (C) 2012-2013 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -38,8 +38,6 @@ import org.apache.http.conn.ssl.BrowserCompatHostnameVerifier; import org.apache.http.conn.ssl.X509HostnameVerifier; import com.owncloud.android.AccountUtils; -import com.owncloud.android.authenticator.AccountAuthenticator; -import com.owncloud.android.utils.OwnCloudVersion; import eu.alefzero.webdav.WebdavClient; @@ -79,11 +77,8 @@ public class OwnCloudClientUtils { public static WebdavClient createOwnCloudClient (Account account, Context context) { Log.d(TAG, "Creating WebdavClient associated to " + account.name); - String baseUrl = AccountManager.get(context).getUserData(account, AccountAuthenticator.KEY_OC_BASE_URL); - OwnCloudVersion ownCloudVersion = new OwnCloudVersion(AccountManager.get(context).getUserData(account, AccountAuthenticator.KEY_OC_VERSION)); - String webDavPath = AccountUtils.getWebdavPath(ownCloudVersion); - - WebdavClient client = createOwnCloudClient(Uri.parse(baseUrl + webDavPath), context); + Uri uri = Uri.parse(AccountUtils.constructFullURLForAccount(context, account)); + WebdavClient client = createOwnCloudClient(uri, context); String username = account.name.substring(0, account.name.lastIndexOf('@')); String password = AccountManager.get(context).getPassword(account);