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

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

Issue 2733053002: Add support for copying directory structures (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/memory_file_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/file_system/file_system.dart
diff --git a/pkg/analyzer/lib/file_system/file_system.dart b/pkg/analyzer/lib/file_system/file_system.dart
index 139330bb61740fa24900c03c859c30520b3baf86..11223c92fa8992a7505798a0ab63060c53b33b4f 100644
--- a/pkg/analyzer/lib/file_system/file_system.dart
+++ b/pkg/analyzer/lib/file_system/file_system.dart
@@ -32,6 +32,9 @@ abstract class File implements Resource {
*/
int get modificationStamp;
+ @override
+ File copyTo(Folder parentFolder);
+
/**
* Create a new [Source] instance that serves this file.
*/
@@ -114,6 +117,14 @@ abstract class Folder implements Resource {
*/
bool contains(String path);
+ @override
+ Folder copyTo(Folder parentFolder);
+
+ /**
+ * If this folder does not already exist, create it.
+ */
+ void create();
+
/**
* Return an existing child [Resource] with the given [relPath].
* Return a not existing [File] if no such child exist.
@@ -170,6 +181,19 @@ abstract class Resource {
String get shortName;
/**
+ * Copy this resource to a child of the [parentFolder] with the same kind and
+ * [shortName] as this resource. If this resource is a folder, then all of the
+ * contents of the folder will be recursively copied.
+ *
+ * The parent folder is created if it does not already exist.
+ *
+ * Existing files and folders will be overwritten.
+ *
+ * Return the resource corresponding to this resource in the parent folder.
+ */
+ Resource copyTo(Folder parentFolder);
+
+ /**
* Synchronously deletes this resource and its children.
*
* Throws an exception if the resource cannot be deleted.
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/memory_file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698