Class HttpMessages


  • public class HttpMessages
    extends Object
    Handle (internationalized) HTTP messages.
    Author:
    James Duncan Davidson [duncan@eng.sun.com], James Todd [gonzo@eng.sun.com], Jason Hunter [jch@eng.sun.com], Harish Prabandham, costin@eng.sun.com
    • Method Detail

      • getMessage

        public String getMessage​(int status)
        Get the status string associated with a status code. Common messages are cached.
        Parameters:
        status - The HTTP status code to retrieve the message for
        Returns:
        The HTTP status string that conforms to the requirements of the HTTP specification
      • isSafeInHttpHeader

        public static boolean isSafeInHttpHeader​(String msg)
        Is the provided message safe to use in an HTTP header. Safe messages must meet the requirements of RFC2616 - i.e. must consist only of TEXT.
        Parameters:
        msg - The message to test
        Returns:
        true if the message is safe to use in an HTTP header else false