|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.LdapUtils
public final class LdapUtils
Provides utility methods for this package.
| Method Summary | ||
|---|---|---|
static boolean |
areEqual(Object o1,
Object o2)
Determines equality of the supplied objects by delegating to their hashCode methods. |
|
static byte[] |
base64Decode(String value)
This will decode the supplied value as a base64 encoded string to a byte[]. |
|
static String |
base64Encode(byte[] value)
This will convert the supplied value to a base64 encoded string. |
|
static String |
base64Encode(String value)
This will convert the supplied value to a base64 encoded string. |
|
static int |
computeHashCode(int seed,
Object... objects)
Computes a hash code for the supplied objects using the supplied seed. |
|
static
|
concatArrays(T[] first,
T[]... rest)
Concatenates multiple arrays together. |
|
static InputStream |
getResource(String path)
Parses the supplied path and returns an input stream based on the prefix in the path. |
|
static byte[] |
hexDecode(char[] value)
This will decode the supplied value as a hex encoded string to a byte[]. |
|
static char[] |
hexEncode(byte[] value)
This will convert the supplied value to a hex encoded string. |
|
static char[] |
hexEncode(char... value)
This will convert the supplied value to a hex encoded string. |
|
static boolean |
isIPAddress(String s)
Returns whether the supplied string represents an IP address. |
|
static String |
percentDecode(String value)
Implementation of percent decoding as described in RFC 3986 section 2.1. |
|
static String |
percentEncode(String value)
Implementation of percent encoding as described in RFC 3986 section 2.1. |
|
static byte[] |
readInputStream(InputStream is)
Reads the data in the supplied stream and returns it as a byte array. |
|
static byte[] |
readURL(URL url)
Reads the data at the supplied URL and returns it as a byte array. |
|
static String |
utf8Encode(byte[] value)
This will convert the supplied value to a UTF-8 encoded string. |
|
static byte[] |
utf8Encode(String value)
This will convert the supplied value to a UTF-8 encoded byte array. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String base64Encode(byte[] value)
value - to base64 encode
public static String base64Encode(String value)
value - to base64 encode
public static String utf8Encode(byte[] value)
value - to UTF-8 encode
public static byte[] utf8Encode(String value)
value - to UTF-8 encode
public static char[] hexEncode(byte[] value)
value - to hex encode
public static char[] hexEncode(char... value)
value - to hex encode
public static String percentEncode(String value)
value - to encode
public static byte[] base64Decode(String value)
value - to base64 decode
public static byte[] hexDecode(char[] value)
value - to hex decode
public static String percentDecode(String value)
value - to decode
public static byte[] readURL(URL url)
throws IOException
url - to read
IOException - if an error occurs reading data
public static byte[] readInputStream(InputStream is)
throws IOException
is - stream to read
IOException - if an error occurs reading data
public static <T> T[] concatArrays(T[] first,
T[]... rest)
T - type of arrayfirst - array to concatenate. Cannot be null.rest - of the arrays to concatenate. May be null.
public static boolean areEqual(Object o1,
Object o2)
o1 - to test equality ofo2 - to test equality of
public static int computeHashCode(int seed,
Object... objects)
seed - odd/prime numberobjects - to calculate hashCode for
public static boolean isIPAddress(String s)
s - to match
public static InputStream getResource(String path)
throws IOException
path - that designates a resource
IOException - if the resource cannot be read
IllegalArgumentException - if path is not prefixed with either
'classpath:' or 'file:'
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||