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 part of dart.io; | 5 part of dart.io; |
6 | 6 |
7 /** | 7 /** |
8 * A reference to a directory (or _folder_) on the file system. | 8 * A reference to a directory (or _folder_) on the file system. |
9 */ | 9 */ |
10 abstract class Directory implements FileSystemEntity { | 10 abstract class Directory implements FileSystemEntity { |
11 /** | 11 /** |
12 * Creates a directory object. The path is either an absolute path, | 12 * Creates a directory object. The path is either an absolute path, |
13 * or it is a relative path which is interpreted relative to the directory | 13 * or it is a relative path which is interpreted relative to the directory |
14 * in which the Dart VM was started. | 14 * in which the Dart VM was started. |
15 */ | 15 */ |
16 factory Directory(String path) => new _Directory(path); | 16 factory Directory(String path) => new _Directory(path); |
17 | 17 |
18 /** | 18 /** |
| 19 * Create a Directory object from a URI. |
| 20 * |
| 21 * If [uri] cannot reference a directory this throws [UnsupportedError]. |
| 22 */ |
| 23 factory Directory.fromUri(Uri uri) => new Directory(uri.toFilePath()); |
| 24 |
| 25 /** |
19 * Creates a directory object pointing to the current working | 26 * Creates a directory object pointing to the current working |
20 * directory. | 27 * directory. |
21 */ | 28 */ |
22 static Directory get current => _Directory.current; | 29 static Directory get current => _Directory.current; |
23 | 30 |
24 /** | 31 /** |
25 * Sets the current working directory of the Dart process including | 32 * Sets the current working directory of the Dart process including |
26 * all running isolates. The new value set can be either a [Directory] | 33 * all running isolates. The new value set can be either a [Directory] |
27 * or a [String]. | 34 * or a [String]. |
28 * | 35 * |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 /** | 187 /** |
181 * Returns a human readable string for this Directory instance. | 188 * Returns a human readable string for this Directory instance. |
182 */ | 189 */ |
183 String toString(); | 190 String toString(); |
184 | 191 |
185 /** | 192 /** |
186 * Gets the path of this directory. | 193 * Gets the path of this directory. |
187 */ | 194 */ |
188 final String path; | 195 final String path; |
189 } | 196 } |
OLD | NEW |