Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: pkg/front_end/lib/file_system.dart

Issue 2614063007: Use URIs rather than paths in front end API. (Closed)
Patch Set: Run dartfmt Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/file_system.dart
diff --git a/pkg/front_end/lib/file_system.dart b/pkg/front_end/lib/file_system.dart
index cadf82fddf40b6058e3e18975b86f9a954730cfd..6e57c266c067bdd9b731335abc37ece3bfa672ec 100644
--- a/pkg/front_end/lib/file_system.dart
+++ b/pkg/front_end/lib/file_system.dart
@@ -18,22 +18,17 @@ import 'package:path/path.dart' as path;
/// Not intended to be implemented or extended by clients.
abstract class FileSystem {
/// Returns a path context suitable for use with this [FileSystem].
- path.Context get context;
-
- /// Returns a [FileSystemEntity] corresponding to the given [path].
- ///
- /// Uses of `..` and `.` in path are normalized before returning (so, for
- /// example, `entityForPath('./foo')` and `entityForPath('foo')` are
- /// equivalent). Relative paths are also converted to absolute paths.
///
- /// Does not check whether a file or folder exists at the given location.
- FileSystemEntity entityForPath(String path);
+ /// TODO(paulberry): try to eliminate all usages of this. Since the
+ /// FileSystem API now uses URIs rather than paths, it should not be needed.
+ path.Context get context;
/// Returns a [FileSystemEntity] corresponding to the given [uri].
///
/// Uses of `..` and `.` in the URI are normalized before returning.
///
- /// If [uri] is not an absolute `file:` URI, an [Error] will be thrown.
+ /// If the URI scheme is not supported by this file system, an [Error] will be
+ /// thrown.
///
/// Does not check whether a file or folder exists at the given location.
FileSystemEntity entityForUri(Uri uri);
@@ -46,14 +41,12 @@ abstract class FileSystem {
///
/// Not intended to be implemented or extended by clients.
abstract class FileSystemEntity {
- /// Returns the absolute normalized path represented by this file system
+ /// Returns the absolute normalized URI represented by this file system
/// entity.
///
- /// Note: if the [FileSystemEntity] was created using
- /// [FileSystem.entityForPath], this is not necessarily the same as the path
- /// that was used to create the object, since the path might have been
- /// normalized.
- String get path;
+ /// Note: this is not necessarily the same as the URI that was passed to
+ /// [FileSystem.entityForUri], since the URI might have been normalized.
+ Uri get uri;
/// Attempts to access this file system entity as a file and read its contents
/// as raw bytes.

Powered by Google App Engine
This is Rietveld 408576698