X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/83ad608faadfcfc5a0ceee9d6c460702b3ff3f11..e3a61d283fdd1a89cac30faacbba1863dd2907a7:/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 66c2d437..c40cece3 100644 --- a/src/com/owncloud/android/files/services/IndexedForest.java +++ b/src/com/owncloud/android/files/services/IndexedForest.java @@ -22,10 +22,8 @@ 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; @@ -213,17 +211,19 @@ public class IndexedForest { } - public ConcurrentMap> get(Account account){ - ConcurrentMap> accountMap = new ConcurrentHashMap>(); + /** + * Remove the elements that contains account as a part of its key + * @param account + */ + public void remove(Account account){ 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)) { - accountMap.putIfAbsent(key, mMap.get(key)); + mMap.remove(key); } } - return accountMap; } /** @@ -236,6 +236,4 @@ public class IndexedForest { return account.name + remotePath; } - - }