use of org.apache.jackrabbit.webdav.security.AclResource in project jackrabbit by apache.
the class AbstractWebdavServlet method doAcl.
/**
* The ACL method
*
* @param request
* @param response
* @param resource
* @throws DavException
* @throws IOException
*/
protected void doAcl(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException {
if (!(resource instanceof AclResource)) {
response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
return;
}
Document doc = request.getRequestDocument();
if (doc == null) {
throw new DavException(DavServletResponse.SC_BAD_REQUEST, "ACL request requires a DAV:acl body.");
}
AclProperty acl = AclProperty.createFromXml(doc.getDocumentElement());
((AclResource) resource).alterAcl(acl);
}
use of org.apache.jackrabbit.webdav.security.AclResource in project jackrabbit by apache.
the class AbstractWebdavServlet method doReport.
/**
* The REPORT method
*
* @param request
* @param response
* @param resource
* @throws DavException
* @throws IOException
*/
protected void doReport(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException {
ReportInfo info = request.getReportInfo();
Report report;
if (resource instanceof DeltaVResource) {
report = ((DeltaVResource) resource).getReport(info);
} else if (resource instanceof AclResource) {
report = ((AclResource) resource).getReport(info);
} else {
response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
return;
}
int statusCode = (report.isMultiStatusReport()) ? DavServletResponse.SC_MULTI_STATUS : DavServletResponse.SC_OK;
addHintAboutPotentialRequestEncodings(request, response);
response.sendXmlResponse(report, statusCode, acceptsGzipEncoding(request) ? Collections.singletonList("gzip") : Collections.emptyList());
}
Aggregations