@Override
    public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {
        for(Path f : files.keySet()) {
            try {
                if(f.isDirectory()) {
                    new FoldersApi(new BoxApiClient(session.getClient())).deleteFoldersId(fileid.getFileId(f), null, true);
                }
                else {
                    new FilesApi(new BoxApiClient(session.getClient())).deleteFilesId(fileid.getFileId(f), null);
                }
            }
            catch(ApiException e) {
                throw new BoxExceptionMappingService(fileid).map("Cannot delete {0}", e, f);
            }
        }
    }
@Test
    public void testDeleteFolder() throws Exception {
        final BoxFileidProvider fileid = new BoxFileidProvider(session);
        final Path directory = new BoxDirectoryFeature(session, fileid).mkdir(new Path(
                new AlphanumericRandomStringService().random(), EnumSet.of(AbstractPath.Type.directory)), new TransferStatus());
        assertTrue(new BoxFindFeature(session, fileid).find(directory, new DisabledListProgressListener()));
        new BoxDeleteFeature(session, fileid).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
        assertFalse((new BoxFindFeature(session, fileid).find(directory, new DisabledListProgressListener())));
    }