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

Unified Diff: sdk/lib/io/file_system_entity.dart

Issue 1083393004: Add uri getter on file system entity. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
« no previous file with comments | « sdk/lib/io/file.dart ('k') | sdk/lib/io/link.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file_system_entity.dart
diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart
index 642a063525d63e2084a56f36869795e0bcbb5840..7e8b0dd7859aa27c44aba8673ff0c9365e45e742 100644
--- a/sdk/lib/io/file_system_entity.dart
+++ b/sdk/lib/io/file_system_entity.dart
@@ -198,7 +198,7 @@ FileStat: type $type
* ## Other resources
*
* [Dart by Example](https://www.dartlang.org/dart-by-example/#files-directories-and-symlinks)
- * provides additional task-oriented code samples that show how to use
+ * provides additional task-oriented code samples that show how to use
* various API from the [Directory] class and the [File] class,
* both subclasses of FileSystemEntity.
*
@@ -215,6 +215,14 @@ abstract class FileSystemEntity {
String get path;
/**
+ * Returns a [Uri] representing the file system entity's location.
+ *
+ * The returned URI's scheme is always "file" if the entity's [path] is
+ * absolute, otherwise the scheme will be empty.
+ */
+ Uri get uri => new Uri.file(path);
+
+ /**
* Checks whether the file system entity with this path exists. Returns
* a [:Future<bool>:] that completes with the result.
*
« no previous file with comments | « sdk/lib/io/file.dart ('k') | sdk/lib/io/link.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698