mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
06.38.2012 90ff70d4c2a798957d2d6eabe367d0a271b794ca
opendj3/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ConsoleApplication.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions copyright 2011 ForgeRock AS
 *      Portions copyright 2011-2012 ForgeRock AS
 *      Portions copyright 2011 Nemanja Lukić
 */
package com.forgerock.opendj.ldap.tools;
@@ -46,7 +46,7 @@
 */
abstract class ConsoleApplication
{
  private final PrintStream err = new PrintStream(System.out);
  private final PrintStream err = new PrintStream(System.err);
  private final BufferedReader reader = new BufferedReader(
      new InputStreamReader(System.in));
@@ -70,6 +70,29 @@
  /**
   * Closes the provided {@code Closeable} if it is not {@code null}.
   *
   * @param closeable
   *          The closeable to be closed.
   */
  final void closeIfNotNull(Closeable closeable)
  {
    if (closeable != null)
    {
      try
      {
        closeable.close();
      }
      catch (Exception ignored)
      {
        // Do nothing.
      }
    }
  }
  /**
   * Returns the application error stream.
   *
   * @return The application error stream.