|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectuk.co.petertribble.jumble.JumbleUtils
public class JumbleUtils
Convenience routines.
| Constructor Summary | |
|---|---|
JumbleUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
byteToString(byte[] b)
Reads a String out of a byte array. |
static java.lang.String |
ListSystemProperties()
Retrieves all the system properties into a String |
static void |
printKeys(java.util.Hashtable h)
Prints all the keys in a Hashtable to the standard output |
static java.lang.String |
safeFileName(java.lang.String s)
Sanitizes a file name, replacing undesirable characters with the "_" character. |
static java.util.Hashtable<java.lang.String,java.lang.String> |
stringToPropHash(java.lang.String s,
java.lang.String delim)
Converts a String to a property hash. |
static java.util.Map<java.lang.String,java.lang.String> |
stringToPropMap(java.lang.String s,
java.lang.String delim)
Converts a String to a property Map. |
static java.lang.String[] |
stringToStringArray(java.lang.String s,
java.lang.String delim)
Converts a String to an Array of Strings
separated by the given separator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JumbleUtils()
| Method Detail |
|---|
public static java.lang.String ListSystemProperties()
String
String containing all the system properties,
one property per line, with the name and value of each property
separated by " = "public static void printKeys(java.util.Hashtable h)
Hashtable to the standard output
h - A Hashtable whose keys are to be outputpublic static java.lang.String safeFileName(java.lang.String s)
s - The filename to be sanitized
public static java.lang.String byteToString(byte[] b)
String out of a byte array.
b - An array of bytes to be converted to a
String
String
public static java.lang.String[] stringToStringArray(java.lang.String s,
java.lang.String delim)
String to an Array of Strings
separated by the given separator. Normally used to break a
String into its constituent lines.
This method is obsolete now that the String.split method is
available.
s - The String to be broken up.delim - The delimiter around which the String
will be broken up
Strings
public static java.util.Hashtable<java.lang.String,java.lang.String> stringToPropHash(java.lang.String s,
java.lang.String delim)
String to a property hash. The
String is first broken up using the specified delimiter.
Then the resulting Strings are broken up into a key
and value, with the key being anything to the left of the first
'=' character and the value anything that is left over. If no '='
character is present, that String is skipped.
s - The String to be broken up.delim - The delimiter around which the String
will be broken up
Hashtable containing the keys and values
specified by the input String
public static java.util.Map<java.lang.String,java.lang.String> stringToPropMap(java.lang.String s,
java.lang.String delim)
String to a property Map. The
String is first broken up using the specified delimiter.
Then the resulting Strings are broken up into a key
and value, with the key being anything to the left of the first
'=' character and the value anything that is left over. If no '='
character is present, that String is skipped.
s - The String to be broken up.delim - The delimiter around which the String
will be broken up
Map containing the keys and values
specified by the input String
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||