OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library file_system; | 5 library file_system; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/src/generated/source.dart'; | 9 import 'package:analyzer/src/generated/source.dart'; |
10 import 'package:path/path.dart'; | 10 import 'package:path/path.dart'; |
11 import 'package:watcher/watcher.dart'; | 11 import 'package:watcher/watcher.dart'; |
12 | 12 |
13 /** | 13 /** |
14 * [File]s are leaf [Resource]s which contain data. | 14 * [File]s are leaf [Resource]s which contain data. |
15 */ | 15 */ |
16 abstract class File extends Resource { | 16 abstract class File extends Resource { |
17 /** | 17 /** |
| 18 * Watch for changes to this file |
| 19 */ |
| 20 Stream<WatchEvent> get changes; |
| 21 |
| 22 /** |
18 * Return the last-modified stamp of the file. | 23 * Return the last-modified stamp of the file. |
19 * Throws [FileSystemException] if the file does not exist. | 24 * Throws [FileSystemException] if the file does not exist. |
20 */ | 25 */ |
21 int get modificationStamp; | 26 int get modificationStamp; |
22 | 27 |
23 /** | 28 /** |
24 * Create a new [Source] instance that serves this file. | 29 * Create a new [Source] instance that serves this file. |
25 */ | 30 */ |
26 Source createSource([Uri uri]); | 31 Source createSource([Uri uri]); |
27 | 32 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 180 } |
176 | 181 |
177 @override | 182 @override |
178 Uri restoreAbsolute(Source source) => source.uri; | 183 Uri restoreAbsolute(Source source) => source.uri; |
179 | 184 |
180 /** | 185 /** |
181 * Return `true` if the given [uri] is a `file` URI. | 186 * Return `true` if the given [uri] is a `file` URI. |
182 */ | 187 */ |
183 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; | 188 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; |
184 } | 189 } |
OLD | NEW |