From 4e4b322332130bf466e3bdbd9cd7c4ca832d1049 Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Fri, 17 Jul 2015 13:29:00 +0000
Subject: [PATCH] OPENDJ-2027 (CR-7617) Code cleanup

---
 opendj-cli/src/main/java/com/forgerock/opendj/cli/Utils.java |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/opendj-cli/src/main/java/com/forgerock/opendj/cli/Utils.java b/opendj-cli/src/main/java/com/forgerock/opendj/cli/Utils.java
index 3edc833..d69eff3 100644
--- a/opendj-cli/src/main/java/com/forgerock/opendj/cli/Utils.java
+++ b/opendj-cli/src/main/java/com/forgerock/opendj/cli/Utils.java
@@ -35,6 +35,7 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.PrintStream;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.security.GeneralSecurityException;
@@ -612,4 +613,30 @@
         }
         return host;
     }
+
+    /**
+     * Prints the provided string on the provided stream.
+     *
+     * @param stream
+     *            The stream to print the message.
+     * @param message
+     *            The message to print.
+     */
+    public static void printWrappedText(final PrintStream stream, final String message) {
+        if (stream != null && message != null) {
+            stream.println(wrapText(message, MAX_LINE_WIDTH));
+        }
+    }
+
+    /**
+     * Print the provided message on the provided stream.
+     *
+     * @param stream
+     *            The stream to print the message.
+     * @param message
+     *            The message to print.
+     */
+    public static void printWrappedText(final PrintStream stream, final LocalizableMessage message) {
+        printWrappedText(stream, message != null ? message.toString() : null);
+    }
 }

--
Gitblit v1.10.0