Package de.umass.util
Class StringUtilities
java.lang.Object
de.umass.util.StringUtilities
Utilitiy class with methods to calculate an md5 hash and to encode URLs.
- Author:
- Janni Kovacs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Strips all characters from a String, that might be invalid to be used in file names.static boolean
convertToBoolean
(String resultString) Converts a Last.fm boolean result string to a boolean.static String
static String
static boolean
static boolean
Tests if the given string might already be a 32-char md5 string.Creates a Map out of an array with Strings.static String
-
Constructor Details
-
StringUtilities
public StringUtilities()
-
-
Method Details
-
md5
-
encode
-
decode
-
isMbid
-
map
Creates a Map out of an array with Strings.- Parameters:
strings
- input strings, key-value alternating- Returns:
- a parameter map
-
cleanUp
Strips all characters from a String, that might be invalid to be used in file names. By default : / \ invalid input: '<' > | ? " * are all replaced by -. Note that this is no guarantee that the returned name will be definately valid.- Parameters:
s
- the String to clean up- Returns:
- the cleaned up String
-
isMD5
Tests if the given string might already be a 32-char md5 string.- Parameters:
s
- String to test- Returns:
true
if the given String might be a md5 string
-
convertToBoolean
Converts a Last.fm boolean result string to a boolean.- Parameters:
resultString
- A Last.fm boolean result string.- Returns:
true
if the given String represents a true,false
otherwise.
-