| 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 b190c1bf9a45cd6946163b89c2f89df94d814597..f3906be89b2ffff8c81dc929504dfe1bd9cfc848 100644
|
| --- a/pkg/analyzer/lib/file_system/physical_file_system.dart
|
| +++ b/pkg/analyzer/lib/file_system/physical_file_system.dart
|
| @@ -150,6 +150,14 @@ class _PhysicalFile extends _PhysicalResource implements File {
|
| io.File get _file => _entry as io.File;
|
|
|
| @override
|
| + File copyTo(Folder parentFolder) {
|
| + parentFolder.create();
|
| + File destination = parentFolder.getChildAssumingFile(shortName);
|
| + destination.writeAsBytesSync(readAsBytesSync());
|
| + return destination;
|
| + }
|
| +
|
| + @override
|
| Source createSource([Uri uri]) {
|
| return new FileSource(this, uri ?? pathContext.toUri(path));
|
| }
|
| @@ -246,6 +254,21 @@ class _PhysicalFolder extends _PhysicalResource implements Folder {
|
| }
|
|
|
| @override
|
| + Folder copyTo(Folder parentFolder) {
|
| + Folder destination = parentFolder.getChildAssumingFolder(shortName);
|
| + destination.create();
|
| + for (Resource child in getChildren()) {
|
| + child.copyTo(destination);
|
| + }
|
| + return destination;
|
| + }
|
| +
|
| + @override
|
| + void create() {
|
| + _directory.createSync(recursive: true);
|
| + }
|
| +
|
| + @override
|
| Resource getChild(String relPath) {
|
| String canonicalPath = canonicalizePath(relPath);
|
| return PhysicalResourceProvider.INSTANCE.getResource(canonicalPath);
|
|
|