com.ibm.wsspi.http
Interface EncodingUtils
- public interface EncodingUtils
Method Summary
Modifier and Type | Method and Description |
---|---|
|
getCharsetFromContentType(java.lang.String type)
Basically returns everything after ";charset=".
|
|
getDefaultEncoding()
Query the default encoding.
|
|
getEncodingFromLocale(java.util.Locale locale)
Get the encoding for a passed in locale.
|
|
getJvmConverter(java.lang.String encoding)
Get the JVM Converter for the specified encoding.
|
|
getLocales(java.lang.String acceptLangHdr)
Returns a list of locales from the passed in Accept-Language header.
|
|
isCharsetSupported(java.lang.String charset)
Tests whether the specified charset is supported on the server.
|
|
stripQuotes(java.lang.String value)
Utility method to trim off any leading or trailing quotes (single or
double).
|
Method Detail
getDefaultEncoding
- java.lang.String getDefaultEncoding( )
Query the default encoding.
Returns:
String
getCharsetFromContentType
- java.lang.String getCharsetFromContentType( java.lang.String type)
Basically returns everything after ";charset=". If no charset specified,
return null.
Parameters:
type
- to extract the charset from. Returns:
The charset encoding.
getLocales
- java.util.List<java.util.Locale> getLocales( java.lang.String acceptLangHdr)
Returns a list of locales from the passed in Accept-Language header.
Parameters:
acceptLangHdr
- Returns:
List
getEncodingFromLocale
- java.lang.String getEncodingFromLocale( java.util.Locale locale)
Get the encoding for a passed in locale.
Parameters:
locale
- Returns:
The encoding.
getJvmConverter
- java.lang.String getJvmConverter( java.lang.String encoding)
Get the JVM Converter for the specified encoding.
Parameters:
encoding
- Returns:
The converter if it exists, otherwise return the encoding.
isCharsetSupported
- boolean isCharsetSupported(java.lang.String charset)
Tests whether the specified charset is supported on the server.
Parameters:
charset
- we want to test Returns:
boolean indicating if supported
stripQuotes
- java.lang.String stripQuotes(java.lang.String value)
Utility method to trim off any leading or trailing quotes (single or
double).
Parameters:
value
- Returns:
String (null if null input provided)