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

jvergara
24.46.2009 18de8b9ed9f6ba9780d3292d2828f67de08b7483
opends/src/server/org/opends/server/util/args/ArgumentParser.java
@@ -1828,5 +1828,38 @@
  {
    return versionPresent;
  }
  /**
   * Get the password which has to be used for the command without prompting
   * the user.  If no password was specified, return null.
   *
   * @param clearArg
   *          The password StringArgument argument.
   * @param fileArg
   *          The password FileBased argument.
   * @return The password stored into the specified file on by the
   *         command line argument, or null it if not specified.
   */
  public static String getBindPassword(StringArgument clearArg,
      FileBasedArgument fileArg)
  {
    String pwd;
    if (clearArg.isPresent())
    {
      pwd = clearArg.getValue();
    }
    else
    if (fileArg.isPresent())
    {
      pwd = fileArg.getValue();
    }
    else
    {
      pwd = null;
    }
    return pwd;
  }
}