Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.0-JSR-4
-
None
-
None
-
Mac OSX 1.4 / JDK 1.5
Description
If you add two root URLs to a GroovyScriptEngine, say:
file://home/marc/scripts
file://home/marc/anotherdir/morescripts
...if you have a file located at
file://home/marc/scripts/test.groovy
If you try to call gse.run("test.groovy") it will fail saying it cannot find:
file://home/marc/anotherdir/morescripts/test.groovy
This is because the code only calls openConnection which succeeds for file URLs. Also it does not break out on the first successful openConnection, so always uses the last and all the previous checks are pointless.
Suggestion is to fix this to find the FIRST that does not throw an exception from urlconn.getInputStream().
Code will be attached as comment shortly.