openshift/openshift-java-client — pull request #68 by iocanel (2013-08-14 13:06:05+00:00)
Title: Add support for downloadable cartridges.

I am working on https://github.com/jboss-fuse/fuse/issues/52 and I it seems that the client is missing support for downloadable cartridges.

Given that there is no information in the rest api about this feature, I tried to mimic the behavior of rhc which already supports that.

So this pull request does the following:

When the cartridge name is a URL, it posts a json like this:

{
"name": "myapp",
"cartridges": [{
"url": "https://raw.github.com/myrepo/mycart/master/metadata/manifest.yml"
}]
}

In detail this commit adds:

i) An implementation of IMediaType for Json
ii) Adds the ability to override the existing media type on the IHttpClient and IRestService
iii) DomainResource checks when creating an app if cart is downloadable and uses JsonMediaType instead (plus the appropriate ServiceParameters).
iv) Aligns tests and adds a test case for downloadable carts.