public class StringUtils extends Object
Modifier and Type | Field and Description |
---|---|
private static String |
HEXDIGITS
The Constant HEXDIGITS.
|
Modifier | Constructor and Description |
---|---|
protected |
StringUtils()
Instantiates a new string utils.
|
Modifier and Type | Method and Description |
---|---|
static Boolean |
containsOneOf(List<Integer> list1,
List<Integer> list2)
Checks if one list contains one or more elements of the second list.
|
static String |
encodeURL(String text,
String encoding)
Encode url.
|
private static boolean |
isCharacterURLSafe(char c)
Check whether the given character is safe for being part of an url.
|
private static void |
transformURL(StringBuffer buffer,
String toEncode,
String encoding)
Transform the given string into URL encoded String.
|
private static final String HEXDIGITS
public static String encodeURL(String text, String encoding) throws UnsupportedEncodingException
text
- the textencoding
- the encodingUnsupportedEncodingException
- the unsupported encoding exceptionprivate static void transformURL(StringBuffer buffer, String toEncode, String encoding) throws UnsupportedEncodingException
buffer
- where to append the URL encoded StringtoEncode
- to encodeencoding
- used encodingUnsupportedEncodingException
- the unsupported encoding exceptionprivate static boolean isCharacterURLSafe(char c)
c
- character to checkCopyright © 2014 Gentics Software GmbH. All Rights Reserved.