@Override
    public InputStream read(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {
        try {
            if(log.isWarnEnabled()) {
                log.warn(String.format("Disable checksum verification for %s", file));
                // Do not set checksum when metadata key X-Static-Large-Object is present. Disable checksum verification in download filter.
                status.setChecksum(Checksum.NONE);
            }
            final Response response;
            if(status.isAppend()) {
                final HttpRange range = HttpRange.withStatus(status);
                if(TransferStatus.UNKNOWN_LENGTH == range.getEnd()) {
                    response = session.getClient().getObject(regionService.lookup(file),
                            containerService.getContainer(file).getName(), containerService.getKey(file),
                            range.getStart());
                }
                else {
                    response = session.getClient().getObject(regionService.lookup(file),
                            containerService.getContainer(file).getName(), containerService.getKey(file),
                            range.getStart(), range.getLength());
                }
            }
            else {
                response = session.getClient().getObject(regionService.lookup(file),
                        containerService.getContainer(file).getName(), containerService.getKey(file));
            }
            return new HttpMethodReleaseInputStream(response.getResponse(), status);
        }
        catch(GenericException e) {
            throw new SwiftExceptionMappingService().map("Download {0} failed", e, file);
        }
        catch(IOException e) {
            throw new DefaultIOExceptionMappingService().map(e, file);
        }
    }
@Test
    public void testReadCloseReleaseEntity() throws Exception {
        final TransferStatus status = new TransferStatus();
        final Path container = new Path(".ACCESS_LOGS", EnumSet.of(Path.Type.directory, Path.Type.volume));
        container.attributes().setRegion("DFW");
        final SwiftRegionService regionService = new SwiftRegionService(session);
        final CountingInputStream in = new CountingInputStream(new SwiftReadFeature(session, regionService).read(new Path(container,
            "/cdn.cyberduck.ch/2015/03/01/10/3b1d6998c430d58dace0c16e58aaf925.log.gz",
            EnumSet.of(Path.Type.file)), status, new DisabledConnectionCallback()));
        in.close();
        assertEquals(0L, in.getByteCount(), 0L);
    }