class DropboxDeleteFeature implements Delete {

    @Override
    public void delete(final Map<Path, TransferStatus> files, final PasswordCallback prompt, final Callback callback) throws BackgroundException {
        for(Path file : files.keySet()) {
            try {
                callback.delete(file);
                // Delete the file or folder at a given path. If the path is a folder, all its contents will be deleted too.
                if(containerService.isContainer(file)) {
                    new DbxUserFilesRequests(session.getClient(file.getParent())).deleteV2(file.getAbsolute());
                }
                else {
                    new DbxUserFilesRequests(session.getClient(file)).deleteV2(containerService.getKey(file));
                }
            }
            catch(DbxException e) {
                throw new DropboxExceptionMappingService().map("Cannot delete {0}", e, file);
            }
        }
    }

    public  DropboxDeleteFeature(final DropboxSession session);

}