Top Description Fields Constructors Methods
org.glassfish.grizzly.http.util

public Class HttpUtils

extends Object
Class Inheritance
Imports
java.io.CharConversionException, org.glassfish.grizzly.Buffer, org.glassfish.grizzly.utils.Charsets

Utility class.
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
private static final float[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static String
composeContentType(final String contentType, final String characterEncoding)

public static float
convertQValueToFloat(final DataChunk dc, final int startIdx, final int stopIdx)

public static float
convertQValueToFloat(final Buffer buffer, final int startIdx, final int stopIdx)

public static float
convertQValueToFloat(final String string, final int startIdx, final int stopIdx)

public static float
convertQValueToFloat(final char[] chars, final int startIdx, final int stopIdx)

public static DataChunk
filter(DataChunk
The message string to be filtered
message
)

Filter the specified message string for characters that are sensitive in HTML.

public static String
filter(final String
The message string to be filtered
message
)

Filter the specified message string for characters that are sensitive in HTML.

public static DataChunk
filterNonPrintableCharacters(DataChunk message)

Filter non-printable ASCII characters.

public static int
longToBuffer(long
the long to convert.
value
,
final byte[]
the buffer to write the conversion result to.
buffer
)

Converts the specified long as a string representation to the provided byte buffer.

public static void
longToBuffer(long
the long to convert.
value
,
final Buffer
the buffer to write the conversion result to.
buffer
)

Converts the specified long as a string representation to the provided buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MULTIPLIERSback to summary
private static final float[] MULTIPLIERS

Constructor Detail

HttpUtilsback to summary
public HttpUtils()

Method Detail

composeContentTypeback to summary
public static String composeContentType(final String contentType, final String characterEncoding)
convertQValueToFloatback to summary
public static float convertQValueToFloat(final DataChunk dc, final int startIdx, final int stopIdx)
convertQValueToFloatback to summary
public static float convertQValueToFloat(final Buffer buffer, final int startIdx, final int stopIdx)
convertQValueToFloatback to summary
public static float convertQValueToFloat(final String string, final int startIdx, final int stopIdx)
convertQValueToFloatback to summary
public static float convertQValueToFloat(final char[] chars, final int startIdx, final int stopIdx)
filterback to summary
public static DataChunk filter(DataChunk message)

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:DataChunk

The message string to be filtered

filterback to summary
public static String filter(final String message)

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:String

The message string to be filtered

filterNonPrintableCharactersback to summary
public static DataChunk filterNonPrintableCharacters(DataChunk message)

Filter non-printable ASCII characters.

longToBufferback to summary
public static int longToBuffer(long value, final byte[] buffer)

Converts the specified long as a string representation to the provided byte buffer. This code is based off Long#toString()

Parameters
value:long

the long to convert.

buffer:byte[]

the buffer to write the conversion result to.

longToBufferback to summary
public static void longToBuffer(long value, final Buffer buffer)

Converts the specified long as a string representation to the provided buffer. This code is based off Long#toString()

Parameters
value:long

the long to convert.

buffer:Buffer

the buffer to write the conversion result to.