/** * Delete a tombstone resource (freeing the original resource to be reused) * @return the free resource */ @DELETE public Response delete() { LOGGER.info("Delete tombstone: {}", resource()); resource().delete(); session.commit(); return noContent().build(); }
/** * Deletes an object. * * @return response */ @DELETE public Response deleteObject() { hasRestrictedPath(externalPath); if (resource() instanceof Container) { final String depth = headers.getHeaderString("Depth"); LOGGER.debug("Depth header value is: {}", depth); if (depth != null && !depth.equalsIgnoreCase("infinity")) { throw new ClientErrorException("Depth header, if present, must be set to 'infinity' for containers", SC_BAD_REQUEST); } } evaluateRequestPreconditions(request, servletResponse, resource(), session); LOGGER.info("Delete resource '{}'", externalPath); final AcquiredLock lock = lockManager.lockForDelete(resource().getPath()); try { resource().delete(); session.commit(); return noContent().build(); } finally { lock.release(); } }
/** * Deletes an object. * * @return response */ @DELETE public Response deleteObject() throws ItemNotFoundException { hasRestrictedPath(externalPath); LOGGER.info("Delete resource '{}'", externalPath); final AcquiredLock lock = lockManager.lockForDelete(resource().getPath()); try { final FedoraResource aclResource = resource().getAcl(); if (aclResource != null) { aclResource.delete(); } session.commit(); if (aclResource == null) { if (resource().hasType(FEDORA_REPOSITORY_ROOT)) { throw new ClientErrorException("The default root ACL is system generated and cannot be deleted. " + "To override the default root ACL you must PUT a user-defined ACL to this endpoint.", CONFLICT); } throw new ItemNotFoundException(); } return noContent().build(); } finally { lock.release(); } }
(requestBodyStream == null || requestContentType == null)); session.commit(); } catch (final Exception e) { checkForInsufficientStorageException(e, e);
session.commit();
patchResourcewithSparql(resource(), requestBody, resourceTriples); session.commit();
patchResourcewithSparql(aclResource, requestBody, resourceTriples); session.commit();
session.commit(); return createUpdateResponse(memento, true); } catch (final Exception e) {
session.commit(); return created(new URI(destinationUri)).build(); } catch (final RepositoryRuntimeException e) {
"or other RDF compatible type."); session.commit(); } finally { lock.release();
(requestBodyStream == null || requestContentType == null)); session.commit(); return createUpdateResponse(resource, created);