@Override
    public Path move(final Path source, final Path target, final TransferStatus status, final Delete.Callback callback,
                     final ConnectionCallback connectionCallback) throws BackgroundException {
        if(containerService.isContainer(source)) {
            if(new SimplePathPredicate(source.getParent()).test(target.getParent())) {
                // Rename only
                return proxy.move(source, target, status, callback, connectionCallback);
            }
        }
        if(new SDSTripleCryptEncryptorFeature(session, nodeid).isEncrypted(source) ^ new SDSTripleCryptEncryptorFeature(session, nodeid).isEncrypted(containerService.getContainer(target))) {
            // Moving into or from an encrypted room
            final Copy copy = new SDSDelegatingCopyFeature(session, nodeid, new SDSCopyFeature(session, nodeid));
            if(log.isDebugEnabled()) {
                log.debug(String.format("Move %s to %s using copy feature %s", source, target, copy));
            }
            final Path c = copy.copy(source, target, status, connectionCallback, new DisabledStreamListener());
            // Delete source file after copy is complete
            final Delete delete = new SDSDeleteFeature(session, nodeid);
            if(delete.isSupported(source)) {
                log.warn(String.format("Delete source %s copied to %s", source, target));
                delete.delete(Collections.singletonMap(source, status), connectionCallback, callback);
            }
            return c;
        }
        else {
            return proxy.move(source, target, status, callback, connectionCallback);
        }
    }
@Test
    public void testMoveToDifferentParentAndRename() 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 String filename = new AlphanumericRandomStringService().random();
        final Path test = new SDSTouchFeature(session, nodeid).touch(new Path(room, filename, EnumSet.of(Path.Type.file)), new TransferStatus());
        final Path target = new SDSTouchFeature(session, nodeid).touch(new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
        new SDSMoveFeature(session, nodeid).move(test, target, new TransferStatus().exists(true), new Delete.DisabledCallback(), new DisabledConnectionCallback());
        assertFalse(new SDSFindFeature(session, nodeid).find(new Path(room, filename, EnumSet.of(Path.Type.file))));
        assertTrue(new SDSFindFeature(session, nodeid).find(target));
        new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }