be.hogent.tarsos.util
Class StringUtils

java.lang.Object
  extended by be.hogent.tarsos.util.StringUtils

public final class StringUtils
extends java.lang.Object


Method Summary
static java.lang.String join(java.util.List<?> data, java.lang.String separator)
          Joins elements in a list with separator.
static java.lang.String messageDigestFive(java.lang.String dataToEncode)
          Calculates an MD5 hash for a text.
static java.lang.String sanitize(java.lang.String data)
          replaces UTF-8 characters and spaces with _ .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sanitize

public static java.lang.String sanitize(java.lang.String data)
replaces UTF-8 characters and spaces with _ . Returns the complete path.

E.g. /tmp/01.��skar ton.mp3 is converted to: /tmp/01.__skar_ton.mp3

Parameters:
data - the data to sanitize
Returns:
the complete sanitized path.

join

public static java.lang.String join(java.util.List<?> data,
                                    java.lang.String separator)
Joins elements in a list with separator.

Parameters:
data -
separator -
Returns:
A joined list, joined by the separator.

messageDigestFive

public static java.lang.String messageDigestFive(java.lang.String dataToEncode)
Calculates an MD5 hash for a text.

Parameters:
dataToEncode - The data to encode.
Returns:
A text representation of a hexadecimal value of length 32.