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 * A Directory instance is an object holding a [path] on which operations can | 10 * A Directory instance is an object holding a [path] on which operations can |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 * a tutorial about writing command-line apps, includes information | 111 * a tutorial about writing command-line apps, includes information |
112 * about files and directories. | 112 * about files and directories. |
113 */ | 113 */ |
114 abstract class Directory extends FileSystemEntity { | 114 abstract class Directory extends FileSystemEntity { |
115 /** | 115 /** |
116 * Gets the path of this directory. | 116 * Gets the path of this directory. |
117 */ | 117 */ |
118 final String path; | 118 final String path; |
119 | 119 |
120 /** | 120 /** |
121 * Creates a directory object. The path is either an absolute path, | 121 * Creates a [Directory] object. |
122 * or it is a relative path which is interpreted relative to the directory | 122 * |
123 * in which the Dart VM was started. | 123 * If [path] is a relative path, it will be interpreted relative to the |
| 124 * current working directory (see [Directory.current]), when used. |
| 125 * |
| 126 * If [path] is an absolute path, it will be immune to changes to the |
| 127 * current working directory. |
124 */ | 128 */ |
125 factory Directory(String path) => new _Directory(path); | 129 factory Directory(String path) => new _Directory(path); |
126 | 130 |
127 /** | 131 /** |
128 * Create a Directory object from a URI. | 132 * Create a Directory object from a URI. |
129 * | 133 * |
130 * If [uri] cannot reference a directory this throws [UnsupportedError]. | 134 * If [uri] cannot reference a directory this throws [UnsupportedError]. |
131 */ | 135 */ |
132 factory Directory.fromUri(Uri uri) => new Directory(uri.toFilePath()); | 136 factory Directory.fromUri(Uri uri) => new Directory(uri.toFilePath()); |
133 | 137 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 * directories, files, and links. | 295 * directories, files, and links. |
292 */ | 296 */ |
293 List<FileSystemEntity> listSync({bool recursive: false, | 297 List<FileSystemEntity> listSync({bool recursive: false, |
294 bool followLinks: true}); | 298 bool followLinks: true}); |
295 | 299 |
296 /** | 300 /** |
297 * Returns a human readable string for this Directory instance. | 301 * Returns a human readable string for this Directory instance. |
298 */ | 302 */ |
299 String toString(); | 303 String toString(); |
300 } | 304 } |
OLD | NEW |