1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-22 05:43:02 +00:00

Added OwnCloudAccount class and method OwnCloudSessionManager#gertClientFor(OwnCloudAccount, ...) to ease the reuse of OwnCloudClient instances after creating accounts with authentication based in external authentication providers

This commit is contained in:
David A. Velasco
2014-06-12 16:36:24 +02:00
parent a42f6b5d6d
commit e069a8cb9f
10 changed files with 196 additions and 2 deletions
@@ -37,6 +37,7 @@ import android.accounts.AccountsException;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.content.Context;
import android.net.Uri;
public class AccountUtils {
public static final String WEBDAV_PATH_1_2 = "/webdav/owncloud.php";
@@ -185,6 +186,15 @@ public class AccountUtils {
return credentials;
}
public static String buildAccountName(Uri serverBaseUrl, String username) {
String accountName = username + "@" + serverBaseUrl.getHost();
if (serverBaseUrl.getPort() >= 0) {
accountName += ":" + serverBaseUrl.getPort();
}
return accountName;
}
public static class AccountNotFoundException extends AccountsException {