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

/*  40 */     return listMembers(baseUrl, filter, false);
/*     */   }
/*     */
/*     */   public Collection listMembers(URL baseUrl, URLLister.URLFilter filter, boolean scanNonDottedSubDirs) throws IOException
/*     */   {
/*  45 */     WebdavResource resource = null;
/*     */     try
/*     */     {
/*  48 */       resource = new WebdavResource(baseUrl.toString());
/*  49 */       WebdavResource[] resources = resource.listWebdavResources();
/*  50 */       List urls = new ArrayList(resources.length);
/*  51 */       for (int i = 0; i < resources.length; i++)
/*     */       {
/*  53 */         WebdavResource member = resources[i];
/*  54 */         HttpURL httpURL = member.getHttpURL();
/*  55 */         if (!filter.accept(baseUrl, httpURL.getName()))
/*     */           continue;
/*  57 */         String uri = httpURL.getURI();
/*  58 */         if (member.isCollection())
/*     */         {
/*  60 */           if (!uri.endsWith("/")) {
/*  61 */             uri = uri + "/";
/*     */           }
/*     */
View Full Code Here

                hostname,
                port,
                "/");

            // WebdavResource resource = null;
            WebdavResource resource = new WebdavResource()
            {
            };

            if (fileSystemOptions != null)
            {
                String proxyHost = WebdavFileSystemConfigBuilder.getInstance().getProxyHost(fileSystemOptions);
                int proxyPort = WebdavFileSystemConfigBuilder.getInstance().getProxyPort(fileSystemOptions);

                if (proxyHost != null && proxyPort > 0)
                {
                    // resource = new WebdavResource(url, proxyHost, proxyPort);
                    resource.setProxy(proxyHost, proxyPort);
                }

                UserAuthenticator proxyAuth = WebdavFileSystemConfigBuilder.getInstance().getProxyAuthenticator(fileSystemOptions);
                if (proxyAuth != null)
                {
                    UserAuthenticationData authData = UserAuthenticatorUtils.authenticate(proxyAuth, new UserAuthenticationData.Type[]
                        {
                            UserAuthenticationData.USERNAME,
                            UserAuthenticationData.PASSWORD
                        });

                    if (authData != null)
                    {
                        final UsernamePasswordCredentials proxyCreds =
                            new UsernamePasswordCredentials(
                                UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData, UserAuthenticationData.USERNAME, null)),
                                UserAuthenticatorUtils.toString(UserAuthenticatorUtils.getData(authData, UserAuthenticationData.PASSWORD, null)));

                        resource.setProxyCredentials(proxyCreds);
                    }
                }
            }

            /*
            if (resource == null)
            {
                resource = new WebdavResource(url);
            }
            resource.setProperties(WebdavResource.NOACTION, 1);
            */
            resource.setHttpURL(url, WebdavResource.NOACTION, 1);

            client = resource.retrieveSessionInstance();
            client.setHttpConnectionManager(new ThreadLocalHttpConnectionManager());
        }
        catch (final IOException e)
        {
            throw new FileSystemException("vfs.provider.webdav/connect.error", hostname, e);
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.