X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/4984d909f21ca2eb45d730b280249578cb766a06..20583912301fc6b0ec069ebfeeba50d52d435183:/src/com/owncloud/android/files/services/IndexedForest.java diff --git a/src/com/owncloud/android/files/services/IndexedForest.java b/src/com/owncloud/android/files/services/IndexedForest.java index e2e9cb85..f3c38fdd 100644 --- a/src/com/owncloud/android/files/services/IndexedForest.java +++ b/src/com/owncloud/android/files/services/IndexedForest.java @@ -21,8 +21,11 @@ import android.accounts.Account; import android.util.Pair; import com.owncloud.android.datamodel.OCFile; +import com.owncloud.android.lib.common.utils.Log_OC; +import com.owncloud.android.operations.UploadFileOperation; import java.io.File; +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.Set; @@ -210,6 +213,21 @@ public class IndexedForest { } + public ConcurrentMap> get(Account account){ + ConcurrentMap> accountMap = new ConcurrentHashMap>(); + Iterator it = mMap.keySet().iterator(); + while (it.hasNext()) { + String key = it.next(); + Log_OC.d("IndexedForest", "Number of pending downloads= " + mMap.size()); + if (key.startsWith(account.name)) { + synchronized (accountMap) { + accountMap.putIfAbsent(key, mMap.get(key)); + } + } + } + return accountMap; + } + /** * Builds a key to index files *