Package org.apache.tomcat.util.http
Class HttpMessages
java.lang.Object
org.apache.tomcat.util.http.HttpMessages
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 Summary
Modifier and TypeMethodDescriptionstatic HttpMessages
getInstance
(Locale locale) getMessage
(int status) Get the status string associated with a status code.static boolean
isSafeInHttpHeader
(String msg) Is the provided message safe to use in an HTTP header.
-
Method Details
-
getMessage
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
-
getInstance
-
isSafeInHttpHeader
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 elsefalse
-