| 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.
|
| */
|
|
|