Package play.utils

Class HTTP


  • public class HTTP
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      HTTP()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String fixCaseForHttpHeader​(java.lang.String headerName)
      Use this method to make sure you have the correct casing of a http header name.
      static boolean isModified​(java.lang.String etag, long last, java.lang.String browserEtag, java.lang.String ifModifiedSince)
      Checks if an entity was modified or not
      static HTTP.ContentTypeWithEncoding parseContentType​(java.lang.String contentType)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HTTP

        public HTTP()
    • Method Detail

      • fixCaseForHttpHeader

        public static java.lang.String fixCaseForHttpHeader​(java.lang.String headerName)
        Use this method to make sure you have the correct casing of a http header name. eg: fixes 'content-type' to 'Content-Type'
        Parameters:
        headerName - The given header name to check
        Returns:
        The correct header name
      • isModified

        public static boolean isModified​(java.lang.String etag,
                                         long last,
                                         java.lang.String browserEtag,
                                         java.lang.String ifModifiedSince)

        Checks if an entity was modified or not

        Parameters:
        etag - the entity tag
        last - a Last-Modified value
        browserEtag - an entity tag from request header
        ifModifiedSince - a Last-Modified value from request header 'If-Modified-Since'
        Returns:
        true if the entity was modified
        See Also:
        RFC 2616 - Hypertext Transfer Protocol - Section 14.26