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

Gaetan Boismal
25.30.2016 6ea56ecde3d05b84f42a7338d7c2c159817d00d0
opendj-server-legacy/src/main/java/org/opends/server/tools/EncodePassword.java
@@ -18,7 +18,6 @@
import static com.forgerock.opendj.cli.ArgumentConstants.*;
import static com.forgerock.opendj.cli.CliMessages.INFO_FILE_PLACEHOLDER;
import static com.forgerock.opendj.cli.CliMessages.ERR_TOOL_CONFLICTING_ARGS;
import static com.forgerock.opendj.cli.Utils.*;
import static com.forgerock.opendj.cli.CommonArguments.*;
@@ -264,35 +263,19 @@
    }
    // Check for conflicting arguments.
    if (clearPassword.isPresent() && clearPasswordFile.isPresent())
    try
    {
      printWrappedText(err,
          ERR_TOOL_CONFLICTING_ARGS.get(clearPassword.getLongIdentifier(), clearPasswordFile.getLongIdentifier()));
      throwIfArgumentsConflict(clearPassword, clearPasswordFile);
      throwIfArgumentsConflict(clearPassword, interactivePassword);
      throwIfArgumentsConflict(clearPasswordFile, interactivePassword);
      throwIfArgumentsConflict(encodedPassword, encodedPasswordFile);
    }
    catch (final ArgumentException conflict)
    {
      printWrappedText(err, conflict.getMessageObject());
      return OPERATIONS_ERROR;
    }
    if (clearPassword.isPresent() && interactivePassword.isPresent())
    {
      printWrappedText(err,
          ERR_TOOL_CONFLICTING_ARGS.get(clearPassword.getLongIdentifier(), interactivePassword.getLongIdentifier()));
      return OPERATIONS_ERROR;
    }
    if (clearPasswordFile.isPresent() && interactivePassword.isPresent())
    {
      printWrappedText(err, ERR_TOOL_CONFLICTING_ARGS.get(clearPasswordFile.getLongIdentifier(),
                                                          interactivePassword.getLongIdentifier()));
      return OPERATIONS_ERROR;
    }
    if (encodedPassword.isPresent() && encodedPasswordFile.isPresent())
    {
      printWrappedText(err,
          ERR_TOOL_CONFLICTING_ARGS.get(encodedPassword.getLongIdentifier(), encodedPasswordFile.getLongIdentifier()));
      return OPERATIONS_ERROR;
    }
    // If we are not going to just list the storage schemes, then the clear-text
    // password must have been provided.  If we're going to encode a password,
    // then the scheme must have also been provided.