Index: base/android/java/src/org/chromium/base/FileUtils.java |
diff --git a/base/android/java/src/org/chromium/base/FileUtils.java b/base/android/java/src/org/chromium/base/FileUtils.java |
index 2c0d8f59fac9ae329a3a803d7ce66f7361a3f07d..2ad70dd9a1c8ff65af68ba23cf4a6c86b8062364 100644 |
--- a/base/android/java/src/org/chromium/base/FileUtils.java |
+++ b/base/android/java/src/org/chromium/base/FileUtils.java |
@@ -12,6 +12,7 @@ import java.io.FileOutputStream; |
import java.io.IOException; |
import java.io.InputStream; |
import java.io.OutputStream; |
+import java.util.List; |
/** |
* Helper methods for dealing with Files. |
@@ -37,6 +38,18 @@ public class FileUtils { |
} |
/** |
+ * Delete the given files or directories by calling {@link #recursivelyDeleteFile(File)}. |
+ * @param files The files to delete. |
+ */ |
+ public static void batchDeleteFiles(List<File> files) { |
+ assert !ThreadUtils.runningOnUiThread(); |
+ |
+ for (File file : files) { |
+ if (file.exists()) recursivelyDeleteFile(file); |
+ } |
+ } |
+ |
+ /** |
* Extracts an asset from the app's APK to a file. |
* @param context |
* @param assetName Name of the asset to extract. |