aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableFileCache.java
diff options
context:
space:
mode:
authorAdithya Abraham Philip <adithyaphilip@gmail.com>2015-03-19 20:31:34 +0530
committerAdithya Abraham Philip <adithyaphilip@gmail.com>2015-03-23 15:34:22 +0530
commit19775c399b106149e8906a7482a4b5a4af2ac8fa (patch)
tree6741a8820aaa29adaa05cbfc05cd8f51f0d826b1 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableFileCache.java
parent208434087fe9eb7bd88d491bb14db05e702d7845 (diff)
downloadopen-keychain-19775c399b106149e8906a7482a4b5a4af2ac8fa.tar.gz
open-keychain-19775c399b106149e8906a7482a4b5a4af2ac8fa.tar.bz2
open-keychain-19775c399b106149e8906a7482a4b5a4af2ac8fa.zip
introduced multi-threading
refactored oldKeys to updatedKeys added update all keys, ThreadPoolExecutor used modified CachedThreadPoolExecutor
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableFileCache.java')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableFileCache.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableFileCache.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableFileCache.java
index 6f9cb277e..5a314ad0b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableFileCache.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/ParcelableFileCache.java
@@ -83,10 +83,22 @@ public class ParcelableFileCache<E extends Parcelable> {
}
+ /**
+ * Reads from cache file and deletes it afterward. Convenience function for readCache(boolean).
+ * @return an IteratorWithSize object containing entries read from the cache file
+ * @throws IOException
+ */
public IteratorWithSize<E> readCache() throws IOException {
return readCache(true);
}
+ /**
+ * Reads entries from a cache file and returns an IteratorWithSize object containing the entries
+ * @param deleteAfterRead if true, the cache file will be deleted after being read
+ * @return an IteratorWithSize object containing entries read from the cache file
+ * @throws IOException if cache directory/parcel import file does not exist, or a read error
+ * occurs
+ */
public IteratorWithSize<E> readCache(final boolean deleteAfterRead) throws IOException {
File cacheDir = mContext.getCacheDir();