@Override
    public Path copy(final Path source, final Path target, final TransferStatus status, final ConnectionCallback callback, final StreamListener listener) throws BackgroundException {
        if(proxy.isSupported(source, target)) {
            return proxy.copy(source, target, status, callback, listener);
        }
        // Copy between encrypted and unencrypted data room
        if(new SDSTripleCryptEncryptorFeature(session, nodeid).isEncrypted(containerService.getContainer(target))) {
            // File key must be set for new upload
            status.setFilekey(SDSTripleCryptEncryptorFeature.generateFileKey());
        }
        final Path result = copy.copy(source, target, status, callback, listener);
        nodeid.cache(target, null);
        return result.withAttributes(new SDSAttributesFinderFeature(session, nodeid).find(result));
    }
@Test
    public void testCopyWithRenameToExistingFile() throws Exception {
        final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
        final Path room = new SDSDirectoryFeature(session, nodeid).mkdir(
            new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
        final Path folder = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
        new SDSDirectoryFeature(session, nodeid).mkdir(folder, new TransferStatus());
        final Path test = new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        new SDSTouchFeature(session, nodeid).touch(test, new TransferStatus());
        final Path copy = new Path(folder, test.getName(), EnumSet.of(Path.Type.file));
        final SDSCopyFeature proxy = new SDSCopyFeature(session, nodeid);
        final SDSDelegatingCopyFeature feature = new SDSDelegatingCopyFeature(session, nodeid, proxy);
        assertFalse(proxy.isSupported(test, copy));
        assertTrue(feature.isSupported(test, copy));
        assertNotNull(feature.copy(test, copy, new TransferStatus().exists(true), new DisabledConnectionCallback(), new DisabledStreamListener()).attributes().getVersionId());
        final Find find = new DefaultFindFeature(session);
        final AttributedList<Path> files = new SDSListService(session, nodeid).list(folder, new DisabledListProgressListener());
        assertTrue(find.find(copy));
        new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }