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

Unified Diff: pkg/analyzer/lib/file_system/physical_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/physical_file_system.dart
diff --git a/pkg/analyzer/lib/file_system/physical_file_system.dart b/pkg/analyzer/lib/file_system/physical_file_system.dart
index 132375f34bd9e79e332fd0f6a6a5397b7d154f85..9cd62b6b89ed269e9d1ad5b181643e29bbcb3d3a 100644
--- a/pkg/analyzer/lib/file_system/physical_file_system.dart
+++ b/pkg/analyzer/lib/file_system/physical_file_system.dart
@@ -263,5 +263,14 @@ abstract class _PhysicalResource implements Resource {
}
@override
+ void delete() {
+ try {
+ _entry.deleteSync(recursive: true);
+ } on io.FileSystemException catch (exception) {
+ throw new FileSystemException(exception.path, exception.message);
+ }
+ }
+
+ @override
String toString() => path;
}
« no previous file with comments | « pkg/analyzer/lib/file_system/memory_file_system.dart ('k') | pkg/analyzer/test/file_system/memory_file_system_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698