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 */ |
11 abstract class Link extends FileSystemEntity { | 11 abstract class Link implements FileSystemEntity { |
12 /** | 12 /** |
13 * Creates a Link object. | 13 * Creates a Link object. |
14 */ | 14 */ |
15 factory Link(String path) => new _Link(path); | 15 factory Link(String path) => new _Link(path); |
16 | 16 |
17 /** | 17 /** |
18 * Creates a Link object from a Path object. | 18 * Creates a Link object from a Path object. |
19 */ | 19 */ |
20 factory Link.fromPath(Path path) => new _Link.fromPath(path); | 20 factory Link.fromPath(Path path) => new _Link.fromPath(path); |
21 | 21 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 _Link(String this.path); | 112 _Link(String this.path); |
113 | 113 |
114 _Link.fromPath(Path inputPath) : path = inputPath.toNativePath(); | 114 _Link.fromPath(Path inputPath) : path = inputPath.toNativePath(); |
115 | 115 |
116 String toString() => "Link: '$path'"; | 116 String toString() => "Link: '$path'"; |
117 | 117 |
118 Future<bool> exists() => FileSystemEntity.isLink(path); | 118 Future<bool> exists() => FileSystemEntity.isLink(path); |
119 | 119 |
120 bool existsSync() => FileSystemEntity.isLinkSync(path); | 120 bool existsSync() => FileSystemEntity.isLinkSync(path); |
121 | 121 |
| 122 Future<FileStat> stat() => FileStat.stat(path); |
| 123 |
| 124 FileStat statSync() => FileStat.statSync(path); |
| 125 |
122 Future<Link> create(String target) { | 126 Future<Link> create(String target) { |
123 _ensureFileService(); | 127 _ensureFileService(); |
124 if (Platform.operatingSystem == 'windows') { | 128 if (Platform.operatingSystem == 'windows') { |
125 target = _makeWindowsLinkTarget(target); | 129 target = _makeWindowsLinkTarget(target); |
126 } | 130 } |
127 List request = new List(3); | 131 List request = new List(3); |
128 request[0] = _CREATE_LINK_REQUEST; | 132 request[0] = _CREATE_LINK_REQUEST; |
129 request[1] = path; | 133 request[1] = path; |
130 request[2] = target; | 134 request[2] = target; |
131 return _fileService.call(request).then((response) { | 135 return _fileService.call(request).then((response) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 if (path != null) { | 263 if (path != null) { |
260 sb.write(", path = $path"); | 264 sb.write(", path = $path"); |
261 } | 265 } |
262 } | 266 } |
263 return sb.toString(); | 267 return sb.toString(); |
264 } | 268 } |
265 final String message; | 269 final String message; |
266 final String path; | 270 final String path; |
267 final OSError osError; | 271 final OSError osError; |
268 } | 272 } |
OLD | NEW |