当前位置: 首页>>代码示例>>Java>>正文


Java FastHttpDateFormat.parseDate方法代码示例

本文整理汇总了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);

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:26,代码来源:Request.java

示例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);

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:28,代码来源:Request.java

示例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);

}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:25,代码来源:Request.java

示例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);

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:Request.java

示例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);
}
 
开发者ID:mehah,项目名称:jRender,代码行数:15,代码来源:HttpRequest.java


注:本文中的org.apache.tomcat.util.http.FastHttpDateFormat.parseDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。