public void delete()

in src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java [592:603]


    public void delete(final @NotNull ResolveContext<JcrProviderState> ctx, final @NotNull Resource resource) throws PersistenceException {
        // try to adapt to Item
        Item item = resource.adaptTo(Item.class);
        try {
            if (item == null) {
                item = getSession(ctx).getItem(resource.getPath());
            }
            item.remove();
        } catch (final RepositoryException e) {
            throw new PersistenceException("Unable to delete resource", e, resource.getPath(), null);
        }
    }