Package org.apache.webdav.lib

Examples of org.apache.webdav.lib.WebdavResource


            SourceValidity extraValidity = makeWebdavEventValidity(url);
            if(extraValidity!=null && m_validity!=null)
              m_validity.add(extraValidity);
            // end eventcaching stuff
           
            WebdavResource resource = new WebdavResource(new HttpURL(this.targetUrl));
            if(!resource.exists()) {
                throw new SAXException("The WebDAV resource don't exist");
            }
            optionsMethod.execute(state, conn);
            if(!optionsMethod.isAllowed("SEARCH")) {
                throw new SAXException("The server doesn't support the SEARCH method");
View Full Code Here


            this.getLogger().debug("getting content of: " + uri);
        }

        try {

            WebdavResource resource = WebDAVUtil.getWebdavResource(this.getAbsoluteURI(uri));
            if (!resource.exists()) {
                throw new HttpException(uri + " does not exist");
            }
            return new BufferedInputStream(resource.getMethodData());

        } catch (MalformedURLException mue) {
            throw new ProcessingException ("Bad URL for resource: " + this.repoBaseUrl + uri, mue);
        } catch (IOException ioe) {
            throw new ProcessingException ("Error loading resource: " + this.repoBaseUrl + uri, ioe);
View Full Code Here

            staticResource.discoverOwnLocks();
            return staticResource;           
        }
        HttpURL sourceURL = new HttpURL(uri);
        staticURI = uri;
        staticResource = new WebdavResource(sourceURL);
        staticResource.discoverOwnLocks();
        return staticResource;
    }
View Full Code Here

    throws HttpException, IOException {

        final String filename = uri.substring(uri.lastIndexOf("/"));
        final String uriPrefix = uri.substring(0, uri.lastIndexOf("/") + 1);
        final HttpURL sourceURL = new HttpURL(uri);                                                                  
        final WebdavResource resource = getWebdavResource(uriPrefix);
                       
        if(!resource.putMethod(uriPrefix + filename, content)) {
            throw new HttpException("Error creating resource: " + uri
                                    + " Status: " + resource.getStatusCode()
                                    + " Message: " + resource.getStatusMessage());
        }
    }
View Full Code Here

        // make parentCollection of target if not existant
        if (recurse) WebDAVUtil.makePath(to.substring(0, to.lastIndexOf("/")));

        // copy the resource
        WebdavResource resource = WebDAVUtil.getWebdavResource(from);
        resource.setOverwrite(overwrite);
        if (!resource.copyMethod(relativeDestination)) {
            throw new HttpException("Error copying resource: " + from
                                    + " Status: " + resource.getStatusCode()
                                    + " Message: " + resource.getStatusMessage());
        }
    }
View Full Code Here

        // make parentCollection if not existant
        if (recurse) WebDAVUtil.makePath(to.substring(0, to.lastIndexOf("/")));

        // move the resource
        WebdavResource resource = WebDAVUtil.getWebdavResource(from);
        resource.setOverwrite(overwrite);
        if (!resource.moveMethod(relativeDestination)) {
            throw new HttpException("Error moving resource: " + from
                                    + " Status: " + resource.getStatusCode()
                                    + " Message: " + resource.getStatusMessage());
        }
    }
View Full Code Here

        String parentPath = path;
        while (true) {

            try {
                HttpURL sourceURL = new HttpURL(parentPath+"/");
                new WebdavResource(sourceURL);

                // if code reaches here, pathUrl exists
                break;
            } catch (HttpException he) {
                parentPath = parentPath.substring(0, parentPath.lastIndexOf("/"));
View Full Code Here

     * @throws IOException
     */
    static public void makeCollection(String parent, String collection)
    throws HttpException, IOException {

        WebdavResource parentResource = WebDAVUtil.getWebdavResource(parent);
        parentResource.mkcolMethod(parent + collection + "/");
    }
View Full Code Here

        Vector propNames = new Vector(1);
        propNames.add(new PropertyName(namespace,name));
        Enumeration props= null;
        Property prop = null;
        WebdavResource resource = WebDAVUtil.getWebdavResource(uri);
        Enumeration responses = resource.propfindMethod(0, propNames);
        while (responses.hasMoreElements()) {
            ResponseEntity response = (ResponseEntity)responses.nextElement();
            props = response.getProperties();
            if (props.hasMoreElements()) {
                prop = (Property) props.nextElement();
View Full Code Here

        List sourceproperties = new ArrayList();
        Enumeration responses = null;
        Enumeration props = null;
        Property prop = null;
        Map propertiesMap = new HashMap();
        WebdavResource resource = WebDAVUtil.getWebdavResource(uri);
        responses = resource.propfindMethod(0, new Vector(propNames));
        while (responses.hasMoreElements()) {
            ResponseEntity response = (ResponseEntity)responses.nextElement();
            props = response.getProperties();
            while (props.hasMoreElements()) {
                prop = (Property) props.nextElement();
View Full Code Here

TOP

Related Classes of org.apache.webdav.lib.WebdavResource

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.