Merge branch 'develop' into setup_buttons
[pub/Android/ownCloud.git] / src / com / owncloud / android / syncadapter / AbstractOwnCloudSyncAdapter.java
index 92c0b72..4773099 100644 (file)
@@ -1,10 +1,10 @@
 /* ownCloud Android client application\r
  *   Copyright (C) 2011  Bartek Przybylski\r
+ *   Copyright (C) 2012-2013 ownCloud Inc.\r
  *\r
  *   This program is free software: you can redistribute it and/or modify\r
- *   it under the terms of the GNU General Public License as published by\r
- *   the Free Software Foundation, either version 3 of the License, or\r
- *   (at your option) any later version.\r
+ *   it under the terms of the GNU General Public License version 2,\r
+ *   as published by the Free Software Foundation.\r
  *\r
  *   This program is distributed in the hope that it will be useful,\r
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
@@ -19,7 +19,6 @@
 package com.owncloud.android.syncadapter;\r
 \r
 import java.io.IOException;\r
-import java.net.UnknownHostException;\r
 import java.util.Date;\r
 \r
 import org.apache.http.HttpRequest;\r
@@ -28,10 +27,12 @@ import org.apache.http.client.ClientProtocolException;
 import org.apache.http.conn.ConnectionKeepAliveStrategy;\r
 import org.apache.http.protocol.HttpContext;\r
 \r
-import com.owncloud.android.AccountUtils;\r
+import com.owncloud.android.authentication.AccountUtils;\r
+import com.owncloud.android.authentication.AccountUtils.AccountNotFoundException;\r
 import com.owncloud.android.datamodel.DataStorageManager;\r
 import com.owncloud.android.network.OwnCloudClientUtils;\r
 \r
+\r
 import android.accounts.Account;\r
 import android.accounts.AccountManager;\r
 import android.accounts.AuthenticatorException;\r
@@ -142,10 +143,8 @@ public abstract class AbstractOwnCloudSyncAdapter extends
         return null;\r
     }\r
 \r
-    protected void initClientForCurrentAccount() throws UnknownHostException {\r
-        if (AccountUtils.constructFullURLForAccount(getContext(), account) == null) {\r
-            throw new UnknownHostException();\r
-        }\r
+    protected void initClientForCurrentAccount() throws OperationCanceledException, AuthenticatorException, IOException, AccountNotFoundException {\r
+        AccountUtils.constructFullURLForAccount(getContext(), account);\r
         mClient = OwnCloudClientUtils.createOwnCloudClient(account, getContext());\r
     }\r
     \r