In current groovy versions, the method DefaultGroovyMethods.toURL(String) is marked as deprecated, but without any explanation.
Why is it deprecated and what should we use instead? I wanted to use it to easily get a file from HTTP like this:
def xml = "http://url.to/file.xml".toURL().text
toURL() invoked on String comes from this class, not from DefaultGroovyMethods, so everything works fine and correct method is invoked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With