Example usage for org.apache.commons.httpclient HttpURL HttpURL

List of usage examples for org.apache.commons.httpclient HttpURL HttpURL

Introduction

In this page you can find the example usage for org.apache.commons.httpclient HttpURL HttpURL.

Prototype

public HttpURL(String paramString1, String paramString2, String paramString3, int paramInt, String paramString4,
            String paramString5) throws URIException 

Source Link

Usage

From source file:ru.org.linux.util.LorURI.java

/**
 * ?? scheme url http  https  ??   secure
 * ?  ? lor ??,    ? ,  ?/*  www  .j  a v a  2 s.co  m*/
 * @param secure true ? https
 * @return ? url
 * @throws URIException  url
 */
public String fixScheme(boolean secure) throws URIException {
    if (!trueLorUrl) {
        return toString();
    }
    String host = lorURI.getHost();
    int port = lorURI.getPort();
    String path = lorURI.getPath();
    String query = lorURI.getQuery();
    String fragment = lorURI.getFragment();
    if (!secure) {
        return (new HttpURL(null, host, port, path, query, fragment)).getEscapedURIReference();
    } else {
        return (new HttpsURL(null, host, port, path, query, fragment)).getEscapedURIReference();
    }
}

From source file:ru.org.linux.util.LorURL.java

/**
 * ?? scheme url http  https  ??   secure
 * ?  ? lor ??,    ? ,  ?//from w ww.j a va2  s .c o m
 * @param canonical ? URL ?
 * @return ? url
 * @throws URIException  url
 */
public String canonize(URI canonical) throws URIException {
    if (!_true_lor_url) {
        return toString();
    }

    String host = canonical.getHost();
    int port = canonical.getPort();
    String path = parsed.getPath();
    String query = parsed.getQuery();
    String fragment = parsed.getFragment();

    if (canonical.getScheme().equals("http")) {
        return (new HttpURL(null, host, port, path, query, fragment)).getEscapedURIReference();
    } else {
        return (new HttpsURL(null, host, port, path, query, fragment)).getEscapedURIReference();
    }
}