com.gentics.portal
Class StringUtils

java.lang.Object
  extended by com.gentics.portal.StringUtils

public class StringUtils
extends Object

String Util Class.

Author:
Christopher
 

Field Summary
private static String HEXDIGITS
          The Constant HEXDIGITS.
 
Constructor Summary
protected StringUtils()
          Instantiates a new string utils.
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEXDIGITS

private static final String HEXDIGITS
The Constant HEXDIGITS.

See Also:
Constant Field Values
Constructor Detail

StringUtils

protected StringUtils()
Instantiates a new string utils.

Method Detail

encodeURL

public static String encodeURL(String text,
                               String encoding)
                        throws UnsupportedEncodingException
Encode url.

Parameters:
text - the text
encoding - the encoding
Returns:
the string
Throws:
UnsupportedEncodingException - the unsupported encoding exception

transformURL

private static void transformURL(StringBuffer buffer,
                                 String toEncode,
                                 String encoding)
                          throws UnsupportedEncodingException
Transform the given string into URL encoded String.

Parameters:
buffer - where to append the URL encoded String
toEncode - to encode
encoding - used encoding
Throws:
UnsupportedEncodingException - the unsupported encoding exception

isCharacterURLSafe

private static boolean isCharacterURLSafe(char c)
Check whether the given character is safe for being part of an url.

Parameters:
c - character to check
Returns:
true when the character is safe for urls, false if not

containsOneOf

public static Boolean containsOneOf(List<Integer> list1,
                                    List<Integer> list2)
Checks if one list contains one or more elements of the second list.

Parameters:
list1 - the list1
list2 - the list2
Returns:
true if one element of list1 is also in list2


Copyright © 2014 Gentics Software GmbH. All Rights Reserved.