/** * Creates an argument object. * <p/> * <p>Each commandline object has at most one instance of the * argument class. This method calls * <code>this.createArgument(false)</code>.</p> * * @return the argument object. */ public Arg createArg() { return this.createArg( false ); }
public JVMStarter withSystemProperties(Map<String, String> systemProperties) { for (Map.Entry<String, String> prop : systemProperties.entrySet()) { commandline.createArg(true).setValue("-D" + prop.getKey() + "=" + prop.getValue()); } return this; }
/** * @param line The arguments. */ public void addArguments( String... line ) { for ( String aLine : line ) { createArg().setValue( aLine ); } }
/** * Convinience method to add an argument to the {@code command line}. * * @param cli command line to fill * @param value the argument value to be added */ protected final void addArg( Commandline cli, String value ) { cli.createArg().setValue( value ); }
/** * Convinience method to add a file argument to the {@code command line}. * * @param cli command line to fill * @param value the file argument value to be added */ protected final void addArg( Commandline cli, File value ) { cli.createArg().setFile( value ); }
public JVMStarter withArgLines(List<String> argLines) { for (String argLine : argLines) { commandline.createArg(true).setValue(argLine); } return this; }
/** * Create a new command line object. * Shell is autodetected from operating system * * @param toProcess The command to process */ public Commandline( String toProcess ) { setDefaultShell(); String[] tmp = new String[0]; try { tmp = CommandLineUtils.translateCommandline( toProcess ); } catch ( Exception e ) { System.err.println( "Error translating Commandline." ); } if ( ( tmp != null ) && ( tmp.length > 0 ) ) { setExecutable( tmp[0] ); for ( int i = 1; i < tmp.length; i++ ) { createArg().setValue( tmp[i] ); } } }