Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(930)

Side by Side Diff: sdk/lib/io/directory.dart

Issue 16123036: Clean up dart:io exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/common.dart ('k') | sdk/lib/io/directory_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 * [Directory] objects are used for working with directories. 8 * [Directory] objects are used for working with directories.
9 */ 9 */
10 abstract class Directory implements FileSystemEntity { 10 abstract class Directory implements FileSystemEntity {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 */ 203 */
204 String toString(); 204 String toString();
205 205
206 /** 206 /**
207 * Gets the path of this directory. 207 * Gets the path of this directory.
208 */ 208 */
209 final String path; 209 final String path;
210 } 210 }
211 211
212 212
213 class DirectoryIOException implements Exception { 213 class DirectoryException implements IOException {
214 const DirectoryIOException([String this.message = "", 214 const DirectoryException([String this.message = "",
215 String this.path = "", 215 String this.path = "",
216 OSError this.osError = null]); 216 OSError this.osError = null]);
217 String toString() { 217 String toString() {
218 StringBuffer sb = new StringBuffer(); 218 StringBuffer sb = new StringBuffer();
219 sb.write("DirectoryIOException"); 219 sb.write("DirectoryException");
220 if (!message.isEmpty) { 220 if (!message.isEmpty) {
221 sb.write(": $message"); 221 sb.write(": $message");
222 if (path != null) { 222 if (path != null) {
223 sb.write(", path = $path"); 223 sb.write(", path = $path");
224 } 224 }
225 if (osError != null) { 225 if (osError != null) {
226 sb.write(" ($osError)"); 226 sb.write(" ($osError)");
227 } 227 }
228 } else if (osError != null) { 228 } else if (osError != null) {
229 sb.write(": $osError"); 229 sb.write(": $osError");
230 if (path != null) { 230 if (path != null) {
231 sb.write(", path = $path"); 231 sb.write(", path = $path");
232 } 232 }
233 } 233 }
234 return sb.toString(); 234 return sb.toString();
235 } 235 }
236 final String message; 236 final String message;
237 final String path; 237 final String path;
238 final OSError osError; 238 final OSError osError;
239 } 239 }
OLDNEW
« no previous file with comments | « sdk/lib/io/common.dart ('k') | sdk/lib/io/directory_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698