From dc4fc6e5e768a3099d8ca617c713654d29eaa2f7 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 09 Oct 2006 22:53:54 +0000
Subject: [PATCH] Update the LDAP client tools to avoid explicit calls to System.err instead of using the defined print stream for error messages.
---
opends/src/server/org/opends/server/tools/LDAPSearchOptions.java | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/LDAPSearchOptions.java b/opends/src/server/org/opends/server/tools/LDAPSearchOptions.java
index 4e4b359..0d84db0 100644
--- a/opends/src/server/org/opends/server/tools/LDAPSearchOptions.java
+++ b/opends/src/server/org/opends/server/tools/LDAPSearchOptions.java
@@ -26,6 +26,8 @@
*/
package org.opends.server.tools;
+import java.io.PrintStream;
+
import org.opends.server.types.DereferencePolicy;
import org.opends.server.types.SearchScope;
@@ -112,12 +114,14 @@
* Set the search scope .
*
* @param scope The search scope string.
+ * @param err A print stream to which error messages should be written if
+ * a problem occurs.
*
* @return <CODE>true</CODE> if the scope was set properly, or
* <CODE>false</CODE> if not.
*/
- public boolean setSearchScope(String scope)
+ public boolean setSearchScope(String scope, PrintStream err)
{
if(scope == null)
{
@@ -138,7 +142,7 @@
} else
{
int msgID = MSGID_SEARCH_INVALID_SEARCH_SCOPE;
- System.err.println(getMessage(msgID, scope));
+ err.println(getMessage(msgID, scope));
return false;
}
return true;
@@ -157,13 +161,15 @@
/**
* Set the dereference policy.
*
- * @param policy The dereference policy.
+ * @param policy The dereference policy.
+ * @param err A print stream to which error messages should be written if
+ * a problem occurs.
*
* @return <CODE>true</CODE> if the dereference policy was set properly, or
* <CODE>false</CODE> if not.
*/
- public boolean setDereferencePolicy(String policy)
+ public boolean setDereferencePolicy(String policy, PrintStream err)
{
if(policy == null)
{
@@ -182,7 +188,7 @@
dereferencePolicy = DEREF_FINDING_BASE_OBJECT;
} else
{
- System.err.println("Invalid deref alias specified:" + policy);
+ err.println("Invalid deref alias specified:" + policy);
return false;
}
return true;
--
Gitblit v1.10.0