org.glassfish.grizzly.http.util
Class HttpUtils

java.lang.Object
  extended by org.glassfish.grizzly.http.util.HttpUtils

public class HttpUtils
extends Object

Utility class.

Author:
Alexey Stashok

Constructor Summary
HttpUtils()
           
 
Method Summary
static float convertQValueToFloat(Buffer buffer, int startIdx, int stopIdx)
           
static float convertQValueToFloat(char[] chars, int startIdx, int stopIdx)
           
static float convertQValueToFloat(DataChunk dc, int startIdx, int stopIdx)
           
static float convertQValueToFloat(String string, int startIdx, int stopIdx)
           
static String filter(String message)
          Filter the specified message string for characters that are sensitive in HTML.
static void longToBuffer(long value, Buffer buffer)
          Converts the specified long as a string representation to the provided buffer.
static int longToBuffer(long value, byte[] buffer)
          Converts the specified long as a string representation to the provided byte buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpUtils

public HttpUtils()
Method Detail

convertQValueToFloat

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

convertQValueToFloat

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

convertQValueToFloat

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

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 off Long.toString()

Parameters:
value - the long to convert.
buffer - the buffer to write the conversion result to.

longToBuffer

public static void longToBuffer(long value,
                                Buffer buffer)
Converts the specified long as a string representation to the provided buffer. This code is based off Long.toString()

Parameters:
value - the long to convert.
buffer - the buffer to write the conversion result to.

filter

public static String filter(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 - The message string to be filtered


Copyright © 2012 Oracle Corporation. All Rights Reserved.