public static void main(String args[]) { HTTPDataSource ds = new HTTPDataSource(); try { if (args.length != 1 && args.length != 2) { throw new Exception( /* (non-Javadoc) * @i18n.test * @org-mes="Need an url" */ org.openlaszlo.i18n.LaszloMessages.getMessage( HTTPDataSource.class.getName(), "051018-828")); } String surl = args[0]; FileOutputStream out = null; if (args.length == 2) { out = new FileOutputStream(args[1]); } System.out.println("url is " + surl); HttpData data = ds.getDataOnce(null, null, -1, surl, 0, 0); System.out.println("Response code: " + data.code); if (out != null) { FileUtils.send(data.getInputStream(), out); } data.release(); } catch (Exception e) { e.printStackTrace(); } }