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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user