|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fcrepo.server.utilities.StringUtility
public class StringUtility
A utility class for common string operations.
| Constructor Summary | |
|---|---|
StringUtility()
|
|
| Method Summary | |
|---|---|
static String |
byteArraytoHexString(byte[] array)
|
static byte[] |
hexStringtoByteArray(String str)
|
static void |
main(String[] args)
|
static String |
prettyPrint(String in,
int lineLength,
String delim)
Method that attempts to break a string up into lines no longer than the specified line length. |
static String |
splitAndIndent(String str,
int indent,
int numChars)
Method that attempts to break a string up into lines no longer than the specified line length. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringUtility()
| Method Detail |
|---|
public static String prettyPrint(String in,
int lineLength,
String delim)
The string is assumed to consist of tokens separated by a delimeter. The default delimiter is a space. If the last token to be added to a line exceeds the specified line length, it is written on the next line so actual line length is approximate given the specified line length and the length of tokens in the string.
in - The input string to be split into lines.lineLength - The maximum length of each line.delim - The character delimiter separating each token in the input string;
if null, defaults to the space character.
public static String splitAndIndent(String str,
int indent,
int numChars)
The string is assumed to a large chunk of undifferentiated text such as base 64 encoded binary data.
str - The input string to be split into lines.indent - The number of spaces to insert at the start of each line.numChars - The maximum length of each line (not counting the indent spaces).
public static String byteArraytoHexString(byte[] array)
public static byte[] hexStringtoByteArray(String str)
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||