Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: base/android/java/src/org/chromium/base/FileUtils.java

Issue 2305123002: [Downloads UI] Batch delete selected items (Closed)
Patch Set: foreach Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/download/ui/DownloadHistoryAdapter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698