private static void parseCommandLineArguments(final String[] args) throws IllegalArgumentException {
        if (args.length == 0) {
            // Give a little help
            System.out.println("Possible command-line arguments: -host [address] -port [port] -baseurl [baseurl]");
            // System.out.println("Default command-line arguments: -host " + SERVER_ADDRESS + " -port " + Integer.toString(SERVER_PORT) + " -baseurl " + SERVER_BASE_URL);
            return;
        }
        // Walk through arguments, set up server address and port:
        final Iterator<String> argsIter = Arrays.asList(args).iterator();
        while(argsIter.hasNext()) {
            String val = argsIter.next();
            if ("-host".equals(val)) {
                // Then the following should be the address (-host localhost)
                SERVER_ADDRESS = argsIter.next();
                System.out.println("Set host to: " + SERVER_ADDRESS);
            } else if ("-port".equals(val)) {
                // Then the following should be the port (-port 8080)
                final String portNum = argsIter.next();
                try {
                    SERVER_PORT = Integer.parseInt(portNum);
                    System.out.println("Set port to: "+ Integer.toString(SERVER_PORT));
                }
                catch (NumberFormatException nfe) {
                    throw new IllegalArgumentException(nfe);
                }
            } else if ("-baseurl".equals(val)) {
                SERVER_BASE_URL = argsIter.next();
                System.out.println("Set baseurl to: " + SERVER_BASE_URL);
            } else {
                // It's a value
                if (values.length() > 0) {
                    values.append(" ");
                }
                values.append(val);
            }
        }
    }