public final class LdapUtil extends Object
LdapUtil
provides helper methods for Ldap
.Modifier and Type | Method and Description |
---|---|
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 boolean |
checkCredential(Object credential)
This checks a credential to ensure it is the right type and it is not
empty.
|
static boolean |
isIPAddress(String s)
Returns whether the supplied string represents an IP address.
|
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.
|
public static boolean checkCredential(Object credential)
credential
- Object
to checkboolean
- whether the credential is validpublic static String base64Encode(byte[] value)
value
- byte[]
to base64 encodeString
public static String base64Encode(String value)
value
- String
to base64 encodeString
public static byte[] base64Decode(String value)
value
- Object
to base64 encodeString
public static byte[] readURL(URL url) throws IOException
url
- URL
to readbyte[]
read from URLIOException
- if an error occurs reading datapublic static byte[] readInputStream(InputStream is) throws IOException
is
- InputStream
to readbyte[]
read from the streamIOException
- if an error occurs reading datapublic static boolean isIPAddress(String s)
s
- to matchCopyright © 2016. All rights reserved.