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

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

Issue 1808213004: Add File.renameSync() to virtual file system. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 1a4e7939296aba1a74a535b01c0e8dc4008f6bc3..66125a69fa7c53ecbf54d95e10ff4d31d007ddbe 100644
--- a/pkg/analyzer/lib/file_system/physical_file_system.dart
+++ b/pkg/analyzer/lib/file_system/physical_file_system.dart
@@ -140,6 +140,17 @@ class _PhysicalFile extends _PhysicalResource implements File {
throw new FileSystemException(exception.path, exception.message);
}
}
+
+ @override
+ Resource renameSync(String newPath) {
+ try {
+ io.File file = _entry as io.File;
+ io.File newFile = file.renameSync(newPath);
+ return new _PhysicalFile(newFile);
+ } on io.FileSystemException catch (exception) {
+ throw new FileSystemException(exception.path, exception.message);
+ }
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698