protected GroovyCodeSource getScriptSource(boolean isScriptFile, String script) throws IOException, URISyntaxException {
        //check the script is currently valid before starting a server against the script
        if (isScriptFile) {
            if (uriPattern.matcher(script).matches()) {
                return new GroovyCodeSource(new URI(script));
            } else {
                return new GroovyCodeSource(huntForTheScriptFile(script));
            }
        } else {
            return new GroovyCodeSource(script, "script_from_command_line", GroovyShell.DEFAULT_CODE_BASE);
        }
    }
protected GroovyCodeSource getScriptSource ( boolean isScriptFile , String script ) throws IOException , URISyntaxException { if ( isScriptFile ) { if ( uriPattern . matcher ( script ) . matches ( ) ) { return new GroovyCodeSource ( new URI ( script ) ) ; } else { return new GroovyCodeSource ( huntForTheScriptFile ( script ) ) ; } } else { return new GroovyCodeSource ( script , "script_from_command_line" , GroovyShell . DEFAULT_CODE_BASE ) ; } }
Get a new GroovyCodeSource for a script which may be given as a location
(isScript is true) or as text (isScript is false).

@param isScriptFile indicates whether the script parameter is a location or content
@param script the location or context of the script
@return a new GroovyCodeSource for the given script
@throws IOException
@throws URISyntaxException
@since 2.3.0