sdkman/sdkman-java-sdk

Add a download method

noamt opened this issue · 3 comments

In order for me to use the SDK client for the SGVM project, I also need net.gvmtool.client.GvmClient to provide a method that downloads a candidate distribution.

I was going to create a pull request for this, but I've noticed that the groovy-wslite client automatically loads the response data to memory; Grails distributions may reach ~100MB, so I'm not so sure it's a good idea.

Thoughts?

If you have a URL representing a binary download, why not just use the standard URL class? That's what Lazybones does.

Thanks, that's a good idea.
If I'm not mistaken, the GVM service redirects the request to the real download URL, so handling it might get a little ugly, but it's a start.

OK, redirection is actually handled well; I'll open a pull request.