-
-
- /**
- * Performs the next operation in the queue
- */
- private void doOperation(Account account, String remotePath) {
-
- String syncKey = buildRemoteName(account,remotePath);
-
- synchronized(mPendingOperations) {
- mCurrentSyncOperation = mPendingOperations.get(syncKey);
- }
-
- if (mCurrentSyncOperation != null) {
-
- try {
-
- OwnCloudAccount ocAccount = new OwnCloudAccount(account, mService);
- mOwnCloudClient = OwnCloudClientManagerFactory.getDefaultSingleton().
- getClientFor(ocAccount, mService);
- mStorageManager = new FileDataStorageManager(
- account,
- mService.getContentResolver()
- );
-
- mCurrentSyncOperation.execute(mOwnCloudClient, mStorageManager);
-
- } catch (AccountsException e) {
- Log_OC.e(TAG, "Error while trying to get autorization", e);
- } catch (IOException e) {
- Log_OC.e(TAG, "Error while trying to get autorization", e);
- } finally {
- synchronized(mPendingOperations) {
- mPendingOperations.remove(syncKey);
- }
- }
- }
- }
-
- public void add(Account account, String remotePath, SynchronizeFolderOperation syncFolderOperation){
- String syncKey = buildRemoteName(account,remotePath);
- mPendingOperations.putIfAbsent(syncKey,syncFolderOperation);
- }
-
-