Index: pkg/front_end/lib/physical_file_system.dart |
diff --git a/pkg/front_end/lib/physical_file_system.dart b/pkg/front_end/lib/physical_file_system.dart |
index f90abc9aad16cd7fb8d723cd810d33d6d7c289c8..a81a44dfea7c9850aebde4edd92e6e6e8543aa54 100644 |
--- a/pkg/front_end/lib/physical_file_system.dart |
+++ b/pkg/front_end/lib/physical_file_system.dart |
@@ -7,8 +7,6 @@ library front_end.physical_file_system; |
import 'dart:async'; |
import 'dart:io' as io; |
-import 'package:path/path.dart' as p; |
- |
import 'file_system.dart'; |
/// Concrete implementation of [FileSystem] which performs its operations using |
@@ -21,9 +19,6 @@ class PhysicalFileSystem implements FileSystem { |
PhysicalFileSystem._(); |
@override |
- p.Context get context => p.context; |
- |
- @override |
FileSystemEntity entityForUri(Uri uri) { |
if (uri.scheme != 'file' && uri.scheme != '') { |
throw new ArgumentError('File URI expected'); |
@@ -52,4 +47,16 @@ class _PhysicalFileSystemEntity implements FileSystemEntity { |
@override |
Future<String> readAsString() => new io.File.fromUri(uri).readAsString(); |
+ |
+ @override |
+ Future<bool> exists() async { |
+ if (await io.FileSystemEntity.isFile(uri.toFilePath())) { |
+ return new io.File.fromUri(uri).exists(); |
+ } else { |
+ return new io.Directory.fromUri(uri).exists(); |
+ } |
+ } |
+ |
+ @override |
+ Future<DateTime> lastModified() => new io.File.fromUri(uri).lastModified(); |
} |