Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpsURL


    public void put(File source, String destination, boolean overwrite) throws IOException {
        int fileNameStart = destination.lastIndexOf('/');
        String baseUrl = destination.substring(0, fileNameStart + 1);
        String destinationFileName =  destination.substring(fileNameStart + 1);
        HttpsURL hrl = new HttpsURL(baseUrl);
        hrl.setUserinfo(user, userPassword);
        WebdavResource wdr = new WebdavResource(hrl);
        wdr.putMethod(wdr.getPath() + '/' + destinationFileName, source);
        wdr.close();
    }
View Full Code Here


            }
            if (!itself) {
                String myURI = httpURL.getEscapedURI();
                workingResource.setHttpURL(
                    httpURL instanceof HttpsURL
                    ? new HttpsURL(myURI + (myURI.endsWith("/") ? "" : "/")
                                   + URIUtil.encodePath(displayName))
                    : new HttpURL(myURI + (myURI.endsWith("/") ? "" : "/")
                                  + URIUtil.encodePath(displayName)),
                    NOACTION, defaultDepth);
                workingResource.setExistence(true);
View Full Code Here

    public void setHttpURL
        (HttpURL httpURL, String additionalPath, int action, int depth)
        throws HttpException, IOException {

        setHttpURL(httpURL instanceof HttpsURL
                   ? new HttpsURL((HttpsURL) httpURL, additionalPath)
                   : new HttpURL(httpURL, additionalPath), action, depth);
    }
View Full Code Here

    public void setHttpURL
        (HttpURL httpURL, String additionalPath, int action)
        throws HttpException, IOException {

        setHttpURL(httpURL instanceof HttpsURL
                   ? new HttpsURL((HttpsURL) httpURL, additionalPath)
                   : new HttpURL(httpURL, additionalPath),
                   action, defaultDepth);
    }
View Full Code Here

     */
    public void setHttpURL(HttpURL httpURL, String additionalPath)
        throws HttpException, IOException {

        setHttpURL(httpURL instanceof HttpsURL
                   ? new HttpsURL((HttpsURL) httpURL, additionalPath)
                   : new HttpURL(httpURL, additionalPath),
                   defaultAction, defaultDepth);
    }
View Full Code Here

     */
    public void setHttpURL(String escapedHttpURL)
        throws HttpException, IOException {

        setHttpURL(escapedHttpURL.startsWith("https")
                   ? new HttpsURL(escapedHttpURL)
                   : new HttpURL(escapedHttpURL));
    }
View Full Code Here

     * @return httpURL the http URL.
     */
    public HttpURL getHttpURLExceptForUserInfo()
        throws URIException {

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

   * @param user user name
   * @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

        }
        return sResult;
    }

    private static HttpURL uriToHttpURL(String uri) throws URIException {
        return uri.startsWith("https") ? new HttpsURL(uri.toCharArray())
                                       : new HttpURL(uri.toCharArray());
    }
View Full Code Here

    private static HttpURL uriToHttpURL(String uri) throws URIException {
        HttpURL url = null;
        if (uri.startsWith("http://")) {
            url = new HttpURL(uri);
        } else if (uri.startsWith("https://")) {
            url = new HttpsURL(uri);
        } else {
            throw new URIException("Unknown protocol in URL " + uri);
        }
        return url;
    }
View Full Code Here

TOP

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

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.