| Index: sdk/lib/io/file.dart
|
| diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
|
| index b7bfea2ab0092347201321cd58f72e2634013bc7..174ca415d396471da819e941955b94e213f16905 100644
|
| --- a/sdk/lib/io/file.dart
|
| +++ b/sdk/lib/io/file.dart
|
| @@ -55,7 +55,7 @@ abstract class File implements FileSystemEntity {
|
| * by [createSync]. Calling [createSync] on an existing file might fail
|
| * if there are restrictive permissions on the file.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| void createSync();
|
|
|
| @@ -96,7 +96,7 @@ abstract class File implements FileSystemEntity {
|
| /**
|
| * Synchronously get the length of the file.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| int lengthSync();
|
|
|
| @@ -120,7 +120,7 @@ abstract class File implements FileSystemEntity {
|
| * Get the last-modified time of the file. Throws an exception
|
| * if the file does not exist.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| DateTime lastModifiedSync();
|
|
|
| @@ -151,7 +151,7 @@ abstract class File implements FileSystemEntity {
|
| *
|
| * See [open] for information on the [mode] argument.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| RandomAccessFile openSync({FileMode mode: FileMode.READ});
|
|
|
| @@ -168,7 +168,7 @@ abstract class File implements FileSystemEntity {
|
| /**
|
| * Synchronously get the canonical full path corresponding to the file path.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| *
|
| * *FullPathSync is deprecated. Use absolutePathSync or
|
| * resolveSymbolicLinksSync instead. FullPathSync will be removed
|
| @@ -221,7 +221,7 @@ abstract class File implements FileSystemEntity {
|
| /**
|
| * Synchronously read the entire file contents as a list of bytes.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| List<int> readAsBytesSync();
|
|
|
| @@ -238,7 +238,7 @@ abstract class File implements FileSystemEntity {
|
| * Synchronously read the entire file contents as a string using the
|
| * given [Encoding].
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| String readAsStringSync({Encoding encoding: UTF8});
|
|
|
| @@ -255,7 +255,7 @@ abstract class File implements FileSystemEntity {
|
| * Synchronously read the entire file contents as lines of text
|
| * using the given [Encoding].
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| List<String> readAsLinesSync({Encoding encoding: UTF8});
|
|
|
| @@ -281,7 +281,7 @@ abstract class File implements FileSystemEntity {
|
| * the file if it already exists. In order to append the bytes to an existing
|
| * file, pass [FileMode.APPEND] as the optional mode parameter.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| void writeAsBytesSync(List<int> bytes, {FileMode mode: FileMode.WRITE});
|
|
|
| @@ -311,7 +311,7 @@ abstract class File implements FileSystemEntity {
|
| * to an existing file, pass [FileMode.APPEND] as the optional mode
|
| * parameter.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| void writeAsStringSync(String contents,
|
| {FileMode mode: FileMode.WRITE,
|
| @@ -339,7 +339,7 @@ abstract class RandomAccessFile {
|
| /**
|
| * Synchronously closes the file.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| void closeSync();
|
|
|
| @@ -353,7 +353,7 @@ abstract class RandomAccessFile {
|
| * Synchronously reads a single byte from the file. If end-of-file
|
| * has been reached -1 is returned.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| int readByteSync();
|
|
|
| @@ -366,7 +366,7 @@ abstract class RandomAccessFile {
|
| * Synchronously reads a maximum of [bytes] bytes from a file and
|
| * returns the result in a list of bytes.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| List<int> readSync(int bytes);
|
|
|
| @@ -388,7 +388,7 @@ abstract class RandomAccessFile {
|
| * read into [buffer], otherwise up to [buffer.length]. If [end] == [start]
|
| * nothing happends.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| int readIntoSync(List<int> buffer, [int start, int end]);
|
|
|
| @@ -403,7 +403,7 @@ abstract class RandomAccessFile {
|
| * Synchronously writes a single byte to the file. Returns the
|
| * number of bytes successfully written.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| int writeByteSync(int value);
|
|
|
| @@ -423,7 +423,7 @@ abstract class RandomAccessFile {
|
| * start from index 0. If [end] is omitted, it will write to the end of
|
| * [buffer].
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| void writeFromSync(List<int> buffer, [int start, int end]);
|
|
|
| @@ -439,7 +439,7 @@ abstract class RandomAccessFile {
|
| * Synchronously writes a single string to the file using the given
|
| * [Encoding].
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| void writeStringSync(String string,
|
| {Encoding encoding: UTF8});
|
| @@ -453,7 +453,7 @@ abstract class RandomAccessFile {
|
| /**
|
| * Synchronously gets the current byte position in the file.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| int positionSync();
|
|
|
| @@ -467,7 +467,7 @@ abstract class RandomAccessFile {
|
| /**
|
| * Synchronously sets the byte position in the file.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| void setPositionSync(int position);
|
|
|
| @@ -481,7 +481,7 @@ abstract class RandomAccessFile {
|
| /**
|
| * Synchronously truncates (or extends) the file to [length] bytes.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| void truncateSync(int length);
|
|
|
| @@ -494,7 +494,7 @@ abstract class RandomAccessFile {
|
| /**
|
| * Synchronously gets the length of the file.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| int lengthSync();
|
|
|
| @@ -508,7 +508,7 @@ abstract class RandomAccessFile {
|
| /**
|
| * Synchronously flushes the contents of the file to disk.
|
| *
|
| - * Throws a [FileException] if the operation fails.
|
| + * Throws a [FileSystemException] if the operation fails.
|
| */
|
| void flushSync();
|
|
|
| @@ -524,17 +524,17 @@ abstract class RandomAccessFile {
|
| }
|
|
|
|
|
| -class FileException implements IOException {
|
| +class FileSystemException implements IOException {
|
| final String message;
|
| final String path;
|
| final OSError osError;
|
| - const FileException([String this.message = "",
|
| - String this.path = "",
|
| - OSError this.osError]);
|
| + const FileSystemException([String this.message = "",
|
| + String this.path = "",
|
| + OSError this.osError]);
|
|
|
| String toString() {
|
| StringBuffer sb = new StringBuffer();
|
| - sb.write("FileException");
|
| + sb.write("FileSystemException");
|
| if (!message.isEmpty) {
|
| sb.write(": $message");
|
| if (path != null) {
|
|
|