allowedFileSuffixesLowercase = new ArrayList<>();
static {
@@ -338,4 +340,19 @@ public File getFile() {
protected void setFile(File file) {
this.file = file;
}
+
+
+ /**
+ * true: forInput; false: forOutput; null: disable cache
+ */
+ @Override
+ public int setCacheStrategy(int strategyID) {
+ int old = this.strategyID;
+ this.strategyID = strategyID;
+ return old;
+ }
+
+ @Override
+ public void invalidateParentDirCache() {
+ }
}
diff --git a/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/FileWrapper.java b/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/FileWrapper.java
index b1c6231b..5dfa8836 100644
--- a/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/FileWrapper.java
+++ b/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/FileWrapper.java
@@ -182,6 +182,16 @@ public long length() {
return child.length();
}
+ @Override
+ public int setCacheStrategy(int strategyID) {
+ return child.setCacheStrategy(strategyID);
+ }
+
+ @Override
+ public void invalidateParentDirCache() {
+ child.invalidateParentDirCache();
+ }
+
@Override
public boolean equals(Object o) {
return child.equals(o);
diff --git a/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/IFile.java b/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/IFile.java
index 1610e77c..c5052df9 100644
--- a/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/IFile.java
+++ b/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/IFile.java
@@ -29,10 +29,15 @@
* Goal: to become an android independant replacement for java.io.File
* that can be implemented by android independant de.k3b.io.File
* and android specific de.k3b.android.io....
- *
+ *
* This interface has the similar method names/sinatures as de.k3b.io.File
*/
public interface IFile {
+ int STRATEGY_INPUT = 0;
+ int STRATEGY_OUTPUT = 1;
+ int STRATEGY_NONE = 2;
+ int STRATEGY_MAX = STRATEGY_NONE;
+
void set(IFile src);
@Deprecated
@@ -95,4 +100,13 @@ public interface IFile {
File getFile();
long length();
+
+ //------- file cache support
+
+ /**
+ * 0: forInput; 1: forOutput; 3: disable cache.
+ */
+ int setCacheStrategy(int strategyID);
+
+ void invalidateParentDirCache();
}
diff --git a/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/StringFileFacade.java b/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/StringFileFacade.java
index fb551560..98dc597f 100644
--- a/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/StringFileFacade.java
+++ b/libK3bFilefacade/src/main/java/de/k3b/io/filefacade/StringFileFacade.java
@@ -232,4 +232,14 @@ public File getFile() {
public long length() {
return 0;
}
+
+ @Override
+ public int setCacheStrategy(int strategyID) {
+ return 0;
+ }
+
+ @Override
+ public void invalidateParentDirCache() {
+
+ }
}