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 | 18 * Watch for changes to this file |
19 */ | 19 */ |
20 Stream<WatchEvent> get changes; | 20 Stream<WatchEvent> get changes; |
21 | 21 |
22 /** | 22 /** |
23 * Return the last-modified stamp of the file. | 23 * Return the last-modified stamp of the file. |
24 * Throws [FileSystemException] if the file does not exist. | 24 * Throws [FileSystemException] if the file does not exist. |
25 */ | 25 */ |
26 int get modificationStamp; | 26 int get modificationStamp; |
27 | 27 |
28 /** | 28 /** |
29 * Create a new [Source] instance that serves this file. | 29 * Create a new [Source] instance that serves this file. |
30 */ | 30 */ |
31 Source createSource([Uri uri]); | 31 Source createSource([Uri uri]); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 | 181 |
182 @override | 182 @override |
183 Uri restoreAbsolute(Source source) => source.uri; | 183 Uri restoreAbsolute(Source source) => source.uri; |
184 | 184 |
185 /** | 185 /** |
186 * Return `true` if the given [uri] is a `file` URI. | 186 * Return `true` if the given [uri] is a `file` URI. |
187 */ | 187 */ |
188 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; | 188 static bool _isFileUri(Uri uri) => uri.scheme == _FILE_SCHEME; |
189 } | 189 } |
OLD | NEW |