use of org.apache.jackrabbit.webdav.version.OptionsInfo in project jackrabbit by apache.
the class WebdavRequestImpl method getOptionsInfo.
/**
* @see org.apache.jackrabbit.webdav.version.DeltaVServletRequest#getOptionsInfo()
*/
public OptionsInfo getOptionsInfo() throws DavException {
OptionsInfo info = null;
Document requestDocument = getRequestDocument();
if (requestDocument != null) {
info = OptionsInfo.createFromXml(requestDocument.getDocumentElement());
}
return info;
}
use of org.apache.jackrabbit.webdav.version.OptionsInfo in project jackrabbit by apache.
the class AbstractWebdavServlet method doOptions.
/**
* The OPTION method
*
* @param request
* @param response
* @param resource
*/
protected void doOptions(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException {
response.addHeader(DavConstants.HEADER_DAV, resource.getComplianceClass());
response.addHeader("Allow", resource.getSupportedMethods());
response.addHeader("MS-Author-Via", DavConstants.HEADER_DAV);
if (resource instanceof SearchResource) {
String[] langs = ((SearchResource) resource).getQueryGrammerSet().getQueryLanguages();
for (String lang : langs) {
response.addHeader(SearchConstants.HEADER_DASL, "<" + lang + ">");
}
}
// with DeltaV the OPTIONS request may contain a Xml body.
OptionsResponse oR = null;
OptionsInfo oInfo = request.getOptionsInfo();
if (oInfo != null && resource instanceof DeltaVResource) {
oR = ((DeltaVResource) resource).getOptionResponse(oInfo);
}
if (oR == null) {
response.setStatus(DavServletResponse.SC_OK);
} else {
response.sendXmlResponse(oR, DavServletResponse.SC_OK);
}
}
Aggregations