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. |
Søren Gjesse
2012/10/23 09:08:07
Exception information here as well as for the sync
Mads Ager (google)
2012/10/23 09:14:44
Done.
| |
44 */ | 44 */ |
45 Future<Directory> create(); | 45 Future<Directory> create(); |
46 | 46 |
47 /** | 47 /** |
48 * Synchronously creates the directory with this name if it does not exist. | 48 * Synchronously creates the directory with this name. If the |
49 * Throws an exception if the directory already exists. | 49 * directory already exists nothing is done. If the directory does |
50 * not exist and cannot be created an exception is thrown. | |
50 */ | 51 */ |
51 void createSync(); | 52 void createSync(); |
52 | 53 |
53 /** | 54 /** |
54 * Creates a temporary directory with a name based on the current | 55 * Creates a temporary directory with a name based on the current |
55 * path. This name and path is used as a template, and additional | 56 * 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 | 57 * characters are appended to it by the call to make a unique |
57 * directory name. If the path is the empty string, a default | 58 * directory name. If the path is the empty string, a default |
58 * system temp directory and name are used for the template. | 59 * system temp directory and name are used for the template. |
59 * | 60 * |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
192 if (path != null) { | 193 if (path != null) { |
193 sb.add(", path = $path"); | 194 sb.add(", path = $path"); |
194 } | 195 } |
195 } | 196 } |
196 return sb.toString(); | 197 return sb.toString(); |
197 } | 198 } |
198 final String message; | 199 final String message; |
199 final String path; | 200 final String path; |
200 final OSError osError; | 201 final OSError osError; |
201 } | 202 } |
OLD | NEW |