@Override
    public InputStream read(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {
        try {
            return super.read(file, status, callback);
        }
        catch(AccessDeniedException e) {
            headers.clear();
            return super.read(file, status, callback);
        }
    }
@Test
    public void testReadConcurrency() throws Exception {
        final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        final Local local = new Local(System.getProperty("java.io.tmpdir"), new AlphanumericRandomStringService().random());
        final byte[] content = RandomUtils.nextBytes(1023);
        final OutputStream out = local.getOutputStream(false);
        assertNotNull(out);
        IOUtils.write(content, out);
        out.close();
        new DAVUploadFeature(session).upload(
                test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(),
                new TransferStatus().withLength(content.length),
                new DisabledConnectionCallback());
        final ExecutorService service = Executors.newCachedThreadPool();
        final BlockingQueue<Future<Void>> queue = new LinkedBlockingQueue<>();
        final CompletionService<Void> completion = new ExecutorCompletionService<>(service, queue);
        final int num = 5;
        for(int i = 0; i < num; i++) {
            completion.submit(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
                    assertTrue(new MicrosoftIISDAVFindFeature(session).find(test));
                    assertEquals(content.length, new MicrosoftIISDAVListService(session, new MicrosoftIISDAVAttributesFinderFeature(session)).list(test.getParent(), new DisabledListProgressListener()).get(test).attributes().getSize(), 0L);
                    final TransferStatus status = new TransferStatus();
                    status.setLength(-1L);
                    final InputStream in = new MicrosoftIISDAVReadFeature(session).read(test, status, new DisabledConnectionCallback());
                    assertNotNull(in);
                    final ByteArrayOutputStream buffer = new ByteArrayOutputStream(content.length);
                    new StreamCopier(status, status).transfer(in, buffer);
                    final byte[] reference = new byte[content.length];
                    System.arraycopy(content, 0, reference, 0, content.length);
                    assertArrayEquals(reference, buffer.toByteArray());
                    in.close();
                    return null;
                }
            });
        }
        for(int i = 0; i < num; i++) {
            completion.take().get();
        }
        new DAVDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
        local.delete();
    }