@Override
    public Path copy(final Path file, final Path target, final TransferStatus status, final ConnectionCallback callback, final StreamListener listener) throws BackgroundException {
        try {
            if(status.isExists()) {
                if(log.isWarnEnabled()) {
                    log.warn(String.format("Delete file %s to be replaced with %s", target, file));
                }
                new DeepboxTrashFeature(session, fileid).delete(Collections.singletonList(target), callback, new Delete.DisabledCallback());
            }
            final NodeCopy nodeCopy = new NodeCopy();
            nodeCopy.setTargetParentNodeId(fileid.getFileId(target.getParent()));
            final String nodeId = fileid.getFileId(file);
            // manually patched deepbox-api.json, return code 200 missing in theirs
            final Node copied = new CoreRestControllerApi(session.getClient()).copyNode(nodeCopy, nodeId);
            final NodeUpdate nodeUpdate = new NodeUpdate();
            nodeUpdate.setName(target.getName());
            new CoreRestControllerApi(session.getClient()).updateNode(nodeUpdate, copied.getNodeId());
            listener.sent(status.getLength());
            return target.withAttributes(new DeepboxAttributesFinderFeature(session, fileid).toAttributes(copied));
        }
        catch(ApiException e) {
            throw new DeepboxExceptionMappingService(fileid).map("Cannot copy {0}", e, file);
        }
    }
@Test
    public void testMoveNotFound() {
        final DeepboxIdProvider fileid = new DeepboxIdProvider(session);
        final Path documents = new Path("/ORG 4 - DeepBox Desktop App/ORG3:Box1/Documents/", EnumSet.of(Path.Type.directory, Path.Type.volume));
        final Path test = new Path(documents, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        assertThrows(NotfoundException.class, () ->
                new DeepboxCopyFeature(session, fileid).copy(test, new Path(documents, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus(),
                        new DisabledLoginCallback(), new DisabledStreamListener()));
    }