| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * [Directory] objects are used for working with directories. | 6 * [Directory] objects are used for working with directories. |
| 7 */ | 7 */ |
| 8 abstract class Directory { | 8 abstract class Directory { |
| 9 /** | 9 /** |
| 10 * Creates a directory object. The path is either an absolute path, | 10 * Creates a directory object. The path is either an absolute path, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 * a [:Future<bool>:] that completes with the result. | 31 * a [:Future<bool>:] that completes with the result. |
| 32 */ | 32 */ |
| 33 Future<bool> exists(); | 33 Future<bool> exists(); |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * Synchronously check whether a directory with this name already exists. | 36 * Synchronously check whether a directory with this name already exists. |
| 37 */ | 37 */ |
| 38 bool existsSync(); | 38 bool existsSync(); |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Creates the directory with this name if it does not | 41 * Creates the directory with this name. If the directory already |
| 42 * exist. Returns a [:Future<Directory>:] that completes with this | 42 * exists nothing is done. Returns a [:Future<Directory>:] that |
| 43 * directory once it has been created. | 43 * completes with this directory once it has been created. If the |
| 44 * directory does not exist and cannot be created the future |
| 45 * completes with an exception. |
| 44 */ | 46 */ |
| 45 Future<Directory> create(); | 47 Future<Directory> create(); |
| 46 | 48 |
| 47 /** | 49 /** |
| 48 * Synchronously creates the directory with this name if it does not exist. | 50 * Synchronously creates the directory with this name. If the |
| 49 * Throws an exception if the directory already exists. | 51 * directory already exists nothing is done. If the directory does |
| 52 * not exist and cannot be created an exception is thrown. |
| 50 */ | 53 */ |
| 51 void createSync(); | 54 void createSync(); |
| 52 | 55 |
| 53 /** | 56 /** |
| 54 * Creates a temporary directory with a name based on the current | 57 * Creates a temporary directory with a name based on the current |
| 55 * path. This name and path is used as a template, and additional | 58 * path. This name and path is used as a template, and additional |
| 56 * characters are appended to it by the call to make a unique | 59 * characters are appended to it by the call to make a unique |
| 57 * directory name. If the path is the empty string, a default | 60 * directory name. If the path is the empty string, a default |
| 58 * system temp directory and name are used for the template. | 61 * system temp directory and name are used for the template. |
| 59 * | 62 * |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 if (path != null) { | 195 if (path != null) { |
| 193 sb.add(", path = $path"); | 196 sb.add(", path = $path"); |
| 194 } | 197 } |
| 195 } | 198 } |
| 196 return sb.toString(); | 199 return sb.toString(); |
| 197 } | 200 } |
| 198 final String message; | 201 final String message; |
| 199 final String path; | 202 final String path; |
| 200 final OSError osError; | 203 final OSError osError; |
| 201 } | 204 } |
| OLD | NEW |