You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Andrea Turli <no...@github.com> on 2016/05/19 09:31:32 UTC
[jclouds/jclouds] update CloudstackTemplateOptions pattern (#957)
You can view, comment on, or merge this pull request online at:
https://github.com/jclouds/jclouds/pull/957
-- Commit Summary --
* update CloudstackTemplateOptions pattern
-- File Changes --
M apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/options/CloudStackTemplateOptions.java (523)
M apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/CloudStackComputeServiceAdapter.java (3)
M apis/cloudstack/src/test/java/org/jclouds/cloudstack/compute/options/CloudStackTemplateOptionsTest.java (60)
M apis/cloudstack/src/test/java/org/jclouds/cloudstack/compute/strategy/OptionsConverterTest.java (26)
-- Patch Links --
https://github.com/jclouds/jclouds/pull/957.patch
https://github.com/jclouds/jclouds/pull/957.diff
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/957
Re: [jclouds/jclouds] update CloudstackTemplateOptions pattern (#957)
Posted by Andrea Turli <no...@github.com>.
Closed #957.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/957#event-742493469
Re: [jclouds/jclouds] update CloudstackTemplateOptions pattern (#957)
Posted by Ignasi Barrera <no...@github.com>.
> }
>
> - public CloudStackTemplateOptions setupStaticNat(boolean setupStaticNat) {
> - this.setupStaticNat = setupStaticNat;
> + public CloudStackTemplateOptions userData(URL userDataUrl) throws IOException {
> + this.userData = Resources.toString(checkNotNull(userDataUrl, "userDataUrl"), Charsets.UTF_8).getBytes(Charsets.UTF_8);
Why providing this method that accepts a URL? I don't see it necessary and only introduces issues: can we guarantee the classloader being used to load the resource the right one to load the file? And if jclouds code is deployed in a webapp? Where do we expect to load files from?
IMO there is no need to provide this "sugar" method. Let users read files/resources themselves and just pass the array of bytes.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/957/files/e808dc64d204b994b579a7a1d626da728656cc2f#r63859521