Package org.apache.jackrabbit.webdav

Examples of org.apache.jackrabbit.webdav.DavException


    public void init(DavResource resource, ReportInfo info) throws DavException {
        super.init(resource, info);
        // build the DAV:responses objects.
        DavProperty<?> acl = resource.getProperty(SecurityConstants.ACL);
        if (!(acl instanceof AclProperty)) {
            throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "DAV:acl property expected.");
        }

        DavResourceLocator loc = resource.getLocator();
        Map<String, MultiStatusResponse> respMap = new HashMap<String, MultiStatusResponse>();
        List<AclProperty.Ace> list = (List<AclProperty.Ace>) ((AclProperty)acl).getValue();
View Full Code Here


     * or not a DAV:options element.
     */
    public static OptionsInfo createFromXml(Element optionsElement) throws DavException {
        if (!DomUtil.matches(optionsElement, DeltaVConstants.XML_OPTIONS, DeltaVConstants.NAMESPACE)) {
            log.warn("DAV:options element expected");
            throw new DavException(DavServletResponse.SC_BAD_REQUEST);
        }
        OptionsInfo oInfo = new OptionsInfo();
        ElementIterator it = DomUtil.getChildren(optionsElement);
        while (it.hasNext()) {
            // todo: not correct since assuming its the deltaV-namespace
View Full Code Here

            HttpClient client = getClient(sessionInfo);
            client.executeMethod(method);

            int status = method.getStatusCode();
            if (status != DavServletResponse.SC_OK) {
                throw ExceptionConverter.generate(new DavException(status, method.getStatusText()));
            }

            Path path = uriResolver.getQPath(uri, sessionInfo);

            String ct = null;
View Full Code Here

            Report report = (Report) reportClass.newInstance();
            report.init(resource, info);
            return report;
        } catch (Exception e) {
            // should never occur
            throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "Failed to register Report.");
        }
    }
View Full Code Here

            String txId = request.getTransactionId();
            String subscriptionId = request.getSubscriptionId();
            String lockToken = request.getLockToken();

            if ((lockToken != null || txId != null) && subscriptionId != null) {
                throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED, "Ambiguous headers: either TransactionId/Lock-Token or SubscriptionId can be present, not both.");
            }

            DavSession session = null;
            // try to retrieve a cached session
            if (lockToken != null && containsReference(lockToken)) {
View Full Code Here

                throw new JcrDavException(e);
            } catch (RepositoryException e) {
                // RepositoryException results in FORBIDDEN
                throw new JcrDavException(e);
            } catch (ServletException e) {
                throw new DavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
            }
        }
View Full Code Here

     */
    private void setResource(DavResource resource) throws DavException {
        if (resource != null && (resource instanceof VersionControlledResource || resource instanceof VersionResource)) {
            this.resource = resource;
        } else {
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "DAV:version-tree report can only be created for version-controlled resources and version resources.");
        }
    }
View Full Code Here

     * @throws DavException if the given <code>ReportInfo</code>
     * does not contain a DAV:version-tree element.
     */
    private void setInfo(ReportInfo info) throws DavException {
        if (!getType().isRequestedReportType(info)) {
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "DAV:version-tree element expected.");
        }
        this.info = info;
    }
View Full Code Here

     * @param resource
     * @throws DavException if the specified resource is <code>null</code>
     */
    private void setResource(DavResource resource) throws DavException {
        if (resource == null) {
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "The resource specified must not be null.");
        }
        this.resource = resource;
    }
View Full Code Here

     * @throws DavException if the given <code>ReportInfo</code>
     * does not contain a DAV:expand-property element.
     */
    private void setInfo(ReportInfo info) throws DavException {
        if (info == null) {
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "The report info specified must not be null.");
        }
        if (!getType().isRequestedReportType(info)) {
            throw new DavException(DavServletResponse.SC_BAD_REQUEST, "DAV:expand-property element expected.");
        }
        this.info = info;
        propertyElements = info.getContentElements(XML_PROPERTY, NAMESPACE).iterator();
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.webdav.DavException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.