java.lang.Object
org.glassfish.grizzly.http.util.HttpUtils
Utility class.
- Author:
- Alexey Stashok
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
composeContentType
(String contentType, String characterEncoding) static float
convertQValueToFloat
(char[] chars, int startIdx, int stopIdx) static float
convertQValueToFloat
(String string, int startIdx, int stopIdx) static float
convertQValueToFloat
(org.glassfish.grizzly.Buffer buffer, int startIdx, int stopIdx) static float
convertQValueToFloat
(DataChunk dc, int startIdx, int stopIdx) static String
Filter the specified message string for characters that are sensitive in HTML.static DataChunk
Filter the specified message string for characters that are sensitive in HTML.static DataChunk
filterNonPrintableCharacters
(DataChunk message) Filter non-printable ASCII characters.static int
longToBuffer
(long value, byte[] buffer) Converts the specified long as a string representation to the provided byte buffer.static void
longToBuffer
(long value, org.glassfish.grizzly.Buffer buffer) Converts the specified long as a string representation to the provided buffer.
-
Constructor Details
-
HttpUtils
public HttpUtils()
-
-
Method Details
-
composeContentType
-
convertQValueToFloat
-
convertQValueToFloat
public static float convertQValueToFloat(org.glassfish.grizzly.Buffer buffer, int startIdx, int stopIdx) -
convertQValueToFloat
-
convertQValueToFloat
public static float convertQValueToFloat(char[] chars, int startIdx, int stopIdx) -
longToBuffer
public static int longToBuffer(long value, byte[] buffer) Converts the specified long as a string representation to the provided byte buffer. This code is based offLong.toString()
- Parameters:
value
- the long to convert.buffer
- the buffer to write the conversion result to.
-
longToBuffer
public static void longToBuffer(long value, org.glassfish.grizzly.Buffer buffer) Converts the specified long as a string representation to the provided buffer. This code is based offLong.toString()
- Parameters:
value
- the long to convert.buffer
- the buffer to write the conversion result to.
-
filterNonPrintableCharacters
Filter non-printable ASCII characters.- Parameters:
message
-
-
filter
Filter the specified message string for characters that are sensitive in HTML. This avoids potential attacks caused by including JavaScript codes in the request URL that is often reported in error messages.- Parameters:
message
- The message string to be filtered
-
filter
Filter the specified message string for characters that are sensitive in HTML. This avoids potential attacks caused by including JavaScript codes in the request URL that is often reported in error messages.- Parameters:
message
- The message string to be filtered
-