Example usage for org.springframework.security.web.savedrequest FastHttpDateFormat parseDate

List of usage examples for org.springframework.security.web.savedrequest FastHttpDateFormat parseDate

Introduction

In this page you can find the example usage for org.springframework.security.web.savedrequest FastHttpDateFormat parseDate.

Prototype

public static long parseDate(String value, DateFormat[] threadLocalformats) 

Source Link

Document

Tries to parse the given date as an HTTP date.

Usage

From source file:org.springframework.security.web.savedrequest.SavedRequestAwareWrapper.java

@Override
public long getDateHeader(String name) {
    String value = getHeader(name);

    if (value == null) {
        return -1L;
    }//from  w w w  .j  av  a2  s .  c om

    // 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);
}