Parsing Chef cookbook using jclouds failed -
i need process cookbook metadata. i'm using jclouds this, apache2 cookbook fails error message "expected begin_array begin_object @ line ...". i've tried versions 1.8.4 , 1.9.6 uploaded http://community.opscode.com/cookbooks/apache2.
the code looks this:
zipinputstream zis = new zipinputstream(content); zipentry entry = zis.getnextentry(); while (entry != null) { if (entry.getname().endswith("/metadata.json")) { type type = new typetoken<metadata>() {}.gettype(); gson gson = new gson(); metadata metadata = gson.fromjson(new inputstreamreader(zis, charsets.utf_8), type); ... } } i've debug problem , looks gson failed on "default" attribute (attribute class) expected jsonball (the defaultvalue class field), in metadata.json plain string.
please, cloud point me solution or simple example how right? or let me know if issue?
thanks lot
it's been while now, i've seen question. issue reported in jclouds issue tracher , should fixed:
https://issues.apache.org/jira/browse/jclouds-377
could try using last 1.7.1 or 1.7.2 jclouds release?
Comments
Post a Comment