public class Miscellaneous
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.nio.charset.Charset |
UTF8 |
| Constructor and Description |
|---|
Miscellaneous() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
escape(java.lang.String name,
char... toEscape) |
static java.lang.String |
readFrom(java.io.InputStream is) |
static void |
requireNotEmpty(java.lang.String s)
Checks that given string is not empty (null check is also performed)
|
static void |
requireNotEmpty(java.lang.String s,
java.lang.String message)
Checks that given string is not empty (null check is also performed)
|
static void |
requireNotEmptyParameter(java.lang.String s,
java.lang.String parameter)
Checks that given string is not empty (null check is also performed)
|
static java.lang.String |
urlEncode(java.lang.String s) |
public static java.lang.String escape(java.lang.String name,
char... toEscape)
public static java.lang.String urlEncode(java.lang.String s)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic static java.lang.String readFrom(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic static void requireNotEmpty(java.lang.String s)
s - the string to checkjava.lang.IllegalArgumentException - if the string is emptyjava.lang.NullPointerException - if the string is nullpublic static void requireNotEmptyParameter(java.lang.String s,
java.lang.String parameter)
s - the string to checkparameter - the name of the parameter to be used in error messagesjava.lang.IllegalArgumentException - if the string is emptyjava.lang.NullPointerException - if the string is nullpublic static void requireNotEmpty(java.lang.String s,
java.lang.String message)
s - the string to checkmessage - the message to use in case it is emptyjava.lang.IllegalArgumentException - if the string is emptyjava.lang.NullPointerException - if the string is null