/** * 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 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 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 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 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)); }
/** * @param url file url * @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())); } /**
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; }
/** * Converts a String url to an HttpURL * * @param url String url to convert to an HttpURL * @return an HttpURL object created from the String url * @throws URIException */ private HttpURL urlToHttpURL( String url ) throws URIException { if ( url.startsWith( "https" ) ) { return new HttpsURL( url ); } else { return new HttpURL( url ); } }
/** * 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()); }
/** * Set the HttpURL of this WebdavResource. * It must be put an escaped http URL as an argument. * * @param escapedHttpURL The escaped http URL string. * @exception HttpException * @exception IOException * @see #setHttpURL(HttpURL) * @see #setUserInfo(java.lang.String, java.lang.String) * @see #setPath(java.lang.String) */ public void setHttpURL(String escapedHttpURL) throws HttpException, IOException { setHttpURL(escapedHttpURL.startsWith("https") ? new HttpsURL(escapedHttpURL) : new HttpURL(escapedHttpURL)); }
/** * Set the HttpURL for this WebdavResource. * * @param httpURL The specified HttpURL. * @param additionalPath The added relative path. * @exception HttpException * @exception IOException * @see #setHttpURL(java.lang.String) * @see #setUserInfo(java.lang.String, java.lang.String) * @see #setPath(java.lang.String) */ 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); }
/** * Set the HttpURL for this WebdavResource. * It must be put an escaped path part of the http URL as an argument. * * @param httpURL The specified HttpURL. * @param additionalPath The added relative path. * @param action The action to decide, which properties to find. * @param depth The depth. * @exception HttpException * @exception IOException * @see #setHttpURL(java.lang.String) * @see #setUserInfo(java.lang.String, java.lang.String) * @see #setPath(java.lang.String) * @see #setDefaultAction(int) */ 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); }
/** * Set the HttpURL for this WebdavResource. * It must be put an escaped path part of the http URL as an argument. * * @param httpURL The specified HttpURL. * @param additionalPath The added relative path. * @param action The action to decide, which properties to find. * @exception HttpException * @exception IOException * @see #setHttpURL(java.lang.String) * @see #setUserInfo(java.lang.String, java.lang.String) * @see #setPath(java.lang.String) * @see #setDefaultAction(int) */ 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); }
/** * Get the HttpURL except for userinfo. * * @return httpURL the http URL. */ public HttpURL getHttpURLExceptForUserInfo() throws URIException { return httpURL instanceof HttpsURL ? new HttpsURL(httpURL.getRawURI()) : new HttpURL(httpURL.getRawURI()); }
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()); } }
HttpsURL httpsURL = new HttpsURL(host); hostConfiguration.setHost(httpsURL);
HttpsURL httpsURL = new HttpsURL(host); hostConfiguration.setHost(httpsURL);
HttpsURL httpsURL = new HttpsURL(host); hostConfiguration.setHost(httpsURL);
HttpsURL httpsURL = new HttpsURL(host); hostConfiguration.setHost(httpsURL);
+ URIUtil.getName(href)).toCharArray(); HttpURL childURL = httpURL instanceof HttpsURL ? new HttpsURL(childURI) : new HttpURL(childURI); childURL.setRawAuthority(httpURL.getRawAuthority());