@Override
    public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {
        for(Map.Entry<Path, TransferStatus> file : files.entrySet()) {
            try {
                callback.delete(file.getKey());
                final StoregateApiClient client = session.getClient();
                final HttpRequestBase request;
                request = new HttpDelete(String.format("%s/v4.2/files/%s", client.getBasePath(), fileid.getFileId(file.getKey())));
                if(file.getValue().getLockId() != null) {
                    request.addHeader("X-Lock-Id", file.getValue().getLockId().toString());
                }
                request.addHeader(HTTP.CONTENT_TYPE, MEDIA_TYPE);
                final HttpResponse response = client.getClient().execute(request);
                try {
                    switch(response.getStatusLine().getStatusCode()) {
                        case HttpStatus.SC_NO_CONTENT:
                            break;
                        default:
                            throw new StoregateExceptionMappingService(fileid).map("Cannot delete {0}",
                                    new ApiException(response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase()), file.getKey());
                    }
                }
                finally {
                    EntityUtils.consume(response.getEntity());
                }
                fileid.cache(file.getKey(), null);
            }
            catch(IOException e) {
                throw new DefaultIOExceptionMappingService().map("Cannot delete {0}", e, file.getKey());
            }
        }
    }
@Test
    public void testDeleteFolderRoomWithContent() throws Exception {
        final StoregateIdProvider nodeid = new StoregateIdProvider(session);
        final Path room = new StoregateDirectoryFeature(session, nodeid).mkdir(new Path(
            String.format("/My files/%s", new AlphanumericRandomStringService().random()), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
        final Path folder = new StoregateDirectoryFeature(session, nodeid).mkdir(new Path(room,
            new AlphanumericRandomStringService().random().toLowerCase(), EnumSet.of(Path.Type.directory)), new TransferStatus());
        assertTrue(new DefaultFindFeature(session).find(folder));
        final Path file = new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
        new StoregateTouchFeature(session, nodeid).touch(file, new TransferStatus());
        assertTrue(new DefaultFindFeature(session).find(file));
        new StoregateDeleteFeature(session, nodeid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
        assertFalse(new DefaultFindFeature(session).find(folder));
        new StoregateDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
        assertFalse(new DefaultFindFeature(session).find(room));
    }