| 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 3cab6ee8995aed9cfaed5d5a10d6a66cc98174a8..6e7ab642e104bd94fd18f642df1b0a51759f54a6 100644
|
| --- a/pkg/analyzer/lib/file_system/memory_file_system.dart
|
| +++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
|
| @@ -326,6 +326,11 @@ class _MemoryDummyLink extends _MemoryResource implements File {
|
| }
|
|
|
| @override
|
| + File copyTo(Folder parentFolder) {
|
| + throw new FileSystemException(path, 'File could not be copied');
|
| + }
|
| +
|
| + @override
|
| Source createSource([Uri uri]) {
|
| throw new FileSystemException(path, 'File could not be read');
|
| }
|
| @@ -396,6 +401,14 @@ class _MemoryFile extends _MemoryResource implements File {
|
| }
|
|
|
| @override
|
| + File copyTo(Folder parentFolder) {
|
| + parentFolder.create();
|
| + File destination = parentFolder.getChildAssumingFile(shortName);
|
| + destination.writeAsBytesSync(readAsBytesSync());
|
| + return destination;
|
| + }
|
| +
|
| + @override
|
| Source createSource([Uri uri]) {
|
| uri ??= _provider.pathContext.toUri(path);
|
| return new FileSource(this, uri);
|
| @@ -472,6 +485,21 @@ class _MemoryFolder extends _MemoryResource 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() {
|
| + _provider.newFolder(path);
|
| + }
|
| +
|
| + @override
|
| void delete() {
|
| _provider.deleteFolder(path);
|
| }
|
|
|