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

Unified Diff: pkg/analyzer/lib/file_system/memory_file_system.dart

Issue 2067613002: Add Resource.delete() method. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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/analyzer/lib/file_system/memory_file_system.dart
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
index f95d33ffc1bb44bcc8c197cdfd5cdad448e43e19..789095ceb8da8902315dc24fa79fef6a0fdb6d71 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -281,6 +281,11 @@ class _MemoryDummyLink extends _MemoryResource implements File {
}
@override
+ void delete() {
+ throw new FileSystemException(path, 'File could not be deleted');
+ }
+
+ @override
bool isOrContains(String path) {
return path == this.path;
}
@@ -342,6 +347,11 @@ class _MemoryFile extends _MemoryResource implements File {
}
@override
+ void delete() {
+ _provider.deleteFile(path);
+ }
+
+ @override
bool isOrContains(String path) {
return path == this.path;
}
@@ -488,6 +498,11 @@ class _MemoryFolder extends _MemoryResource implements Folder {
}
@override
+ void delete() {
+ _provider.deleteFolder(path);
+ }
+
+ @override
Resource getChild(String relPath) {
String childPath = canonicalizePath(relPath);
_MemoryResource resource = _provider._pathToResource[childPath];
« no previous file with comments | « pkg/analyzer/lib/file_system/file_system.dart ('k') | pkg/analyzer/lib/file_system/physical_file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698