org.apache.myfaces.trinidadinternal.share.util
Class CaboHttpUtils

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.share.util.CaboHttpUtils

public class CaboHttpUtils
extends java.lang.Object

Utilities for working with HTTP.

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/share/util/CaboHttpUtils.java#0 $) $Date: 10-nov-2005.18:59:22 $
Author:
The Oracle ADF Faces Team

Method Summary
static java.lang.String[] decodeQValueString(java.lang.String string)
          Given a string that uses q-value encodings, returns a sorted array of strings from most-preferred to least.
static java.lang.String decodeRequestParameter(java.lang.String string, java.lang.String encoding, byte[] buffer)
          Given a parameter string and the name of a character encoding, fixes the string.
static void validateEncoding(java.lang.String encoding)
          Throws an UnsupportedEncodingException if the provided encoding is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

validateEncoding

public static void validateEncoding(java.lang.String encoding)
                             throws java.io.UnsupportedEncodingException
Throws an UnsupportedEncodingException if the provided encoding is not supported.

Parameters:
encoding - the name of a character encoding
Throws:
java.io.UnsupportedEncodingException

decodeRequestParameter

public static final java.lang.String decodeRequestParameter(java.lang.String string,
                                                            java.lang.String encoding,
                                                            byte[] buffer)
                                                     throws java.io.UnsupportedEncodingException
Given a parameter string and the name of a character encoding, fixes the string. The Servlet API builds Strings for all submitted data as if they were ISO-8859-1 encoded; this function undoes the damage. Clients should pass in the same encoding that they used for generating the page that the submission comes from.

Parameters:
string - the string
encoding - the name of a character encoding
buffer - an optional byte buffer, for reuse; pass null if you're not calling this function repeatedly
Throws:
java.io.UnsupportedEncodingException

decodeQValueString

public static java.lang.String[] decodeQValueString(java.lang.String string)
Given a string that uses q-value encodings, returns a sorted array of strings from most-preferred to least. For example, given "foo;0.25,bar,baz;0.5", this will return ["bar", "baz", "foo"].



Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.