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

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

Issue 19263003: Add FileSystemWatcher class to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix android socket. Created 7 years, 3 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 | « runtime/bin/socket_win.cc ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/directory_impl.dart
diff --git a/sdk/lib/io/directory_impl.dart b/sdk/lib/io/directory_impl.dart
index 39d36cfe22c5997a49c2a49a3a76e82c56a152ec..c9eec06376a5df378adebb60dba65149c2a2bbb8 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -4,7 +4,7 @@
part of dart.io;
-class _Directory implements Directory {
+class _Directory extends FileSystemEntity implements Directory {
static const CREATE_REQUEST = 0;
static const DELETE_REQUEST = 1;
static const EXISTS_REQUEST = 2;
@@ -229,35 +229,22 @@ class _Directory implements Directory {
return new Directory(newPath);
}
- static String _trimTrailingPathSeparators(String path) {
- // Don't handle argument errors here.
- if (path is! String) return path;
- if (Platform.operatingSystem == 'windows') {
- while (path.length > 1 &&
- (path.endsWith(Platform.pathSeparator) ||
- path.endsWith('/'))) {
- path = path.substring(0, path.length - 1);
- }
- } else {
- while (path.length > 1 && path.endsWith(Platform.pathSeparator)) {
- path = path.substring(0, path.length - 1);
- }
- }
- return path;
- }
-
Stream<FileSystemEntity> list({bool recursive: false,
bool followLinks: true}) {
- return new _AsyncDirectoryLister(_trimTrailingPathSeparators(path),
- recursive,
- followLinks).stream;
+ return new _AsyncDirectoryLister(
+ FileSystemEntity._trimTrailingPathSeparators(path),
+ recursive,
+ followLinks).stream;
}
List listSync({bool recursive: false, bool followLinks: true}) {
if (recursive is! bool || followLinks is! bool) {
throw new ArgumentError();
}
- return _list(_trimTrailingPathSeparators(path), recursive, followLinks);
+ return _list(
+ FileSystemEntity._trimTrailingPathSeparators(path),
+ recursive,
+ followLinks);
}
String toString() => "Directory: '$path'";
« no previous file with comments | « runtime/bin/socket_win.cc ('k') | sdk/lib/io/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698