protected static SimplePostTool parseArgsAndInit(String[] args){
  String urlStr=null;
  try {
    final String mode=System.getProperty("data",DEFAULT_DATA_MODE);
    if (!DATA_MODES.contains(mode)) {
      fatal("System Property 'data' is not valid for this tool: " + mode);
    }
    String params=System.getProperty("params","");
    urlStr=System.getProperty("url",DEFAULT_POST_URL);
    urlStr=SimplePostTool.appendParam(urlStr,params);
    URL url=new URL(urlStr);
    boolean auto=isOn(System.getProperty("auto",DEFAULT_AUTO));
    String type=System.getProperty("type");
    int recursive=0;
    String r=System.getProperty("recursive",DEFAULT_RECURSIVE);
    try {
      recursive=Integer.parseInt(r);
    }
 catch (    Exception e) {
      if (isOn(r))       recursive=DATA_MODE_WEB.equals(mode) ? 1 : 999;
    }
    int delay=DATA_MODE_WEB.equals(mode) ? DEFAULT_WEB_DELAY : 0;
    try {
      delay=Integer.parseInt(System.getProperty("delay","" + delay));
    }
 catch (    Exception e) {
    }
    OutputStream out=isOn(System.getProperty("out",DEFAULT_OUT)) ? System.out : null;
    String fileTypes=System.getProperty("filetypes",DEFAULT_FILE_TYPES);
    boolean commit=isOn(System.getProperty("commit",DEFAULT_COMMIT));
    boolean optimize=isOn(System.getProperty("optimize",DEFAULT_OPTIMIZE));
    return new SimplePostTool(mode,url,auto,type,recursive,delay,fileTypes,out,commit,optimize,args);
  }
 catch (  MalformedURLException e) {
    fatal("System Property 'url' is not a valid URL: " + urlStr);
    return null;
  }
}

protected static SimplePostTool parseArgsAndInit ( String [ ] args ) { String urlStr = null ; try { final String mode = System . getProperty ( "data" , DEFAULT_DATA_MODE ) ; if ( ! DATA_MODES . contains ( mode ) ) { fatal ( "System Property 'data' is not valid for this tool: " + mode ) ; } String params = System . getProperty ( "params" , "" ) ; urlStr = System . getProperty ( "url" , DEFAULT_POST_URL ) ; urlStr = SimplePostTool . appendParam ( urlStr , params ) ; URL url = new URL ( urlStr ) ; boolean auto = isOn ( System . getProperty ( "auto" , DEFAULT_AUTO ) ) ; String type = System . getProperty ( "type" ) ; int recursive = 0 ; String r = System . getProperty ( "recursive" , DEFAULT_RECURSIVE ) ; try { recursive = Integer . parseInt ( r ) ; } catch ( Exception e ) { if ( isOn ( r ) ) recursive = DATA_MODE_WEB . equals ( mode ) ? 1 : 999 ; } int delay = DATA_MODE_WEB . equals ( mode ) ? DEFAULT_WEB_DELAY : 0 ; try { delay = Integer . parseInt ( System . getProperty ( "delay" , "" + delay ) ) ; } catch ( Exception e ) { } OutputStream out = isOn ( System . getProperty ( "out" , DEFAULT_OUT ) ) ? System . out : null ; String fileTypes = System . getProperty ( "filetypes" , DEFAULT_FILE_TYPES ) ; boolean commit = isOn ( System . getProperty ( "commit" , DEFAULT_COMMIT ) ) ; boolean optimize = isOn ( System . getProperty ( "optimize" , DEFAULT_OPTIMIZE ) ) ; return new SimplePostTool ( mode , url , auto , type , recursive , delay , fileTypes , out , commit , optimize , args ) ; } catch ( MalformedURLException e ) { fatal ( "System Property 'url' is not a valid URL: " + urlStr ) ; return null ; } }
parses incoming arguments and system params and initializes the tool
