Examples of WebdavException


Examples of org.apache.slide.webdav.WebdavException

                        (AbstractReport)cls.getConstructor(parmtypes).newInstance(initargs);
                }
                catch( Exception e ) {
                    int statusCode = WebdavStatus.SC_BAD_REQUEST;
                    sendError( statusCode, new Exception("Cannot create report worker "+clsName) );
                    throw new WebdavException( statusCode );
                }
            }
        }
        return result;
    }
View Full Code Here

Examples of org.apache.slide.webdav.WebdavException

        // check lock-null resources
        try {
            if (isLockNull(resourcePath)) {
                int statusCode = WebdavStatus.SC_NOT_FOUND;
                sendError( statusCode, "lock-null resource", new Object[]{resourcePath} );
                throw new WebdavException( statusCode );
            }
        }
        catch (ServiceAccessException e) {
            int statusCode = getErrorCode( e );
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
       
        try {
            reportWorker.checkPreconditions(resourcePath, getDepth());
            Element rootElm;
            if (reportWorker instanceof PrincipalSearchPropertySetReport) {
                rootElm = new Element(E_PRINCIPAL_SEARCH_PROPERTY_SET, DNSP);
                reportWorker.execute(resourcePath, rootElm, getDepth());
                resp.setStatus(WebdavStatus.SC_OK);
            }
            else {
                rootElm = new Element(E_MULTISTATUS, DNSP);
                reportWorker.execute(resourcePath, rootElm, getDepth());
                resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
            }
            new XMLOutputter(XML_REPONSE_INDENT, true).
                output(new Document(rootElm), resp.getWriter());
        }
        catch (PreconditionViolationException e) {
            sendPreconditionViolation(e);
            throw e;
        }
        catch (Exception e) {
            int statusCode = getErrorCode( e );
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
    }
View Full Code Here

Examples of org.apache.slide.webdav.WebdavException

        // check lock-null resources
        try {
            if (isLockNull(resourcePath)) {
                int statusCode = WebdavStatus.SC_NOT_FOUND;
                sendError( statusCode, "lock-null resource", new Object[]{resourcePath} );
                throw new WebdavException( statusCode );
            }
        }
        catch (ServiceAccessException e) {
            int statusCode = getErrorCode((Exception)e);
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }

        try {
            VersioningHelper vh = VersioningHelper.getVersioningHelper(
                slideToken, token, req, resp, getConfig() );
            vh.mkworkspace( resourcePath );
        }
        catch (PreconditionViolationException e) {
            sendPreconditionViolation(e);
            throw e;
        }
        catch (Exception e) {
            int statusCode = getErrorCode( e );
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
        finally {
            resp.setHeader(H_CACHE_CONTROL, NO_CACHE);
        }
    }
View Full Code Here

Examples of org.apache.slide.webdav.WebdavException

       
        depth = requestHeaders.getDepth(INFINITY);
        if (depth != 0 && depth != INFINITY) {
            int sc = WebdavStatus.SC_PRECONDITION_FAILED;
            sendError( sc, "Invalid header Depth: "+depth );
            throw new WebdavException( sc );
        }
       
        lockDuration = requestHeaders.getTimeout(MAX_TIMEOUT);
       
        if (req.getContentLength() > 0) {
View Full Code Here

Examples of org.apache.slide.webdav.WebdavException

            parseOwner(lockOwnerElement);
        }
        catch (JDOMException e) {
            int statusCode = WebdavStatus.SC_BAD_REQUEST;
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
        catch (IOException e) {
            int statusCode = WebdavStatus.SC_INTERNAL_SERVER_ERROR;
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
    }
View Full Code Here

Examples of org.apache.slide.webdav.WebdavException

                            resp.getWriter().write(errorMessage);
                        } catch(IOException ex) {
                            // Critical error ... Servlet container is dead or something
                            int statusCode = WebdavStatus.SC_INTERNAL_SERVER_ERROR;
                            sendError( statusCode, e );
                            throw new WebdavException( statusCode );
                        }
                    } else {
                        // Returning 207 on non-collection requests is generally
                        // considered bad. So let's not do it, since this way
                        // makes clients generally behave better.
                        resp.setStatus(WebdavStatus.SC_LOCKED);
                    }
                    //
                    // make sure the transaction is aborted
                    // throw any WebDAV exception to indicate the transaction wants to be aborted
                    //
                    throw new WebdavException(WebdavStatus.SC_ACCEPTED, false);
                } catch (Exception e) {
                    int statusCode = getErrorCode( e );
                    sendError( statusCode, e );
                    throw new WebdavException( statusCode );
                }
               
                break;
               
            case LOCK_REFRESH:
               
                try {
                   
                    Enumeration lockTokens =
                        lock.enumerateLocks(slideToken, lockInfo_lockSubject, false);
                   
                    NodeLock currentLockToken = null;
                    Date newExpirationDate =
                        new Date((new Date()).getTime() + ((long)lockDuration * 1000L));
                    while (lockTokens.hasMoreElements()) {
                        currentLockToken = (NodeLock) lockTokens.nextElement();
                        lock.renew(slideToken, currentLockToken,
                                   newExpirationDate);
                    }
                   
                    showLockDiscoveryInfo(currentLockToken);
                   
                } catch (SlideException e) {
                    int statusCode = WebdavStatus.SC_PRECONDITION_FAILED;
                    sendError( statusCode, e );
                    throw new WebdavException( statusCode );
                }
               
                break;
               
        }
View Full Code Here

Examples of org.apache.slide.webdav.WebdavException

            new org.jdom.output.XMLOutputter(XML_REPONSE_INDENT, true).output(new org.jdom.Document(prop), writer);
            writer.flush();
        } catch (Exception e) {
            int statusCode = WebdavStatus.SC_INTERNAL_SERVER_ERROR;
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
       
       
    }
View Full Code Here

Examples of org.apache.slide.webdav.WebdavException

            }
        }
        catch (IOException e) {  // TODO: merge exception handling into jdom access methods
            int statusCode = WebdavStatus.SC_INTERNAL_SERVER_ERROR;
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
        catch (JDOMException e) {  // TODO: merge exception handling into jdom access methods
            int statusCode = WebdavStatus.SC_BAD_REQUEST;
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
        catch (PreconditionViolationException e) {
            try {
                sendPreconditionViolation(e);
            } catch (IOException x) {}
            throw new WebdavException(e.getStatusCode());
        }
    }
View Full Code Here

Examples of org.apache.slide.webdav.WebdavException

        // check lock-null resources
        try {
            if (isLockNull(resourcePath)) {
                int statusCode = WebdavStatus.SC_NOT_FOUND;
                sendError( statusCode, "lock-null resource", new Object[]{resourcePath} );
                throw new WebdavException( statusCode );
            }
        }
        catch (ServiceAccessException e) {
            int statusCode = getErrorCode( e );
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
       
        try {
            checkPreconditions();
            security.setPermissions(slideToken, resourcePath, permissions.elements());
        }
        catch (PreconditionViolationException e) {
            sendPreconditionViolation(e);
            throw e;
        }
        catch (Exception e) {
            int statusCode = getErrorCode( e );
            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
    }
View Full Code Here

Examples of org.apache.webdav.lib.WebdavException

         case WebdavStatus.SC_MULTI_STATUS:
            Property p = findProperty(propFind, RESOURCETYPE, httpURL.getPath());
            if (p instanceof ResourceTypeProperty) {
               return ((ResourceTypeProperty)p).isCollection();
            } else {
               throw new WebdavException("PROPFFIND does not return resourcetype");
            }
         case WebdavStatus.SC_NOT_FOUND:
            return false;
         default:
            HttpException ex = new HttpException();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.