use of org.apache.jackrabbit.webdav.bind.BindableResource in project jackrabbit by apache.
the class AbstractWebdavServlet method doRebind.
/**
* The REBIND method
*
* @param request
* @param response
* @param resource the collection resource to which a new member will be added
* @throws IOException
* @throws DavException
*/
protected void doRebind(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException {
if (!resource.exists()) {
response.sendError(DavServletResponse.SC_NOT_FOUND);
}
RebindInfo rebindInfo = request.getRebindInfo();
DavResource oldBinding = getResourceFactory().createResource(request.getHrefLocator(rebindInfo.getHref()), request, response);
if (!(oldBinding instanceof BindableResource)) {
response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
return;
}
DavResource newBinding = getResourceFactory().createResource(request.getMemberLocator(rebindInfo.getSegment()), request, response);
int status = validateDestination(newBinding, request, false);
if (status > DavServletResponse.SC_NO_CONTENT) {
response.sendError(status);
return;
}
((BindableResource) oldBinding).rebind(resource, newBinding);
response.setStatus(status);
}
use of org.apache.jackrabbit.webdav.bind.BindableResource in project jackrabbit by apache.
the class AbstractWebdavServlet method doBind.
/**
* The BIND method
*
* @param request
* @param response
* @param resource the collection resource to which a new member will be added
* @throws IOException
* @throws DavException
*/
protected void doBind(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException {
if (!resource.exists()) {
response.sendError(DavServletResponse.SC_NOT_FOUND);
}
BindInfo bindInfo = request.getBindInfo();
DavResource oldBinding = getResourceFactory().createResource(request.getHrefLocator(bindInfo.getHref()), request, response);
if (!(oldBinding instanceof BindableResource)) {
response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
return;
}
DavResource newBinding = getResourceFactory().createResource(request.getMemberLocator(bindInfo.getSegment()), request, response);
int status = validateDestination(newBinding, request, false);
if (status > DavServletResponse.SC_NO_CONTENT) {
response.sendError(status);
return;
}
((BindableResource) oldBinding).bind(resource, newBinding);
response.setStatus(status);
}
Aggregations