Package org.apache.webdav.lib

Examples of org.apache.webdav.lib.WebdavResource


     * Refresh the content of this object after the underlying data
     * content has changed.
     */
    public void refresh() {
        try {
            this.resource = new WebdavResource(this.systemId);

            if (sourcecredential != null)
                resource.setUserInfo(
                    sourcecredential.getPrincipal(),
                    sourcecredential.getPassword());
View Full Code Here


        try {
            HttpURL httpURL = new HttpURL(this.systemId);
            httpURL.setUserInfo(
                sourcecredential.getPrincipal(),
                sourcecredential.getPassword());
            this.resource = new WebdavResource(httpURL);
        } catch (HttpException he) {
            throw new SourceException("Could not set credentials", he);
        } catch (IOException ioe) {
            throw new IllegalStateException(ioe.getMessage());
        }
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

            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

            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

            HttpState state = new HttpState();
            state.setCredentials(null, new UsernamePasswordCredentials(
                    url.getUser(),
                    url.getPassword()));
            HttpConnection conn = new HttpConnection(url.getHost(), url.getPort());
            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 don'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

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.