Interface HttpHeaderUtils.HttpResource

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method 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