Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpURL


    {
        // Create an Http client
        HttpClient client;
        try
        {
            final HttpURL url = new HttpURL(username,
                password,
                hostname,
                port,
                "/");
View Full Code Here


        if (resource == null)
        {
            // HttpURL url = new HttpURL(name.getHostName(), name.getPort(), name.getPath());
            String pathEncoded = name.getPathQueryEncoded(urlCharset);
            HttpURL url = new HttpURL(name.getUserName(), name.getPassword(), name.getHostName(), name.getPort());
            url.setEscapedPath(pathEncoded);
            resource = new WebdavResource(fileSystem.getClient())
            {
            };
            resource.setHttpURL(url, WebdavResource.NOACTION, 1);
        }
View Full Code Here

    private static int lockDAVMinutes = 240;

    public HttpDocument(String url, String user, String pass) {
        this.url = url;
        try {
            httpURL = new HttpURL(url);
            if (user == null || user.length() == 0)
                user = httpURL.getUser();
            if (pass == null || pass.length() == 0)
                pass = httpURL.getPassword();
            if (user != null)
View Full Code Here

        if (res.exists()) {
            return (!res.isCollection());
        } else {
            try {
                HttpURL parentURL = new HttpURL(httpURL.toString());
                String user = httpURL.getUser();
                String pass = httpURL.getPassword();
                if (user != null)
                    parentURL.setUserinfo(user, pass);
                String currentHierPath = httpURL.getCurrentHierPath();
                if (!currentHierPath.endsWith("/"))
                    currentHierPath = currentHierPath + "/";
                parentURL.setPath(currentHierPath);
                WebdavResource parentRes = new WebdavResource(parentURL);
                if (!parentRes.isCollection())
                    return false;
                return true;
            } catch (Exception e) {
View Full Code Here

        //shell.dispose();
        password = getPassword()
      }


      HttpURL hrl = new HttpURL(url);     

      hrl.setUserinfo(user,password);
      if(proxyHost.length() > 0)
        wdr = new WebdavResource(hrl, proxyHost, proxyPort);
      else
        wdr = new WebdavResource(hrl);
View Full Code Here

        if (name.contains("/")) {
            throw new ContentRepositoryException("Paths not allowed: " + name);
        }

        try {
            HttpURL url = getChildURL(getResource().getHttpURL(), name);
           
            logger.fine("[WebdavContentCollection] Get child " + name +
                        " returns " + url + " from " + this);

            AuthenticatedWebdavResource resource =
View Full Code Here

        if (name.contains("/")) {
            throw new ContentRepositoryException("Paths not allowed: " + name);
        }

        try {
            HttpURL newURL = getChildURL(getResource().getHttpURL(), name);

            logger.fine("[WebdavContentCollection] Create child " + name +
                        " returns " + newURL + " from " + this);

            AuthenticatedWebdavResource newResource =
View Full Code Here

        if (name.contains("/")) {
            throw new ContentRepositoryException("Paths not allowed: " + name);
        }

        try {
            HttpURL removeURL = getChildURL(getResource().getHttpURL(), name);
            AuthenticatedWebdavResource removeResource =
                    new AuthenticatedWebdavResource(getResource(), removeURL);
            if (removeResource.exists()) {
                removeResource.deleteMethod();
            }
View Full Code Here

        if (!parent.getPath().endsWith("/")) {
            parent.setPath(parent.getPath() + "/");
        }

        return new HttpURL(parent, childPath);
    }
View Full Code Here

        }

        /* Create the base URL */
        String url = configuration.getChild("url").getValue(null);
        try {
            if (url != null) this.url = new HttpURL(url);
        } catch (URIException e) {
            throw new ConfigurationException("Cannot process URL \"" + url + "\" specified"
                    + " at " + configuration.getChild("url").getLocation());
        }

View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.HttpURL

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.