本文整理汇总了Java中org.apache.tomcat.util.http.FastHttpDateFormat.parseDate方法的典型用法代码示例。如果您正苦于以下问题:Java FastHttpDateFormat.parseDate方法的具体用法?Java FastHttpDateFormat.parseDate怎么用?Java FastHttpDateFormat.parseDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tomcat.util.http.FastHttpDateFormat
的用法示例。
在下文中一共展示了FastHttpDateFormat.parseDate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDateHeader
import org.apache.tomcat.util.http.FastHttpDateFormat; //导入方法依赖的package包/类
/**
* Return the value of the specified date header, if any; otherwise
* return -1.
*
* @param name Name of the requested date header
*
* @exception IllegalArgumentException if the specified header value
* cannot be converted to a date
*/
@Override
public long getDateHeader(String name) {
String value = getHeader(name);
if (value == null) {
return (-1L);
}
// Attempt to convert the date header in a variety of formats
long result = FastHttpDateFormat.parseDate(value, formats);
if (result != (-1L)) {
return result;
}
throw new IllegalArgumentException(value);
}
示例2: getDateHeader
import org.apache.tomcat.util.http.FastHttpDateFormat; //导入方法依赖的package包/类
/**
* Return the value of the specified date header, if any; otherwise return
* -1.
*
* @param name
* Name of the requested date header
*
* @exception IllegalArgumentException
* if the specified header value cannot be converted to a
* date
*/
@Override
public long getDateHeader(String name) {
String value = getHeader(name);
if (value == null) {
return (-1L);
}
// Attempt to convert the date header in a variety of formats
long result = FastHttpDateFormat.parseDate(value, formats);
if (result != (-1L)) {
return result;
}
throw new IllegalArgumentException(value);
}
示例3: getDateHeader
import org.apache.tomcat.util.http.FastHttpDateFormat; //导入方法依赖的package包/类
/**
* Return the value of the specified date header, if any; otherwise
* return -1.
*
* @param name Name of the requested date header
*
* @exception IllegalArgumentException if the specified header value
* cannot be converted to a date
*/
@Override
public long getDateHeader(String name) {
String value = getHeader(name);
if (value == null)
return (-1L);
// Attempt to convert the date header in a variety of formats
long result = FastHttpDateFormat.parseDate(value, formats);
if (result != (-1L)) {
return result;
}
throw new IllegalArgumentException(value);
}
示例4: getDateHeader
import org.apache.tomcat.util.http.FastHttpDateFormat; //导入方法依赖的package包/类
/**
* Return the value of the specified date header, if any; otherwise
* return -1.
*
* @param name Name of the requested date header
*
* @exception IllegalArgumentException if the specified header value
* cannot be converted to a date
*/
public long getDateHeader(String name) {
String value = getHeader(name);
if (value == null)
return (-1L);
// Attempt to convert the date header in a variety of formats
long result = FastHttpDateFormat.parseDate(value, formats);
if (result != (-1L)) {
return result;
}
throw new IllegalArgumentException(value);
}
示例5: getDateHeader
import org.apache.tomcat.util.http.FastHttpDateFormat; //导入方法依赖的package包/类
public long getDateHeader(String name) {
if(this.headers != null) {
String value = getHeader(name);
if (value == null)
return (-1L);
long result = FastHttpDateFormat.parseDate(value, FORMATS);
if (result != (-1L)) {
return result;
}
throw new IllegalArgumentException(value);
}
return super.getDateHeader(name);
}