use of org.apache.archiva.repository.ItemDeleteStatus in project archiva by apache.
the class ManagedDefaultRepositoryContent method deleteAllItems.
@Override
public void deleteAllItems(ItemSelector selector, Consumer<ItemDeleteStatus> consumer) throws ContentAccessException, IllegalArgumentException {
try (Stream<? extends ContentItem> stream = newItemStream(selector, false)) {
stream.forEach(item -> {
try {
deleteItem(item);
consumer.accept(new ItemDeleteStatus(item));
} catch (ItemNotFoundException e) {
consumer.accept(new ItemDeleteStatus(item, ItemDeleteStatus.ITEM_NOT_FOUND, e));
} catch (Exception e) {
consumer.accept(new ItemDeleteStatus(item, ItemDeleteStatus.DELETION_FAILED, e));
} catch (Throwable e) {
consumer.accept(new ItemDeleteStatus(item, ItemDeleteStatus.UNKNOWN, e));
}
});
}
}
Aggregations