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 * [Link] objects are references to filesystem links. | 8 * [Link] objects are references to filesystem links. |
9 * | 9 * |
10 */ | 10 */ |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 * | 136 * |
137 * If the link does not exist, or is not a link, throws a FileSystemException. | 137 * If the link does not exist, or is not a link, throws a FileSystemException. |
138 */ | 138 */ |
139 String targetSync(); | 139 String targetSync(); |
140 } | 140 } |
141 | 141 |
142 | 142 |
143 class _Link extends FileSystemEntity implements Link { | 143 class _Link extends FileSystemEntity implements Link { |
144 final String path; | 144 final String path; |
145 | 145 |
146 _Link(String this.path) { | 146 _Link(this.path) { |
147 if (path is! String) { | 147 if (path is! String) { |
148 throw new ArgumentError('${Error.safeToString(path)} ' | 148 throw new ArgumentError('${Error.safeToString(path)} ' |
149 'is not a String'); | 149 'is not a String'); |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 String toString() => "Link: '$path'"; | 153 String toString() => "Link: '$path'"; |
154 | 154 |
155 Future<bool> exists() => FileSystemEntity.isLink(path); | 155 Future<bool> exists() => FileSystemEntity.isLink(path); |
156 | 156 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 return new ArgumentError(); | 292 return new ArgumentError(); |
293 case _OSERROR_RESPONSE: | 293 case _OSERROR_RESPONSE: |
294 var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE], | 294 var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE], |
295 response[_OSERROR_RESPONSE_ERROR_CODE]); | 295 response[_OSERROR_RESPONSE_ERROR_CODE]); |
296 return new FileSystemException(message, path, err); | 296 return new FileSystemException(message, path, err); |
297 default: | 297 default: |
298 return new Exception("Unknown error"); | 298 return new Exception("Unknown error"); |
299 } | 299 } |
300 } | 300 } |
301 } | 301 } |
OLD | NEW |