public static File searchForGroovyScriptFile(String input){
  String scriptFileName=input.trim();
  File scriptFile=new File(scriptFileName);
  String[] standardExtensions={".groovy",".gvy",".gy",".gsh"};
  int i=0;
  while (i < standardExtensions.length && !scriptFile.exists()) {
    scriptFile=new File(scriptFileName + standardExtensions[i]);
    i++;
  }
  if (!scriptFile.exists()) {
    scriptFile=new File(scriptFileName);
  }
  return scriptFile;
}

public static File searchForGroovyScriptFile ( String input ) { String scriptFileName = input . trim ( ) ; File scriptFile = new File ( scriptFileName ) ; String [ ] standardExtensions = { ".groovy" , ".gvy" , ".gy" , ".gsh" } ; int i = 0 ; while ( i < standardExtensions . length && ! scriptFile . exists ( ) ) { scriptFile = new File ( scriptFileName + standardExtensions [ i ] ) ; i ++ ; } if ( ! scriptFile . exists ( ) ) { scriptFile = new File ( scriptFileName ) ; } return scriptFile ; }
search for the script file , doesn ' t bother if it is named precisely . tries in this order : - actual supplied name - name . groovy - name . gvy - name . gy - name . gsh
