edu.vt.middleware.ldap
public final class LdapUtil extends java.lang.Object
LdapUtil
provides helper methods for Ldap
.Modifier and Type | Method and Description |
---|---|
static byte[] |
base64Decode(java.lang.String value)
This will decode the supplied value as a base64 encoded string to a byte[].
|
static java.lang.String |
base64Encode(byte[] value)
This will convert the supplied value to a base64 encoded string.
|
static java.lang.String |
base64Encode(java.lang.String value)
This will convert the supplied value to a base64 encoded string.
|
static boolean |
checkCredential(java.lang.Object credential)
This checks a credential to ensure it is the right type and it is not
empty.
|
static boolean |
isIPAddress(java.lang.String s)
Returns whether the supplied string represents an IP address.
|
static byte[] |
readInputStream(java.io.InputStream is)
Reads the data in the supplied stream and returns it as a byte array.
|
static byte[] |
readURL(java.net.URL url)
Reads the data at the supplied URL and returns it as a byte array.
|
public static boolean checkCredential(java.lang.Object credential)
credential
- Object
to checkboolean
- whether the credential is validpublic static java.lang.String base64Encode(byte[] value)
value
- byte[]
to base64 encodeString
public static java.lang.String base64Encode(java.lang.String value)
value
- String
to base64 encodeString
public static byte[] base64Decode(java.lang.String value)
value
- Object
to base64 encodeString
public static byte[] readURL(java.net.URL url) throws java.io.IOException
url
- URL
to readbyte[]
read from URLjava.io.IOException
- if an error occurs reading datapublic static byte[] readInputStream(java.io.InputStream is) throws java.io.IOException
is
- InputStream
to readbyte[]
read from the streamjava.io.IOException
- if an error occurs reading datapublic static boolean isIPAddress(java.lang.String s)
s
- to matchCopyright © 2014. All Rights Reserved.