| 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 { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 /** | 180 /** |
| 181 * Returns a human readable string for this Directory instance. | 181 * Returns a human readable string for this Directory instance. |
| 182 */ | 182 */ |
| 183 String toString(); | 183 String toString(); |
| 184 | 184 |
| 185 /** | 185 /** |
| 186 * Gets the path of this directory. | 186 * Gets the path of this directory. |
| 187 */ | 187 */ |
| 188 final String path; | 188 final String path; |
| 189 } | 189 } |
| 190 | |
| 191 | |
| 192 class DirectoryException implements IOException { | |
| 193 const DirectoryException([String this.message = "", | |
| 194 String this.path = "", | |
| 195 OSError this.osError = null]); | |
| 196 String toString() { | |
| 197 StringBuffer sb = new StringBuffer(); | |
| 198 sb.write("DirectoryException"); | |
| 199 if (!message.isEmpty) { | |
| 200 sb.write(": $message"); | |
| 201 if (path != null) { | |
| 202 sb.write(", path = $path"); | |
| 203 } | |
| 204 if (osError != null) { | |
| 205 sb.write(" ($osError)"); | |
| 206 } | |
| 207 } else if (osError != null) { | |
| 208 sb.write(": $osError"); | |
| 209 if (path != null) { | |
| 210 sb.write(", path = $path"); | |
| 211 } | |
| 212 } | |
| 213 return sb.toString(); | |
| 214 } | |
| 215 final String message; | |
| 216 final String path; | |
| 217 final OSError osError; | |
| 218 } | |
| OLD | NEW |