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 interface Directory default _Directory { | 8 interface Directory default _Directory { |
9 /** | 9 /** |
10 * Creates a directory object. The path is either a full path or | 10 * Creates a directory object. The path is either a full path or |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 Future<Directory> deleteRecursively(); | 86 Future<Directory> deleteRecursively(); |
87 | 87 |
88 /** | 88 /** |
89 * Synchronously deletes this directory and all sub-directories and | 89 * Synchronously deletes this directory and all sub-directories and |
90 * files in the directories. Throws an exception if the directory | 90 * files in the directories. Throws an exception if the directory |
91 * cannot be deleted. | 91 * cannot be deleted. |
92 */ | 92 */ |
93 void deleteRecursivelySync(); | 93 void deleteRecursivelySync(); |
94 | 94 |
95 /** | 95 /** |
| 96 * Rename this directory. Returns a [:Future<Directory>:] that completes |
| 97 * with a [Directory] instance for the renamed directory. |
| 98 * |
| 99 * If newPath identifies an existing directory, that directory is |
| 100 * replaced. If newPath identifies an existing file the operation |
| 101 * fails and the future completes with an exception. |
| 102 */ |
| 103 Future<Directory> rename(String newPath); |
| 104 |
| 105 /** |
| 106 * Synchronously rename this directory. Returns a [Directory] |
| 107 * instance for the renamed directory. |
| 108 * |
| 109 * If newPath identifies an existing directory, that directory is |
| 110 * replaced. If newPath identifies an existing file the operation |
| 111 * fails and an exception is thrown. |
| 112 */ |
| 113 Directory renameSync(String newPath); |
| 114 |
| 115 /** |
96 * List the sub-directories and files of this | 116 * List the sub-directories and files of this |
97 * [Directory]. Optionally recurse into sub-directories. Returns a | 117 * [Directory]. Optionally recurse into sub-directories. Returns a |
98 * [DirectoryLister] object representing the active listing | 118 * [DirectoryLister] object representing the active listing |
99 * operation. Handlers for files and directories should be | 119 * operation. Handlers for files and directories should be |
100 * registered on this DirectoryLister object. | 120 * registered on this DirectoryLister object. |
101 */ | 121 */ |
102 DirectoryLister list([bool recursive]); | 122 DirectoryLister list([bool recursive]); |
103 | 123 |
104 /** | 124 /** |
105 * Gets the path of this directory. | 125 * Gets the path of this directory. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 if (path != null) { | 185 if (path != null) { |
166 sb.add(", path = $path"); | 186 sb.add(", path = $path"); |
167 } | 187 } |
168 } | 188 } |
169 return sb.toString(); | 189 return sb.toString(); |
170 } | 190 } |
171 final String message; | 191 final String message; |
172 final String path; | 192 final String path; |
173 final OSError osError; | 193 final OSError osError; |
174 } | 194 } |
OLD | NEW |