Putting aside the fact that the with* methods don't return the closure return value (which I'm going to create a separate JIRA for), there is not currently a withInputStream method for URL.
I could do something like this to work around it, but I'd rather do it the Groovier way:
I've attached a patch to add URL.newInputStream and URL.withInputStream. It doesn't have any tests because I couldn't find any existing tests for URL.withReader (or File.withInputStream for that matter) and wasn't sure what the best way to handle it would be.
Description
I recently came across a situation where I wanted to initialize a JCE Certificate directly from a URL. I wanted to do this:
Putting aside the fact that the with* methods don't return the closure return value (which I'm going to create a separate JIRA for), there is not currently a withInputStream method for URL.
I could do something like this to work around it, but I'd rather do it the Groovier way:
I've attached a patch to add URL.newInputStream and URL.withInputStream. It doesn't have any tests because I couldn't find any existing tests for URL.withReader (or File.withInputStream for that matter) and wasn't sure what the best way to handle it would be.