| | |
| | | import org.opends.server.types.LDIFImportConfig; |
| | | import org.opends.server.types.LDIFImportResult; |
| | | import org.opends.server.types.SearchFilter; |
| | | import org.opends.server.util.CollectionUtils; |
| | | import org.opends.server.util.Args; |
| | | import org.opends.server.util.ServerConstants; |
| | | import org.testng.annotations.AfterClass; |
| | | import org.testng.annotations.BeforeClass; |
| | |
| | | |
| | | private static String[] args(boolean usePermissiveModifyControl) |
| | | { |
| | | final List<String> args = CollectionUtils.newArrayList( |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-D", "cn=Directory Manager", |
| | | "-w", "password" |
| | | ); |
| | | final Args args = new Args() |
| | | .add("-h", "127.0.0.1") |
| | | .add("-p", TestCaseUtils.getServerLdapPort()) |
| | | .add("-D", "cn=Directory Manager") |
| | | .add("-w", "password"); |
| | | if (usePermissiveModifyControl) |
| | | { |
| | | args.add("-J"); |
| | | args.add(ServerConstants.OID_PERMISSIVE_MODIFY_CONTROL); |
| | | args.add("-J", ServerConstants.OID_PERMISSIVE_MODIFY_CONTROL); |
| | | } |
| | | return args.toArray(new String[0]); |
| | | return args.toArray(); |
| | | } |
| | | |
| | | /** |
| | |
| | | package org.opends.server.core; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import com.forgerock.opendj.ldap.tools.LDAPCompare; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | |
| | | import org.opends.server.types.AuthenticationInfo; |
| | | import org.opends.server.types.Control; |
| | | import org.opends.server.types.LDAPException; |
| | | import org.opends.server.util.Args; |
| | | import org.testng.annotations.BeforeClass; |
| | | import org.testng.annotations.Test; |
| | | |
| | |
| | | @SuppressWarnings("javadoc") |
| | | public class RejectUnauthReqTests extends CoreTestCase |
| | | { |
| | | private class Args |
| | | { |
| | | private final List<String> args = new ArrayList<>(); |
| | | |
| | | public void add(String arg) |
| | | { |
| | | args.add(arg); |
| | | } |
| | | |
| | | public void add(String arg, Object value) |
| | | { |
| | | args.add(arg); |
| | | args.add(value.toString()); |
| | | } |
| | | |
| | | public String[] toArray() |
| | | { |
| | | return args.toArray(new String[args.size()]); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return args.toString(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Utility method which is called by the testcase sending an ADD request. |
| | | * |
| | |
| | | |
| | | private String[] args(boolean authenticate, String filePath) |
| | | { |
| | | Args args = new Args(); |
| | | args.add("--noPropertiesFile"); |
| | | args.add("-h", "127.0.0.1"); |
| | | args.add("-p", TestCaseUtils.getServerLdapPort()); |
| | | Args args = new Args() |
| | | .add("--noPropertiesFile") |
| | | .add("-h", "127.0.0.1") |
| | | .add("-p", TestCaseUtils.getServerLdapPort()); |
| | | if (authenticate) |
| | | { |
| | | args.add("-D", "cn=directory manager"); |
| | | args.add("-w", "password"); |
| | | args.add("-D", "cn=directory manager") |
| | | .add("-w", "password"); |
| | | } |
| | | args.add("-f", filePath); |
| | | return args.toArray(); |
| | |
| | | |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.forgerock.opendj.server.config.meta.DigestMD5SASLMechanismHandlerCfgDefn; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.core.BindOperation; |
| | | import org.opends.server.core.DeleteOperation; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import com.forgerock.opendj.ldap.tools.LDAPSearch; |
| | | import org.opends.server.types.AuthenticationInfo; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.util.Args; |
| | | import org.testng.annotations.AfterClass; |
| | | import org.testng.annotations.BeforeClass; |
| | | import org.testng.annotations.DataProvider; |
| | |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | /** |
| | | * A set of test cases for the DIGEST-MD5 SASL mechanism handler. |
| | | */ |
| | | /** A set of test cases for the DIGEST-MD5 SASL mechanism handler. */ |
| | | public class DigestMD5SASLMechanismHandlerTestCase |
| | | extends ExtensionsTestCase |
| | | { |
| | |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=u:test.user", |
| | | "-o", "authzid=u:test.user", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=u:test.user", "authzid=u:test.user", "password"); |
| | | assertEquals(LDAPSearch.run(nullPrintStream(), System.err, args), 0); |
| | | } |
| | | |
| | |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:uid=test.user,o=test", |
| | | "-o", "authzid=dn:uid=test.user,o=test", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:uid=test.user,o=test", "authzid=dn:uid=test.user,o=test", "password"); |
| | | assertEquals(LDAPSearch.run(nullPrintStream(), System.err, args), 0); |
| | | } |
| | | |
| | |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=u:test.user", |
| | | "-o", "authzid=u:test.user", |
| | | "-w", "wrongpassword", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=u:test.user", "authzid=u:test.user", "wrongpassword"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:uid=test.user,o=test", |
| | | "-o", "authzid=dn:uid=test.user,o=test", |
| | | "-w", "wrongpassword", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:uid=test.user,o=test", "authzid=dn:uid=test.user,o=test", "wrongpassword"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "cn: Test User", |
| | | "userPassword: password"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=u:test.user", |
| | | "-o", "authzid=u:test.user", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=u:test.user", "authzid=u:test.user", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "cn: Test User", |
| | | "userPassword: password"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:uid=test.user,o=test", |
| | | "-o", "authzid=dn:uid=test.user,o=test", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:uid=test.user,o=test", "authzid=dn:uid=test.user,o=test", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "cn: Test User", |
| | | "userPassword: password"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:invaliddn", |
| | | "-o", "authzid=dn:invaliddn", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:invaliddn", "authzid=dn:invaliddn", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "cn: Test User", |
| | | "userPassword: password"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=u:doesntexist", |
| | | "-o", "authzid=u:doesntexist", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=u:doesntexist", "authzid=u:doesntexist", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "cn: Test User", |
| | | "userPassword: password"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:uid=doesntexist,o=test", |
| | | "-o", "authzid=dn:uid=doesntexist,o=test", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:uid=doesntexist,o=test", "authzid=dn:uid=doesntexist,o=test", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=u:", |
| | | "-o", "authzid=u:", |
| | | "-w", "", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=u:", "authzid=u:", ""); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:", |
| | | "-o", "authzid=dn:", |
| | | "-w", "", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:", "authzid=dn:", ""); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=", |
| | | "-o", "authzid=", |
| | | "-w", "", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=", "authzid=", ""); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:uid=test.user,o=test", |
| | | "-o", "authzid=", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:uid=test.user,o=test", "authzid=", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | public void testLDAPBindFailIrreversiblePasswordWithRootDN() |
| | | throws Exception |
| | | { |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:cn=Directory Manager", |
| | | "-o", "authzid=dn:cn=Directory Manager", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:cn=Directory Manager", "authzid=dn:cn=Directory Manager", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:cn=Second Root DN", |
| | | "-o", "authzid=dn:cn=Second Root DN", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:cn=Second Root DN", "authzid=dn:cn=Second Root DN", "password"); |
| | | assertEquals(LDAPSearch.run(nullPrintStream(), System.err, args), 0); |
| | | |
| | | |
| | |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:uid=test.user,o=test", |
| | | "-o", "authzid=dn:uid=nonexistent,o=test", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:uid=test.user,o=test", "authzid=dn:uid=nonexistent,o=test", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:uid=test.user,o=test", |
| | | "-o", "authzid=u:nonexistent", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:uid=test.user,o=test", "authzid=u:nonexistent", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | String[] args = |
| | | { |
| | | "--noPropertiesFile", |
| | | "-h", "127.0.0.1", |
| | | "-p", String.valueOf(TestCaseUtils.getServerLdapPort()), |
| | | "-o", "mech=DIGEST-MD5", |
| | | "-o", "authid=dn:uid=test.user,o=test", |
| | | "-o", "authzid=dn:malformed", |
| | | "-w", "password", |
| | | "-b", "", |
| | | "-s", "base", |
| | | "(objectClass=*)" |
| | | }; |
| | | String[] args = args("authid=dn:uid=test.user,o=test", "authzid=dn:malformed", "password"); |
| | | assertFalse(LDAPSearch.run(nullPrintStream(), nullPrintStream(), args) == 0); |
| | | } |
| | | |
| | | |
| | | private String[] args(String authid, String authzid, String password) |
| | | { |
| | | return new Args() |
| | | .add("--noPropertiesFile") |
| | | .add("-h", "127.0.0.1") |
| | | .add("-p", TestCaseUtils.getServerLdapPort()) |
| | | .add("-o", "mech=DIGEST-MD5") |
| | | .add("-o", authid) |
| | | .add("-o", authzid) |
| | | .add("-w", password) |
| | | .add("-b", "") |
| | | .add("-s", "base") |
| | | .add("(objectClass=*)") |
| | | .toArray(); |
| | | } |
| | | |
| | | /** |
| | | * Verifies that the server will reject a DIGEST-MD5 bind in which the first |
| | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.File; |
| | | import java.io.PrintStream; |
| | | import java.util.Collections; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | |
| | | import org.assertj.core.api.Assertions; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.tools.upgrade.UpgradeCli; |
| | | import org.opends.server.util.Args; |
| | | import org.opends.server.util.StaticUtils; |
| | | import org.testng.annotations.Test; |
| | | |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static com.forgerock.opendj.cli.ArgumentConstants.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.testng.Assert.*; |
| | | |
| | | /** A set of test cases for the Upgrade tool. */ |
| | |
| | | */ |
| | | private String[] setArgs(String... args) |
| | | { |
| | | final List<String> argsList = new LinkedList<>(); |
| | | argsList.add("--configFile"); |
| | | argsList.add(configFilePath); |
| | | if (args != null) |
| | | { |
| | | Collections.addAll(argsList, args); |
| | | } |
| | | return argsList.toArray(new String[argsList.size()]); |
| | | return new Args() |
| | | .add("--configFile", configFilePath) |
| | | .addAll(args) |
| | | .toArray(); |
| | | } |
| | | |
| | | /** |
| New file |
| | |
| | | /* |
| | | * The contents of this file are subject to the terms of the Common Development and |
| | | * Distribution License (the License). You may not use this file except in compliance with the |
| | | * License. |
| | | * |
| | | * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the |
| | | * specific language governing permission and limitations under the License. |
| | | * |
| | | * When distributing Covered Software, include this CDDL Header Notice in each file and include |
| | | * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL |
| | | * Header, with the fields enclosed by brackets [] replaced by your own identifying |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.util; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** Helper class to represent arguments for command-line programs. */ |
| | | public class Args |
| | | { |
| | | private final List<String> args = new ArrayList<>(); |
| | | |
| | | public Args add(String arg) |
| | | { |
| | | args.add(arg); |
| | | return this; |
| | | } |
| | | |
| | | public Args add(String arg, Object value) |
| | | { |
| | | args.add(arg); |
| | | args.add(value.toString()); |
| | | return this; |
| | | } |
| | | |
| | | public Args addAll(String... additionalArgs) |
| | | { |
| | | if (additionalArgs != null) |
| | | { |
| | | Collections.addAll(args, additionalArgs); |
| | | } |
| | | return this; |
| | | } |
| | | |
| | | public String[] toArray() |
| | | { |
| | | return args.toArray(new String[0]); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return args.toString(); |
| | | } |
| | | } |