class DropboxReadFeature implements Read {

    @Override
    public InputStream read(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {
        try {
            final DownloadBuilder builder = new DbxUserFilesRequests(session.getClient(file)).downloadBuilder(containerService.getKey(file));
            if(status.isAppend()) {
                final HttpRange range = HttpRange.withStatus(status);
                builder.range(range.getStart());
            }
            final DbxDownloader<FileMetadata> downloader = builder.start();
            return downloader.getInputStream();
        }
        catch(DbxException e) {
            throw new DropboxExceptionMappingService().map("Download {0} failed", e, file);
        }
    }

    public  DropboxReadFeature(final DropboxSession session);

}