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

Unified Diff: runtime/bin/directory.dart

Issue 8965036: Add asynchronous versions of the methods on Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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
Index: runtime/bin/directory.dart
diff --git a/runtime/bin/directory.dart b/runtime/bin/directory.dart
index acdcd09444312e0f95e231102ee08d697700ee9c..5bde4ac1c09929cebfd889eb35bf60f8d8fc823c 100644
--- a/runtime/bin/directory.dart
+++ b/runtime/bin/directory.dart
@@ -11,13 +11,27 @@ interface Directory factory _Directory {
Directory(String path);
/**
- * Returns whether a directory with this name already exists.
+ * Check whether a directory with this name already exists. If the
+ * operation completes successfully the [existsHandler] is called with
+ * the result. Otherwise the [errorHandler] is called.
+ */
+ void exists();
+
+ /**
+ * Synchronously check whether a directory with this name already exists.
*/
bool existsSync();
/**
* Creates the directory with this name if it does not exist.
- * Throw an exception if the directory already exists.
+ * If the directory is successfully created the [createHandler] is
+ * called. Otherwise the [errorHandler] is called.
+ */
+ void create();
+
+ /**
+ * Synchronously creates the directory with this name if it does not exist.
+ * Throws an exception if the directory already exists.
*/
void createSync();
@@ -45,6 +59,13 @@ interface Directory factory _Directory {
void createTempSync();
/**
+ * Deletes the directory with this name. If the operation completes
+ * successfully the [deleteHandler] is called. Otherwise the
+ * [errorHandler] is called.
+ */
+ void delete();
+
+ /**
* Deletes the directory with this name. Throws an exception
* if the directory is not empty or if deletion failed.
*/
@@ -82,12 +103,29 @@ interface Directory factory _Directory {
void set doneHandler(void doneHandler(bool completed));
/**
+ * Set the handler that is called when checking if a directory with this
+ * name exists.
+ */
+ void set existsHandler(void existsHandler(bool exists));
+
+ /**
+ * Set the handler that is called when a directory is successfully created.
+ */
+ void set createHandler(void createHandler());
+
+ /**
* Set the handler that is called when a temporary directory is
* successfully created.
*/
void set createTempHandler(void doneHandler(bool completed));
/**
+ * Set the handler that is called when a directory is successfully
+ * deleted.
+ */
+ void set deleteHandler(void deleteHandler());
+
+ /**
* Sets the handler that is called if there is an error while listing
* or creating directories.
*/

Powered by Google App Engine
This is Rietveld 408576698