Skip to content

Commit

Permalink
Support for password types
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Jul 2, 2014
1 parent 58a5be6 commit e087a59
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -61,7 +61,18 @@ public void setVerbose(boolean verbose) {
protected abstract String getDefaultUsername();

protected String getPasswordType() {
return WSConstants.PW_DIGEST;
if (commandLine.hasOption('P')) {
String optionValue = commandLine.getOptionValue('P');
if ("text".equals(optionValue)) {
return WSConstants.PW_TEXT;
} else if ("digest".equals(optionValue)) {
return WSConstants.PW_DIGEST;
} else {
throw new IllegalArgumentException("Unknown password type "+optionValue);
}
} else {
return WSConstants.PW_TEXT;
}
}

protected abstract String getDefaultPassword();
Expand All @@ -85,6 +96,7 @@ public void main(String[] args) {
protected void init(String[] args) throws ParseException {
options.addOption("u", "user", true, "Username");
options.addOption("p", "password", true, "Password");
options.addOption("P", "password-type", true, "Password type (text or digest)");
options.addOption("e", "endpoint", true, "Endpoint URL");
options.addOption("v", "verbose", false, "Verbose mode");
options.addOption("m", "messages", false, "Log SOAP messages");
Expand Down

0 comments on commit e087a59

Please sign in to comment.