@Override
    public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {
        final List<Path> deleted = new ArrayList<Path>();
        for(Map.Entry<Path, TransferStatus> entry : files.entrySet()) {
            boolean skip = false;
            final Path file = entry.getKey();
            for(Path d : deleted) {
                if(file.isChild(d)) {
                    skip = true;
                    break;
                }
            }
            if(skip) {
                continue;
            }
            deleted.add(file);
            callback.delete(file);
            try {
                final TransferStatus status = entry.getValue();
                session.getClient().execute(this.toRequest(file, status), new VoidResponseHandler());
            }
            catch(SardineException e) {
                throw new DAVExceptionMappingService().map("Cannot delete {0}", e, file);
            }
            catch(IOException e) {
                throw new HttpExceptionMappingService().map(e, file);
            }
        }
    }
@Test
    public void testDeleteDirectory() throws Exception {
        final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
        new DAVDirectoryFeature(session).mkdir(test, new TransferStatus());
        assertTrue(new DAVFindFeature(session).find(test));
        new DAVTouchFeature(session).touch(new Path(test, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
        new DAVDeleteFeature(session).delete(Collections.singletonMap(test, new TransferStatus()), new DisabledLoginCallback(), new Delete.DisabledCallback());
        assertFalse(new DAVFindFeature(session).find(test));
    }