本文整理了Java中org.apache.commons.httpclient.HttpURL.<init>()
方法的一些代码示例,展示了HttpURL.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpURL.<init>()
方法的具体详情如下:
包路径:org.apache.commons.httpclient.HttpURL
类名称:HttpURL
方法名:<init>
[英]Create an instance as an internal use.
[中]创建一个实例作为内部使用。
代码示例来源:origin: commons-httpclient/commons-httpclient
/**
* Construct a HTTP URL with a given relative URL string.
*
* @param base the base HttpURL
* @param relative the relative HTTP URL string
* @throws URIException If {@link #checkValid()} fails
*/
public HttpURL(HttpURL base, String relative) throws URIException {
this(base, new HttpURL(relative));
}
代码示例来源:origin: apache/incubator-pinot
@Override
public boolean execute()
throws Exception {
if (_controllerHost == null) {
_controllerHost = NetUtil.getHostAddress();
}
String stateValue = _state.toLowerCase();
if (!stateValue.equals("enable") && !stateValue.equals("disable") && !stateValue.equals("drop")) {
throw new IllegalArgumentException(
"Invalid value for state: " + _state + "\n Value must be one of enable|disable|drop");
}
HttpClient httpClient = new HttpClient();
HttpURL url = new HttpURL(_controllerHost, Integer.parseInt(_controllerPort), URI_TABLES_PATH + _tableName);
url.setQuery("state", stateValue);
GetMethod httpGet = new GetMethod(url.getEscapedURI());
int status = httpClient.executeMethod(httpGet);
if (status != 200) {
throw new RuntimeException("Failed to change table state, error: " + httpGet.getResponseBodyAsString());
}
return true;
}
代码示例来源:origin: org.apache.commons/com.springsource.org.apache.commons.httpclient
/**
* Construct a HTTP URL with a given relative URL string.
*
* @param base the base HttpURL
* @param relative the relative HTTP URL string
* @throws URIException If {@link #checkValid()} fails
*/
public HttpURL(HttpURL base, String relative) throws URIException {
this(base, new HttpURL(relative));
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient
/**
* Construct a HTTP URL with a given relative URL string.
*
* @param base the base HttpURL
* @param relative the relative HTTP URL string
* @throws URIException If {@link #checkValid()} fails
*/
public HttpURL(HttpURL base, String relative) throws URIException {
this(base, new HttpURL(relative));
}
代码示例来源:origin: org.wso2.commons-httpclient/commons-httpclient
/**
* Construct a HTTP URL with a given relative URL string.
*
* @param base the base HttpURL
* @param relative the relative HTTP URL string
* @throws URIException If {@link #checkValid()} fails
*/
public HttpURL(HttpURL base, String relative) throws URIException {
this(base, new HttpURL(relative));
}
代码示例来源:origin: slide/slide-webdavlib
/**
* @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));
}
代码示例来源:origin: org.apache.commons/httpclient
/**
* Construct a HTTP URL with a given relative URL string.
*
* @param base the base HttpURL
* @param relative the relative HTTP URL string
* @throws URIException If {@link #checkValid()} fails
*/
public HttpURL(HttpURL base, String relative) throws URIException {
this(base, new HttpURL(relative));
}
代码示例来源:origin: slide/slide-webdavlib
/**
* @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()));
}
/**
代码示例来源:origin: slide/slide-webdavlib
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;
}
代码示例来源:origin: org.apache.maven.wagon/wagon-webdav
/**
* 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 );
}
}
代码示例来源:origin: smartrics/RestFixture
@Override
protected URI createUri(String uriString, boolean escaped) throws URIException {
boolean useNewHttpUriFactory = config.getAsBoolean("http.client.use.new.http.uri.factory", false);
if (useNewHttpUriFactory) {
return new HttpURL(uriString);
}
return super.createUri(uriString, escaped);
}
代码示例来源:origin: slide/slide-webdavlib
/**
* 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));
}
代码示例来源:origin: slide/slide-webdavlib
/**
* 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);
}
代码示例来源:origin: slide/slide-webdavlib
/**
* 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);
}
代码示例来源:origin: slide/slide-webdavlib
/**
* 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);
}
代码示例来源:origin: smartrics/RestFixture
public URI getURI(String scheme, String host, int port, String path,
String queryString, HttpMethodParams params) throws URIException {
HttpHost httphost = new HttpHost(host, port);
StringBuffer buffer = new StringBuffer();
if (httphost != null) {
buffer.append(httphost.getProtocol().getScheme());
buffer.append("://");
buffer.append(httphost.getHostName());
int p = httphost.getPort();
if (p != -1 && p != httphost.getProtocol().getDefaultPort()) {
buffer.append(":");
buffer.append(p);
}
}
buffer.append(path);
if (queryString != null) {
buffer.append('?');
buffer.append(queryString);
}
String charset = params.getUriCharset();
return new HttpURL(buffer.toString(), charset);
}
代码示例来源:origin: slide/slide-webdavlib
/**
* 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());
}
代码示例来源:origin: org.springframework.ws/spring-ws-core
HttpURL httpURL = new HttpURL(host);
hostConfiguration.setHost(httpURL);
代码示例来源:origin: org.springframework.ws/org.springframework.ws
HttpURL httpURL = new HttpURL(host);
hostConfiguration.setHost(httpURL);
代码示例来源:origin: spring-projects/spring-ws
HttpURL httpURL = new HttpURL(host);
hostConfiguration.setHost(httpURL);
内容来源于网络,如有侵权,请联系作者删除!