Debug.put("imageserver");
    public static void main(String[] args) {	Debug.init();	try {	    ArgParser ap = new ArgParser("SimpleHttpImageServer");	    ap.add("properties", "A URL to use to set the properties for the ImageServer.", 1);	    ap.add("port", "The port to listen for new map image requests on. (Default 0)", 1);	    ap.add("verbose", "Print action messages.");	    ap.add("test", "Create a test default image.");	    if (!ap.parse(args)) {		ap.printUsage();		System.exit(0);	    }	    String proparg[];	    PropertyHandler propHandler;	    proparg = ap.getArgValues("properties");	    if (proparg != null) {		propHandler = new PropertyHandler(proparg[0]);	    } else {		propHandler = new PropertyHandler();	    }	    String[] varg = ap.getArgValues("verbose");	    if (varg != null) {		Debug.put("shis");	    }	    SimpleHttpImageServer shis;	    String[] portarg = ap.getArgValues("port");	    if (portarg != null) {		int port = Integer.parseInt(portarg[0]);		shis = new SimpleHttpImageServer(port, false, 						 propHandler.getProperties());	    } else {		shis = new SimpleHttpImageServer(propHandler.getProperties());	    }	    Debug.output("OpenMap SimpleHttpImageServer: listening on port: " +			 shis.httpd.getPort() + 			 (proparg == null?"":" with properties in " + proparg[0]));	    String[] testarg = ap.getArgValues("test");	    if (testarg != null) {		OutputStream out = new FileOutputStream("test.jpg");		shis.httpRequest(new HttpRequestEvent(shis, "/openmap?REQUEST=map", out)); 	    }	} catch (MalformedURLException murle) {	    System.err.println("Bad URL path to properties file.");	    murle.printStackTrace();	} catch (IOException ioe) {	    System.err.println("Unable to start http server:");	    ioe.printStackTrace();	}    }