diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-08-17 00:49:14 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-08-17 00:49:14 +0200 |
commit | aa625d4fbf8cf97de5a81675d55e4ac004ef5f11 (patch) | |
tree | ffcfaf4beef0779407b651188604868ea24106a1 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util | |
parent | c00343d516f1afc2d4e062d30eba07689fc3092a (diff) | |
download | open-keychain-aa625d4fbf8cf97de5a81675d55e4ac004ef5f11.tar.gz open-keychain-aa625d4fbf8cf97de5a81675d55e4ac004ef5f11.tar.bz2 open-keychain-aa625d4fbf8cf97de5a81675d55e4ac004ef5f11.zip |
parametrize FileImportCache for filename
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/FileImportCache.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/FileImportCache.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/FileImportCache.java index 5a4bf5311..35833adc6 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/FileImportCache.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/util/FileImportCache.java @@ -46,10 +46,11 @@ public class FileImportCache<E extends Parcelable> { private Context mContext; - private static final String FILENAME = "key_import.pcl"; + private final String mFilename; - public FileImportCache(Context context) { - this.mContext = context; + public FileImportCache(Context context, String filename) { + mContext = context; + mFilename = filename; } public void writeCache(ArrayList<E> selectedEntries) throws IOException { @@ -64,7 +65,7 @@ public class FileImportCache<E extends Parcelable> { throw new IOException("cache dir is null!"); } - File tempFile = new File(mContext.getCacheDir(), FILENAME); + File tempFile = new File(mContext.getCacheDir(), mFilename); DataOutputStream oos = new DataOutputStream(new FileOutputStream(tempFile)); @@ -98,7 +99,7 @@ public class FileImportCache<E extends Parcelable> { throw new IOException("cache dir is null!"); } - final File tempFile = new File(cacheDir, FILENAME); + final File tempFile = new File(cacheDir, mFilename); final DataInputStream ois = new DataInputStream(new FileInputStream(tempFile)); return new Iterator<E>() { |