org.jboss.resteasy.util
Class Encode

java.lang.Object
  extended by org.jboss.resteasy.util.Encode

public class Encode
extends java.lang.Object

Version:
$Revision: 1 $
Author:
Bill Burke

Constructor Summary
Encode()
           
 
Method Summary
static MultivaluedMap<java.lang.String,java.lang.String> decode(MultivaluedMap<java.lang.String,java.lang.String> map)
          decode an encoded map
static java.lang.String decode(java.lang.String string)
           
static java.lang.String decodePath(java.lang.String path)
           
static MultivaluedMap<java.lang.String,java.lang.String> encode(MultivaluedMap<java.lang.String,java.lang.String> map)
           
static java.lang.String encodeFragment(java.lang.String value)
          Keep encoded values "%..." and template parameters intact.
static java.lang.String encodeFragmentAsIs(java.lang.String nameOrValue)
           
protected static java.lang.String encodeFromArray(java.lang.String segment, java.lang.String[] encodingMap, boolean encodePercent)
           
static java.lang.String encodeMatrixParam(java.lang.String value)
          Keep encoded values "%..." and template parameters intact.
static java.lang.String encodeNonCodes(java.lang.String string)
          Encode '%' if it is not an encoding sequence
static java.lang.String encodePath(java.lang.String value)
          Keep encoded values "%...", matrix parameters, template parameters, and '/' characters intact.
static java.lang.String encodePathAsIs(java.lang.String segment)
          Encode via RFC 3986.
static java.lang.String encodePathSaveEncodings(java.lang.String segment)
          Keep any valid encodings from string i.e.
static java.lang.String encodePathSegment(java.lang.String value)
          Keep encoded values "%...", matrix parameters and template parameters intact.
static java.lang.String encodeQueryParam(java.lang.String value)
          Keep encoded values "%..." and template parameters intact.
static java.lang.String encodeQueryParamAsIs(java.lang.String nameOrValue)
          Encodes everything of a query parameter name or value.
static java.lang.String encodeQueryParamSaveEncodings(java.lang.String segment)
          Keep any valid encodings from string i.e.
static java.lang.String encodeQueryString(java.lang.String value)
          Keep encoded values "%..." and template parameters intact.
static java.lang.String encodeValue(java.lang.String segment, java.lang.String[] encoding)
          Keep encoded values "%..." and template parameters intact i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encode

public Encode()
Method Detail

encodeQueryString

public static java.lang.String encodeQueryString(java.lang.String value)
Keep encoded values "%..." and template parameters intact.


encodePath

public static java.lang.String encodePath(java.lang.String value)
Keep encoded values "%...", matrix parameters, template parameters, and '/' characters intact.


encodePathSegment

public static java.lang.String encodePathSegment(java.lang.String value)
Keep encoded values "%...", matrix parameters and template parameters intact.


encodeFragment

public static java.lang.String encodeFragment(java.lang.String value)
Keep encoded values "%..." and template parameters intact.


encodeMatrixParam

public static java.lang.String encodeMatrixParam(java.lang.String value)
Keep encoded values "%..." and template parameters intact.


encodeQueryParam

public static java.lang.String encodeQueryParam(java.lang.String value)
Keep encoded values "%..." and template parameters intact.


decodePath

public static java.lang.String decodePath(java.lang.String path)

encodeNonCodes

public static java.lang.String encodeNonCodes(java.lang.String string)
Encode '%' if it is not an encoding sequence

Parameters:
string -
Returns:

encodeValue

public static java.lang.String encodeValue(java.lang.String segment,
                                           java.lang.String[] encoding)
Keep encoded values "%..." and template parameters intact i.e. "{x}"

Parameters:
segment -
encoding -
Returns:

encodePathAsIs

public static java.lang.String encodePathAsIs(java.lang.String segment)
Encode via RFC 3986. PCHAR is allowed allong with '/'

unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" pchar = unreserved / pct-encoded / sub-delims / ":" / "@"


encodePathSaveEncodings

public static java.lang.String encodePathSaveEncodings(java.lang.String segment)
Keep any valid encodings from string i.e. keep "%2D" but don't keep "%p"

Parameters:
segment -
Returns:

encodeQueryParamAsIs

public static java.lang.String encodeQueryParamAsIs(java.lang.String nameOrValue)
Encodes everything of a query parameter name or value.

Parameters:
nameOrValue -
Returns:

encodeQueryParamSaveEncodings

public static java.lang.String encodeQueryParamSaveEncodings(java.lang.String segment)
Keep any valid encodings from string i.e. keep "%2D" but don't keep "%p"

Parameters:
segment -
Returns:

encodeFragmentAsIs

public static java.lang.String encodeFragmentAsIs(java.lang.String nameOrValue)

encodeFromArray

protected static java.lang.String encodeFromArray(java.lang.String segment,
                                                  java.lang.String[] encodingMap,
                                                  boolean encodePercent)

decode

public static MultivaluedMap<java.lang.String,java.lang.String> decode(MultivaluedMap<java.lang.String,java.lang.String> map)
decode an encoded map

Parameters:
map -
Returns:

encode

public static MultivaluedMap<java.lang.String,java.lang.String> encode(MultivaluedMap<java.lang.String,java.lang.String> map)

decode

public static java.lang.String decode(java.lang.String string)


Copyright © 2010. All Rights Reserved.