| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |