question: 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 ; }
target:  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