本文整理汇总了Java中org.apache.commons.httpclient.HttpsURL类的典型用法代码示例。如果您正苦于以下问题:Java HttpsURL类的具体用法?Java HttpsURL怎么用?Java HttpsURL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HttpsURL类属于org.apache.commons.httpclient包,在下文中一共展示了HttpsURL类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHttpURL
import org.apache.commons.httpclient.HttpsURL; //导入依赖的package包/类
public static HttpURL createHttpURL(HttpURL base, String relative)
throws URIException
{
if (base instanceof HttpsURL) {
return new HttpsURL((HttpsURL)base, relative);
} else {
return new HttpURL(base, relative);
}
}
示例2: getHttpURLExceptForUserInfo
import org.apache.commons.httpclient.HttpsURL; //导入依赖的package包/类
/**
* 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());
}
示例3: getBaseUri
import org.apache.commons.httpclient.HttpsURL; //导入依赖的package包/类
private static String getBaseUri(HttpServletRequest req, boolean alwaysSpecifyPort) {
URI requestUri = getRequestUri(req);
int port = requestUri.getPort();
String scheme = requestUri.getScheme();
if ((port == -1) && alwaysSpecifyPort) {
if (scheme.equalsIgnoreCase(new String(HttpURL.DEFAULT_SCHEME))) {
port = HttpURL.DEFAULT_PORT;
} else if (scheme.equalsIgnoreCase(new String(HttpsURL.DEFAULT_SCHEME))) {
port = HttpsURL.DEFAULT_PORT;
}
}
String portString = port == -1 ? "" : ":" + port;
return scheme + "://" + requestUri.getHost() + portString;
}
示例4: uriToHttpURL
import org.apache.commons.httpclient.HttpsURL; //导入依赖的package包/类
private static HttpURL uriToHttpURL(String uri) throws URIException {
return uri.startsWith("https") ? new HttpsURL(uri)
: new HttpURL(uri);
}
示例5: WebdavFile
import org.apache.commons.httpclient.HttpsURL; //导入依赖的package包/类
/**
* @param url file path
* @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()));
}
示例6: setHttpURL
import org.apache.commons.httpclient.HttpsURL; //导入依赖的package包/类
/**
* 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);
}
示例7: WebDAVConnectionSpec
import org.apache.commons.httpclient.HttpsURL; //导入依赖的package包/类
/**
* Creates a specification where the {@link WebDAVConnection} shall go to.
*
* @param url path string of the Slide (WebDAV) server
* @param userName user name for login to the Slide (WebDAV) server
* @param password password for login to the Slide (WebDAV) server
* @param timeout timeout of the externally controlled transaction
* @throws URIException if the given uri is not a valid one
*/
public WebDAVConnectionSpec(String url, String userName, String password, int timeout) throws URIException {
this.httpURL = url.startsWith("https") ? new HttpsURL(url) : new HttpURL(url);
this.httpURL.setUserinfo(userName, password);
this.timeout = timeout;
}