/** * Construct a HTTPS URL with a given relative HTTPS URL string. * * @param base the base HttpsURL * @param relative the relative HTTPS URL string * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, String relative) throws URIException { this(base, new HttpsURL(relative)); }
/** * Construct a HTTPS URL from a given string. * * @param original the HTTPS URL string * @throws URIException If {@link #checkValid()} fails * @see #getDefaultProtocolCharset */ public HttpsURL(String original) throws URIException { parseUriReference(original, false); checkValid(); }
/** * Verify the valid class use for construction. * * @throws URIException the wrong scheme use */ protected void checkValid() throws URIException { // could be explicit protocol or undefined. if (!(equals(_scheme, DEFAULT_SCHEME) || _scheme == null)) { throw new URIException(URIException.PARSING, "wrong class use"); } }
/** * Extracts the host and post from the baseurl and constructs an * appropriate AuthScope for them for use with HttpClient. */ private AuthScope createAuthScope(String baseUrl) throws URIException { //HttpURL url = new HttpURL(baseUrl); HttpsURL url = new HttpsURL(baseUrl); return new AuthScope(url.getHost(), url.getPort()); }
private InputStream fetchUrlWithRedmineHeader(String _url) throws IOException { try { HttpClient httpClient = new HttpClient(); HttpMethod httpMethod = null; if (_url.toLowerCase().startsWith("https:") && ignoreSSL) { HttpsURL url = new HttpsURL(_url); Protocol easyhttps = new Protocol("https", new org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory(), url.getPort()); httpClient.getHostConfiguration().setHost(url.getHost(), url.getPort(), easyhttps); httpMethod = new GetMethod(url.getPath()); } else { httpMethod = new GetMethod(_url); } httpMethod.setRequestHeader("X-Redmine-API-Key", apiToken); httpClient.executeMethod(httpMethod); return httpMethod.getResponseBodyAsStream(); } catch (URIException e) { // too lazy to write exception handling :P throw new RuntimeException(e.getMessage()); } }
/** * Construct a HTTPS URL with a given relative URL. * * @param base the base HttpsURL * @param relative the relative HttpsURL * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, HttpsURL relative) throws URIException { super(base, relative); checkValid(); }
/** * Construct a HTTPS URL with a given relative URL. * * @param base the base HttpsURL * @param relative the relative HttpsURL * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, HttpsURL relative) throws URIException { super(base, relative); checkValid(); }
/** * Construct a HTTPS URL with a given relative HTTPS URL string. * * @param base the base HttpsURL * @param relative the relative HTTPS URL string * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, String relative) throws URIException { this(base, new HttpsURL(relative)); }
/** * Construct a HTTPS URL from a given string with the given charset to do * escape encoding. * * @param original the HTTPS URL string * @param charset the charset to do escape encoding * @throws URIException If {@link #checkValid()} fails * @see #getProtocolCharset */ public HttpsURL(String original, String charset) throws URIException { protocolCharset = charset; parseUriReference(original, false); checkValid(); }
/** * Construct a HTTPS URL with a given relative URL. * * @param base the base HttpsURL * @param relative the relative HttpsURL * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, HttpsURL relative) throws URIException { super(base, relative); checkValid(); }
/** * Verify the valid class use for construction. * * @throws URIException the wrong scheme use */ protected void checkValid() throws URIException { // could be explicit protocol or undefined. if (!(equals(_scheme, DEFAULT_SCHEME) || _scheme == null)) { throw new URIException(URIException.PARSING, "wrong class use"); } }
/** * Construct a HTTPS URL with a given relative HTTPS URL string. * * @param base the base HttpsURL * @param relative the relative HTTPS URL string * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, String relative) throws URIException { this(base, new HttpsURL(relative)); }
/** * Construct a HTTPS URL as an escaped form of a character array. * * @param escaped the HTTPS URL character sequence * @throws URIException If {@link #checkValid()} fails * @throws NullPointerException if <code>escaped</code> is <code>null</code> * @see #getDefaultProtocolCharset */ public HttpsURL(char[] escaped) throws URIException, NullPointerException { parseUriReference(new String(escaped), true); checkValid(); }
/** * Construct a HTTPS URL with a given relative URL. * * @param base the base HttpsURL * @param relative the relative HttpsURL * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, HttpsURL relative) throws URIException { super(base, relative); checkValid(); }
/** * Verify the valid class use for construction. * * @throws URIException the wrong scheme use */ protected void checkValid() throws URIException { // could be explicit protocol or undefined. if (!(equals(_scheme, DEFAULT_SCHEME) || _scheme == null)) { throw new URIException(URIException.PARSING, "wrong class use"); } }
/** * Construct a HTTPS URL with a given relative HTTPS URL string. * * @param base the base HttpsURL * @param relative the relative HTTPS URL string * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, String relative) throws URIException { this(base, new HttpsURL(relative)); }
/** * Construct a HTTPS URL as an escaped form of a character array with the * given charset to do escape encoding. * * @param escaped the HTTPS URL character sequence * @param charset the charset to do escape encoding * @throws URIException If {@link #checkValid()} fails * @throws NullPointerException if <code>escaped</code> is <code>null</code> * @see #getProtocolCharset */ public HttpsURL(char[] escaped, String charset) throws URIException, NullPointerException { protocolCharset = charset; parseUriReference(new String(escaped), true); checkValid(); }
/** * Construct a HTTPS URL with a given relative URL. * * @param base the base HttpsURL * @param relative the relative HttpsURL * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, HttpsURL relative) throws URIException { super(base, relative); checkValid(); }
/** * Verify the valid class use for construction. * * @throws URIException the wrong scheme use */ protected void checkValid() throws URIException { // could be explicit protocol or undefined. if (!(equals(_scheme, DEFAULT_SCHEME) || _scheme == null)) { throw new URIException(URIException.PARSING, "wrong class use"); } }
/** * Construct a HTTPS URL with a given relative HTTPS URL string. * * @param base the base HttpsURL * @param relative the relative HTTPS URL string * @throws URIException If {@link #checkValid()} fails */ public HttpsURL(HttpsURL base, String relative) throws URIException { this(base, new HttpsURL(relative)); }