/** * Returns all arguments defined by <code>addLine</code>, * <code>addValue</code> or the argument object. * @return an array of arguments. */ public String[] getArguments() { return getArguments( false ); }
/** * Returns the executable and all defined arguments. * @return an array of all arguments incl. executable. */ public String[] getCommandline() { final String[] args = getArguments(); String executable = getExecutable(); if ( executable == null ) { return args; } final String[] result = new String[args.length + 1]; result[0] = executable; System.arraycopy( args, 0, result, 1, args.length ); return result; }
/** * @param mask flag to mask any arguments (having his {@code mask} field to {@code true}). * @return the shell, executable and all defined arguments with masking some arguments if * {@code mask} parameter is on */ private String[] getShellCommandline( boolean mask ) { List<String> shellCommandLine = getShell().getShellCommandLine( getArguments( mask ) ); return shellCommandLine.toArray( new String[shellCommandLine.size()] ); }