/** * @param line The arguments. */ public void addArguments( String... line ) { for ( String aLine : line ) { createArg().setValue( aLine ); } }
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; }
/** * 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 ); }
public JVMStarter withArgLines(List<String> argLines) { for (String argLine : argLines) { commandline.createArg(true).setValue(argLine); } return this; }
public JVMStarter withArgLines(Map<String, File> argLines) { for (Map.Entry<String, File> argLine : argLines.entrySet()) { commandline.createArg().setValue(argLine.getKey()); commandline.createArg().setFile(argLine.getValue()); } return this; }
public JVMStarter withJar(File jarFile) { commandline.createArg().setValue("-jar"); commandline.createArg().setFile(jarFile); 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] ); } } }