Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpURL


    * @throws IOException
    */
   private void uploadFile(String relative, File file)
      throws IOException
   {
      HttpURL url = Utils.createHttpURL(getUrl(), relative);
      uploadFile(url, file, relative);
   }
View Full Code Here


         if (dir.equals("")) {
            Utils.assureExistingCollection(getHttpClient(),
                                           getUrl(),
                                           this.locktoken);
         } else {
            HttpURL collURL = Utils.createHttpURL(getUrl(), dir + "/");
            Utils.assureExistingCollection(getHttpClient(),
                                           collURL,
                                           this.locktoken);
         }
      }           
View Full Code Here

            out.println("Connection1: " + conn1 + "<br>");
            System.out.println("Connection1: " + conn1);

            WebdavResource wr1 = conn1.getWebdavResource();
            // outside of any transaction:
            HttpURL httpURL = new HttpURL(HOST.toCharArray());
            httpURL.setUserinfo(USER, PASSWORD);

            WebdavResource wr2 = new WebdavResource(httpURL);

            out.println("WR1: " + wr1 + "<br>");
            System.out.println("WR1: " + wr1);
View Full Code Here

   */
  public boolean processRequest(SimpleHttpServerConnection conn) throws IOException {
    RequestLine line = conn.getRequestLine();
    String method = line.getMethod();
    if (!"CONNECT".equalsIgnoreCase(method)) return false;
    URI url = new HttpURL(line.getUri());
    handshake(conn, url);
    return true;
  }
View Full Code Here

  public boolean processRequest(SimpleHttpServerConnection conn) throws IOException {
    RequestLine line = conn.getRequestLine();
    String method = line.getMethod();
    //TODO add POST method handling
    if (!"GET".equalsIgnoreCase(method)) return false;
    URI url = new HttpURL(line.getUri());
    httpProxy(conn, url);
    return true;
  }
View Full Code Here

    {
        RequestLine line = request.getRequestLine();
        String method = line.getMethod();
        if (!"CONNECT".equalsIgnoreCase(method))
            return false;
        URI url = new HttpURL(line.getUri());
        handshake(conn, url);
        return true;
    }
View Full Code Here

            HostConfiguration hostConfiguration = new HostConfiguration();
            if ("*".equals(host)) {
                hostConfiguration = HostConfiguration.ANY_HOST_CONFIGURATION;
            }
            else if (host.startsWith("http://")) {
                HttpURL httpURL = new HttpURL(host);
                hostConfiguration.setHost(httpURL);
            }
            else if (host.startsWith("https://")) {
                HttpsURL httpsURL = new HttpsURL(host);
                hostConfiguration.setHost(httpsURL);
View Full Code Here

         WebdavResource[] resources = resource.listWebdavResources ();
         List urls = new ArrayList (resources.length);
         for (int i = 0; i < resources.length; i++)
         {
            WebdavResource member = resources[i];
            HttpURL httpURL = member.getHttpURL ();
            if (filter.accept (baseUrl, httpURL.getName ()))
            {
               String uri = httpURL.getURI();
               if (member.isCollection ())
               {
                  if (! uri.endsWith ("/"))
                     uri += "/";

                  // it is a directory: do we have to recursively list its content?
                  String path = httpURL.getPath();
                  if (scanNonDottedSubDirs && getFilePartFromUrl(path).indexOf (".") == -1)
                  {
                     URL subUrl = new URL (uri) ;
                     urls.addAll (listMembers (subUrl, filter, scanNonDottedSubDirs));
                  }
View Full Code Here

         WebdavResource[] resources = resource.listWebdavResources ();
         List urls = new ArrayList (resources.length);
         for (int i = 0; i < resources.length; i++)
         {
            WebdavResource member = resources[i];
            HttpURL httpURL = member.getHttpURL ();
            if (filter.accept (baseUrl, httpURL.getName ()))
            {
               String uri = httpURL.getURI();
               if (member.isCollection ())
               {
                  if (! uri.endsWith ("/"))
                     uri += "/";

                  // it is a directory: do we have to recursively list its content?
                  String path = httpURL.getPath();
                  if (scanNonDottedSubDirs && getFilePartFromUrl(path).indexOf (".") == -1)
                  {
                     URL subUrl = new URL (uri) ;
                     urls.addAll (listMembers (subUrl, filter, scanNonDottedSubDirs));
                  }
View Full Code Here

         WebdavResource[] resources = resource.listWebdavResources ();
         List<URL> urls = new ArrayList<URL>(resources.length);
         for (int i = 0; i < resources.length; i++)
         {
            WebdavResource member = resources[i];
            HttpURL httpURL = member.getHttpURL ();
            if (filter.accept (baseUrl, httpURL.getName ()))
            {
               String uri = httpURL.getURI();
               if (member.isCollection ())
               {
                  if (! uri.endsWith ("/"))
                     uri += "/";

                  // it is a directory: do we have to recursively list its content?
                  String path = httpURL.getPath();
                  if (scanNonDottedSubDirs && getFilePartFromUrl(path).indexOf (".") == -1)
                  {
                     URL subUrl = new URL (uri) ;
                     urls.addAll (listMembers (subUrl, filter, scanNonDottedSubDirs));
                  }
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.