Here you can find the source of listToCommandLine(List
private static String listToCommandLine(List<String> commands)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { private static String listToCommandLine(List<String> commands) { String arguments = ""; for (String command : commands) { arguments += command;/*from w w w. j ava 2 s . c o m*/ arguments += " "; } if (arguments.length() > 0) arguments = arguments.substring(0, arguments.length() - 1); return arguments; } }