Here you can find the source of getCommandArgs(String command)
public static ArrayList<String> getCommandArgs(String command)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Scanner; public class Main { public static ArrayList<String> getCommandArgs(String command) { ArrayList<String> list = new ArrayList<String>(); Scanner scanner = new Scanner(command); scanner.useDelimiter(" "); while (scanner.hasNext()) { list.add(scanner.next());/* w w w . j ava 2s . com*/ } return list; } }