Search in sources :

Example 1 with OptionsInfo

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;
}
Also used : Document(org.w3c.dom.Document) OptionsInfo(org.apache.jackrabbit.webdav.version.OptionsInfo)

Example 2 with OptionsInfo

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);
    }
}
Also used : DeltaVResource(org.apache.jackrabbit.webdav.version.DeltaVResource) SearchResource(org.apache.jackrabbit.webdav.search.SearchResource) OptionsResponse(org.apache.jackrabbit.webdav.version.OptionsResponse) OptionsInfo(org.apache.jackrabbit.webdav.version.OptionsInfo)

Aggregations

OptionsInfo (org.apache.jackrabbit.webdav.version.OptionsInfo)2 SearchResource (org.apache.jackrabbit.webdav.search.SearchResource)1 DeltaVResource (org.apache.jackrabbit.webdav.version.DeltaVResource)1 OptionsResponse (org.apache.jackrabbit.webdav.version.OptionsResponse)1 Document (org.w3c.dom.Document)1