org.apache.turbine.util

## Class HttpUtils

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

-     public class HttpUtils
      extends Object

  This class provides utilities for handling some semi-trivial HTTP stuff that would otherwise be handled elsewhere.
  Version:
    $Id: HttpUtils.java 1706239 2015-10-01 13:18:35Z tv $
  Author:
    Magnús Þór Torfason

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `formatHttpDate(Date date)` Formats a java Date according to rfc 1123, the rfc standard for dates in http.
    `static void` | `setCacheHeaders(PipelineData pipelineData, int expiry)` This method sets the required expiration headers in the response for a given `PipelineData` object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HttpUtils

          public HttpUtils()

  - ### Method Detail

    - #### formatHttpDate

          public static String formatHttpDate(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 representation of the date

    - #### setCacheHeaders

          public static void setCacheHeaders(PipelineData pipelineData,
                             int expiry)

      This method sets the required expiration headers in the response for a given `PipelineData` object. This method attempts to set all relevant headers, both for HTTP 1.0 and HTTP 1.1.
      Parameters:
        `pipelineData` - The `PipelineData` object we are setting cache information for.
        `expiry` - The number of milliseconds until the document should expire, `0` indicating immediate expiration (i.e. no caching).

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.