org.appng.api.support

## Interface HttpHeaderUtils.HttpResource

- Enclosing class:
    HttpHeaderUtils

      public static interface HttpHeaderUtils.HttpResource

  A resource that has been requested by an `HttpServletRequest` and eventually needs to be updated.
  See Also:
    `HttpHeaderUtils.handleModifiedHeaders(HttpServletRequest, HttpServletResponse, HttpResource, boolean)`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getContentType()` Returns the content-type for this resource
    `byte[]` | `getData()` Retrieves the data of this resource.
    `default org.springframework.http.HttpHeaders` | `getHeaders()` Returns the `HttpHeaders` for this resource.
    `default org.springframework.http.HttpStatus` | `getStatus()` Returns the `HttpStatus` for this resource.
    `boolean` | `needsUpdate()` Whether or not this resource has been updated during `update()`.
    `default void` | `setStatus(org.springframework.http.HttpStatus status)` Set the status for this response.
    `long` | `update()` Updates this resource if necessary and returns the latest version.

- - ### Method Detail

    - #### update

          long update()
               throws IOException

      Updates this resource if necessary and returns the latest version.
      Returns:
        the latest version of the resource
      Throws:
        `IOException` - if an error occurs while updating

    - #### getContentType

          String getContentType()

      Returns the content-type for this resource
      Returns:
        the content-type

    - #### needsUpdate

          boolean needsUpdate()

      Whether or not this resource has been updated during `update()`.
      Returns:
        `true` if this resource has been updated
      See Also:
        `update()`

    - #### getData

          byte[] getData()
                  throws IOException

      Retrieves the data of this resource.
      Returns:
        the data
      Throws:
        `IOException` - if an error occurs while retrieving the data

    - #### setStatus

          default void setStatus(org.springframework.http.HttpStatus status)

      Set the status for this response.
      Parameters:
        `status` - the status

    - #### getStatus

          default org.springframework.http.HttpStatus getStatus()

      Returns the `HttpStatus` for this resource. Default: `HttpStatus#OK`.
      Returns:
        the status

    - #### getHeaders

          default org.springframework.http.HttpHeaders getHeaders()

      Returns the `HttpHeaders` for this resource. Default: An empty `HttpHeaders` object
      Returns:
        the HttpHeaders

Copyright © 2011–2023 aiticon GmbH. All rights reserved.