From 6f5e10b0dc596c8e7625de7ddf523b6d5bc220c7 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Thu, 27 Feb 2014 08:17:06 +0000
Subject: [PATCH] Checkpoint for OPENDJ-1303 "opendj-cli" / Checkpoint OPENDJ-1343 Migrate dsconfig - Added CONFLICTING_ARGS to ReturnCode. - Added canWrite() to Utils + unit tests. - Replaced calls to org.opends.quicksetup.util.Utils.canWrite by com.forgerock.opendj.cli.Utils.canWrite. - Removed the TablePrinter classes from org.opends.server.util.table as they are now in the opendj-cli. - Minor code cleanup on DSConfig package. (reorganize imports).
---
opendj3-server-dev/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java | 20 ++++++++------------
1 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/opendj3-server-dev/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java b/opendj3-server-dev/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java
index cfff15c..87654fe 100644
--- a/opendj3-server-dev/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java
+++ b/opendj3-server-dev/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java
@@ -27,9 +27,11 @@
package org.opends.server.admin.client.cli;
import static com.forgerock.opendj.cli.CliMessages.INFO_DESCRIPTION_ADMIN_PORT;
-import static org.opends.server.tools.JavaPropertiesTool.ErrorReturnCode.*;
+import static com.forgerock.opendj.cli.Utils.LINE_SEPARATOR;
import static org.opends.messages.AdminToolMessages.*;
import static org.opends.messages.ToolMessages.*;
+import static com.forgerock.opendj.cli.ReturnCode.SUCCESS;
+import static com.forgerock.opendj.cli.ReturnCode.CONFLICTING_ARGS;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageBuilder;
@@ -188,12 +190,6 @@
private boolean configurationInitialized = false;
private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
- /**
- * End Of Line.
- */
- public static String EOL = System.getProperty("line.separator");
-
-
// Defines if the CLI always use the SSL connection type.
private boolean alwaysSSL = false;
@@ -316,7 +312,7 @@
try
{
err.write(wrapText(ex.getMessage(), MAX_LINE_WIDTH).getBytes());
- err.write(EOL.getBytes());
+ err.write(LINE_SEPARATOR.getBytes());
}
catch (IOException e)
{
@@ -348,7 +344,7 @@
try
{
err.write(wrapText(ex.getMessage(), MAX_LINE_WIDTH).getBytes());
- err.write(EOL.getBytes());
+ err.write(LINE_SEPARATOR.getBytes());
}
catch (IOException e)
{
@@ -635,14 +631,14 @@
{
if (buf.length() > 0)
{
- buf.append(EOL);
+ buf.append(LINE_SEPARATOR);
}
buf.append(error);
}
- return CONFLICTING_ARGS.getReturnCode();
+ return CONFLICTING_ARGS.get();
}
- return SUCCESSFUL_NOP.getReturnCode();
+ return SUCCESS.get();
}
/**
* Indication if provided global options are validate.
--
Gitblit v1.10.0