org.apache.turbine.util
Class HttpUtils

java.lang.Object
  |
  +--org.apache.turbine.util.HttpUtils

public class HttpUtils
extends java.lang.Object

This class provides utilities for handling some semi-trivial HTTP stuff that would othterwize be handled elsewhere.

Author:
Magnús Þór Torfason

Field Summary
private static java.text.SimpleDateFormat httpDateFormat
          The date format to use for HTTP Dates.
 
Constructor Summary
HttpUtils()
           
 
Method Summary
(package private) static void ()
           
static java.lang.String formatHttpDate(java.util.Date date)
          Formats a java Date according to rfc 1123, the rfc standard for dates in http.
static void setCacheHeaders(RunData data, int expiry)
          This method sets the required expiration headers in the response for a given RunData object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

httpDateFormat

private static java.text.SimpleDateFormat httpDateFormat
The date format to use for HTTP Dates.
Constructor Detail

HttpUtils

public HttpUtils()
Method Detail

static void ()

formatHttpDate

public static java.lang.String formatHttpDate(java.util.Date date)
Formats a java Date according to rfc 1123, the rfc standard for dates in http.
Parameters:
date - The Date to format
Returns:
A String represeentation of the date

setCacheHeaders

public static void setCacheHeaders(RunData data,
                                   int expiry)
This method sets the required expiration headers in the response for a given RunData object. This method attempts to set all relevant headers, both for HTTP 1.0 and HTTP 1.1.
Parameters:
data - The RunData object we are setting cache information for.
expiry - The number of seconds untill the document should expire, 0 indicating immediate expiration (i.e. no caching).


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.