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

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

Issue 18090003: Add FileException.path and clean up file exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: CLean up test and remove debug code. Created 7 years, 5 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/directory_impl.dart ('k') | sdk/lib/io/file_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 * FileMode describes the modes in which a file can be opened. 8 * FileMode describes the modes in which a file can be opened.
9 */ 9 */
10 class FileMode { 10 class FileMode {
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 String toString(); 518 String toString();
519 519
520 /** 520 /**
521 * Gets the path of the file underlying this RandomAccessFile. 521 * Gets the path of the file underlying this RandomAccessFile.
522 */ 522 */
523 String get path; 523 String get path;
524 } 524 }
525 525
526 526
527 class FileException implements IOException { 527 class FileException implements IOException {
528 final String message;
529 final String path;
530 final OSError osError;
528 const FileException([String this.message = "", 531 const FileException([String this.message = "",
529 OSError this.osError = null]); 532 String this.path = "",
533 OSError this.osError]);
534
530 String toString() { 535 String toString() {
531 StringBuffer sb = new StringBuffer(); 536 StringBuffer sb = new StringBuffer();
532 sb.write("FileException"); 537 sb.write("FileException");
533 if (!message.isEmpty) { 538 if (!message.isEmpty) {
534 sb.write(": $message"); 539 sb.write(": $message");
540 if (path != null) {
541 sb.write(", path = $path");
542 }
535 if (osError != null) { 543 if (osError != null) {
536 sb.write(" ($osError)"); 544 sb.write(" ($osError)");
537 } 545 }
538 } else if (osError != null) { 546 } else if (osError != null) {
539 sb.write(": osError"); 547 sb.write(": osError");
548 if (path != null) {
549 sb.write(", path = $path");
550 }
540 } 551 }
541 return sb.toString(); 552 return sb.toString();
542 } 553 }
543 final String message;
544 final OSError osError;
545 } 554 }
OLDNEW
« no previous file with comments | « sdk/lib/io/directory_impl.dart ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698