public class LDAPToolUtils extends Object
| Constructor and Description |
|---|
LDAPToolUtils() |
| Modifier and Type | Method and Description |
|---|---|
static LDAPControl |
getControl(String argString,
PrintStream err)
Parse the specified command line argument to create the
appropriate LDAPControl.
|
static String |
getMessageForConnectionException(org.forgerock.opendj.ldap.DecodeException ae)
Returns the message to be displayed to the user when an exception occurs.
|
static void |
printErrorMessage(PrintStream err,
LocalizableMessage explanation,
int resultCode,
LocalizableMessage errorMessage,
DN matchedDN)
Prints a multi-line error message with the provided information to the
given print stream.
|
static byte[] |
readBytesFromFile(String filePath,
PrintStream err)
Read the data from the specified file and return it in a byte array.
|
public LDAPToolUtils()
public static LDAPControl getControl(String argString, PrintStream err)
argString - The argument string containing the encoded control
information.err - A print stream to which error messages should be
written if a problem occurs.null
if an error occurs while parsing the argument value.public static byte[] readBytesFromFile(String filePath, PrintStream err) throws IOException
filePath - The path to the file that should be read.err - A print stream to which error messages should be
written if a problem occurs.IOException - If a problem occurs while trying to read the
specified file.public static void printErrorMessage(PrintStream err, LocalizableMessage explanation, int resultCode, LocalizableMessage errorMessage, DN matchedDN)
err - The print stream to use to write the error message.explanation - The general explanation to provide to the user, or
null if there is none.resultCode - The result code returned from the server, or -1 if
there is none.errorMessage - The additional information / error message returned
from the server, or null if there was none.matchedDN - The matched DN returned from the server, or
null if there was none.public static String getMessageForConnectionException(org.forgerock.opendj.ldap.DecodeException ae)
ae - the DecodeException that occurred connecting to the server or
handling the response from the server.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.