1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00
android-library/src/com/owncloud/android/lib/common/SimpleFactoryManager.java

73 lines
2.0 KiB
Java

package com.owncloud.android.lib.common;
import android.accounts.Account;
import android.accounts.AuthenticatorException;
import android.accounts.OperationCanceledException;
import android.content.Context;
import android.net.Uri;
import android.util.Log;
import com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException;
public class SimpleFactoryManager implements OwnCloudClientManager {
private static final String TAG = SimpleFactoryManager.class.getSimpleName();
@Override
public OwnCloudClient getClientFor(OwnCloudAccount account, Context context) {
Log.d(TAG, "getClientFor(OwnCloudAccount ... : ");
OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(
account.getBaseUri(),
context.getApplicationContext(),
true);
Log.d(TAG, " new client " + client.hashCode());
client.setCredentials(account.getCredentials());
return client;
}
/*
@Override
public OwnCloudClient getClientFor(Account savedAccount, Context context)
throws OperationCanceledException, AuthenticatorException, AccountNotFoundException,
IOException {
Log.d(TAG, "getClientFor(Account ... : ");
OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(
savedAccount,
context.getApplicationContext());
Log.d(TAG, " new client " + client.hashCode());
return client;
}
@Override
public OwnCloudClient getClientFor(Uri serverBaseUri, OwnCloudCredentials credentials,
Context context) {
Log.d(TAG, "getClientFor(Uri ... : ");
OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(
serverBaseUri,
context.getApplicationContext(),
true);
client.setCredentials(credentials);
Log.d(TAG, " new client " + client.hashCode());
return client;
}
*/
@Override
public void saveAllClients(Context context, String accountType) {
// TODO Auto-generated method stub
}
@Override
public OwnCloudClient removeClientFor(Account account, Context context) {
return null;
}
}