Search in sources :

Example 6 with PreConditionFailedException

use of io.milton.http.exceptions.PreConditionFailedException in project lobcder by skoulouzis.

the class UnlockHandler method processExistingResource.

private void processExistingResource(HttpManager manager, Request request, Response response, Resource resource) throws NotAuthorizedException, BadRequestException, ConflictException {
    LockableResource r = (LockableResource) resource;
    String sToken = request.getLockTokenHeader();
    sToken = parseToken(sToken);
    // }
    try {
        r.unlock(sToken);
        responseHandler.respondNoContent(resource, response, request);
    } catch (PreConditionFailedException ex) {
        responseHandler.respondPreconditionFailed(request, response, resource);
    }
}
Also used : LockableResource(io.milton.resource.LockableResource) PreConditionFailedException(io.milton.http.exceptions.PreConditionFailedException)

Aggregations

PreConditionFailedException (io.milton.http.exceptions.PreConditionFailedException)6 BadRequestException (io.milton.http.exceptions.BadRequestException)4 LockedException (io.milton.http.exceptions.LockedException)4 IOException (java.io.IOException)4 NotAuthorizedException (io.milton.http.exceptions.NotAuthorizedException)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)3 URISyntaxException (java.net.URISyntaxException)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 LockableResource (io.milton.resource.LockableResource)2 Path (io.milton.common.Path)1 LockingCollectionResource (io.milton.resource.LockingCollectionResource)1 Resource (io.milton.resource.Resource)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 LogicalData (nl.uva.cs.lobcder.resources.LogicalData)1 SAXException (org.xml.sax.SAXException)1