本文整理汇总了Java中org.apache.commons.httpclient.cookie.CookiePolicy.getCookieSpec方法的典型用法代码示例。如果您正苦于以下问题:Java CookiePolicy.getCookieSpec方法的具体用法?Java CookiePolicy.getCookieSpec怎么用?Java CookiePolicy.getCookieSpec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.httpclient.cookie.CookiePolicy
的用法示例。
在下文中一共展示了CookiePolicy.getCookieSpec方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toExternalForm
import org.apache.commons.httpclient.cookie.CookiePolicy; //导入方法依赖的package包/类
/**
* Return a textual representation of the cookie.
*
* @return string.
*/
public String toExternalForm() {
CookieSpec spec = null;
if (getVersion() > 0) {
spec = CookiePolicy.getDefaultSpec();
} else {
spec = CookiePolicy.getCookieSpec(CookiePolicy.NETSCAPE);
}
return spec.formatCookie(this);
}
示例2: getCookieSpec
import org.apache.commons.httpclient.cookie.CookiePolicy; //导入方法依赖的package包/类
/**
* Returns the actual cookie policy
*
* @param state HTTP state. TODO: to be removed in the future
*
* @return cookie spec
*/
private CookieSpec getCookieSpec(final HttpState state) {
if (this.cookiespec == null) {
int i = state.getCookiePolicy();
if (i == -1) {
this.cookiespec = CookiePolicy.getCookieSpec(this.params.getCookiePolicy());
} else {
this.cookiespec = CookiePolicy.getSpecByPolicy(i);
}
this.cookiespec.setValidDateFormats(
(Collection)this.params.getParameter(HttpMethodParams.DATE_PATTERNS));
}
return this.cookiespec;
}
示例3: HC3CookieHandler
import org.apache.commons.httpclient.cookie.CookiePolicy; //导入方法依赖的package包/类
/**
*
*/
public HC3CookieHandler(String policy) {
super();
this.cookieSpec = CookiePolicy.getCookieSpec(policy);
}
示例4: HC3CookieHandler
import org.apache.commons.httpclient.cookie.CookiePolicy; //导入方法依赖的package包/类
/**
* @param policy
* cookie policy to which to conform (see
* {@link CookiePolicy#getCookieSpec(String)}
*/
public HC3CookieHandler(String policy) {
super();
this.cookieSpec = CookiePolicy.getCookieSpec(policy);
}