X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/a4ba6170ea7696e085b07adfef73eeb8b77cb8e2..5fc7cd13e7e561ef528e12d2fa088b58e35e00d0:/src/com/owncloud/android/syncadapter/AbstractOwnCloudSyncAdapter.java diff --git a/src/com/owncloud/android/syncadapter/AbstractOwnCloudSyncAdapter.java b/src/com/owncloud/android/syncadapter/AbstractOwnCloudSyncAdapter.java index e8b1fcb2..878c6961 100644 --- a/src/com/owncloud/android/syncadapter/AbstractOwnCloudSyncAdapter.java +++ b/src/com/owncloud/android/syncadapter/AbstractOwnCloudSyncAdapter.java @@ -28,8 +28,9 @@ import org.apache.http.client.ClientProtocolException; import org.apache.http.conn.ConnectionKeepAliveStrategy; import org.apache.http.protocol.HttpContext; -import com.owncloud.android.authenticator.AccountAuthenticator; +import com.owncloud.android.AccountUtils; import com.owncloud.android.datamodel.DataStorageManager; +import com.owncloud.android.network.OwnCloudClientUtils; import android.accounts.Account; import android.accounts.AccountManager; @@ -143,20 +144,16 @@ public abstract class AbstractOwnCloudSyncAdapter extends } protected Uri getUri() { - return Uri.parse(this.getAccountManager().getUserData(getAccount(), - AccountAuthenticator.KEY_OC_URL)); + return Uri.parse(AccountUtils.constructFullURLForAccount(getContext(), getAccount())); } - protected WebdavClient getClient() throws OperationCanceledException, - AuthenticatorException, IOException { + protected WebdavClient getClient() throws /*OperationCanceledException, + AuthenticatorException,*/ IOException { if (mClient == null) { - if (this.getAccountManager().getUserData(getAccount(), - AccountAuthenticator.KEY_OC_URL) == null) { + if (AccountUtils.constructFullURLForAccount(getContext(), getAccount()) == null) { throw new UnknownHostException(); } - mClient = new WebdavClient(account, getContext()); - mClient.allowSelfsignedCertificates(); - // mHost = mClient.getTargetHost(); + mClient = OwnCloudClientUtils.createOwnCloudClient(account, getContext()); } return mClient;