Package org.apache.webdav.lib

Examples of org.apache.webdav.lib.WebdavResource


        // 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

     */
    static public List getAllProperties(String uri)
    throws HttpException, IOException {

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

     * @throws IOException
     */
    static public void setProperty(String uri, String name, String namespace, String value)
    throws HttpException, IOException {

        WebdavResource resource = WebDAVUtil.getWebdavResource(uri);
        if(!resource.proppatchMethod(new PropertyName(namespace, name), value, true)) {
            throw new HttpException("Error setting property " + namespace + ":" + name + " on resource: " + uri
                                    + " Status: " + resource.getStatusCode()
                                    + " Message: " + resource.getStatusMessage());
        }
    }
View Full Code Here

     * @throws IOException
     */
    static public void setProperties(String uri, Map properties)
    throws HttpException, IOException {

        WebdavResource resource = WebDAVUtil.getWebdavResource(uri);
        if (!resource.proppatchMethod(new Hashtable(properties), true)) {
            throw new HttpException("Error setting properties on resource: " + uri
                                    + " Status: " + resource.getStatusCode()
                                    + " Message: " + resource.getStatusMessage());
        }
    }
View Full Code Here

                update = true;
            } else {
                depth = this.depth;
            }
            if (this.resource == null) {
                this.resource = new WebdavResource(this.url, action, depth);
            } else if (update) {
                this.resource.setProperties(action, depth);
            }
            if (this.action > WebdavResource.NOACTION) {
                if (this.resource.isCollection()) {
View Full Code Here

                update = true;
            } else {
                depth = this.depth;
            }
            if (this.resource == null) {
                this.resource = new WebdavResource(this.url, action, depth);
            } else if (update) {
                this.resource.setProperties(action, depth);
            }
            if (this.action > WebdavResource.NOACTION) {
                if (this.resource.isCollection()) {
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.