Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpURL


  
   protected void downloadFileset(WebdavFileSet fileSet) throws IOException
   {
      CollectionScanner scanner =
          fileSet.getCollectionScanner(getProject(), getHttpClient(), getUrl());
      HttpURL baseUrl = scanner.getBaseURL();
     
      String[] files = scanner.getIncludedFiles();
      for (int i = 0; i < files.length; i++) {
         HttpURL url = Utils.createHttpURL(baseUrl, files[i]);
         downloadFile(url, files[i], scanner);
      }
   }
View Full Code Here


     */
    public HttpURL getHttpURLExceptForUserInfo()
        throws URIException {

        return httpURL instanceof HttpsURL ? new HttpsURL(httpURL.getRawURI())
                                           : new HttpURL(httpURL.getRawURI());
    }
View Full Code Here

     * @return the value 0 if the argument is equal.
     */
    public int compareToWebdavResource(WebdavResource another) {

        try {
            HttpURL anotherUrl = another.getHttpURL();

            String thisHost = httpURL.getHost();
            String anotherHost= anotherUrl.getHost();
            if (!thisHost.equalsIgnoreCase(anotherHost))
                return thisHost.compareTo(anotherHost);

            int thisPort = httpURL.getPort();
            int anotherPort= anotherUrl.getPort();
            if (thisPort != anotherPort)
                return (thisPort < anotherPort) ? -1 : 1;

            boolean thisCollection = isCollection();
            boolean anotherCollection = another.isCollection();
            if (thisCollection && !anotherCollection)
                return -1;
            if (anotherCollection && !thisCollection)
                return 1;

            String thisPath = httpURL.getPathQuery();
            String anotherPath= anotherUrl.getPathQuery();
            return thisPath.compareTo(anotherPath);
        } catch (Exception e) {
            // FIXME: not to return 0.
        }

View Full Code Here

     * @param password password for login to the Slide (WebDAV) server
     * @param timeout timeout of the externally controlled transaction
     * @throws URIException if the given uri is not a valid one
     */
    public WebDAVConnectionSpec(String url, String userName, String password, int timeout) throws URIException {
        this.httpURL = url.startsWith("https") ? new HttpsURL(url) : new HttpURL(url);
        this.httpURL.setUserinfo(userName, password);
        this.timeout = timeout;
    }
View Full Code Here

   protected void proppatch(WebdavFileSet fileSet)
      throws IOException, HttpException
   {
      CollectionScanner scanner =
         fileSet.getCollectionScanner(getProject(), getHttpClient(), getUrl());
      HttpURL baseUrl = scanner.getBaseURL();
    
      String[] files = scanner.getIncludedFiles();
      for (int i = 0; i < files.length; i++) {
         HttpURL url = Utils.createHttpURL(baseUrl, files[i]);
         proppatch(url, files[i]);
      }
      String[] colls = scanner.getIncludedDirectories();
      for (int i = 0; i < colls.length; i++) {
         HttpURL url = Utils.createHttpURL(baseUrl, colls[i]);
         proppatch(url, colls[i]);
      }
   }
View Full Code Here

   private void deleteFileset(WebdavFileSet fileSet)
      throws IOException, HttpException
   {
      CollectionScanner scanner =
         fileSet.getCollectionScanner(getProject(), getHttpClient(), getUrl());
      HttpURL baseUrl = scanner.getBaseURL();
    
      String[] files = scanner.getIncludedFiles();
      for (int i = 0; i < files.length; i++) {
         HttpURL url = Utils.createHttpURL(baseUrl, files[i]);
         delete(url, files[i]);
      }
      String[] colls = scanner.getIncludedDirectories();
      for (int i = 0; i < colls.length; i++) {
         HttpURL url = Utils.createHttpURL(baseUrl, colls[i]);
         delete(url, colls[i]);
      }
   }
View Full Code Here

   * @param pathname complete path to element
   * @param user user name
   * @param pass password
   */
  public WebdavFile(String pathname, String user, String pass) throws URIException {
    this(new HttpURL(user, pass, null, -1, pathname));
  }
View Full Code Here

   * @param pass password
   */
  public WebdavFile(URL url, String user, String pass) throws URIException {
    this(url.getProtocol().equals("https")
        ? new HttpsURL(user, pass, url.getHost(), url.getPort(), url.getPath())
        : new HttpURL(user, pass, url.getHost(), url.getPort(), url.getPath()));
  }
View Full Code Here

            } else {
               if (getUrl().getURI().endsWith("/")) {
                  Utils.assureExistingCollection(getHttpClient(), getUrl(), this.locktoken);
                  uploadFile(this.file.getName(), this.file);
               } else {
                  HttpURL targetColl = Utils.createHttpURL(getUrl(), ".");
                  Utils.assureExistingCollection(getHttpClient(), targetColl, this.locktoken);
                  uploadFile(getUrl(), this.file, this.file.getName());
               }
            }
         } else {
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

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.