class B2CopyFeature implements Copy {

    @Override
    public Path copy(final Path source, final Path target, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {
        try {
            final B2FileResponse response = session.getClient().copyFile(fileid.getFileid(source, new DisabledListProgressListener()),
                fileid.getFileid(containerService.getContainer(target), new DisabledListProgressListener()),
                containerService.getKey(target));
            return new Path(target.getParent(), target.getName(), target.getType(), new B2AttributesFinderFeature(session, fileid).toAttributes(response));
        }
        catch(B2ApiException e) {
            throw new B2ExceptionMappingService().map("Cannot copy {0}", e, source);
        }
        catch(IOException e) {
            throw new DefaultIOExceptionMappingService().map(e);
        }
    }

    public  B2CopyFeature(final B2Session session, final B2FileidProvider fileid);

}