Thursday, 15 April 2010

java - Publishing ZIPs to Artifactory from Jersey/JAX-RS Client -


I have a set of necessities / JAX-RS clients, which can be used to publish zip files on prosthetic limbs. staying. Specifically, I have to publish a zip:

It shows that the artificial limb reveals:

  PUT / libs -release-local / my / jar / 1.0 / jar-1.0.jar {"uri": "http: // localhost: 8080 / artifactory / libs-release-local / my / jar / 1.0 / jar- 1.0.jar "," DownloadYourery ":" http: // localhost: 8080 / creative / libs-release-local / my / jar / 1.0 / jar-1.0.jar "," repo ":" Libs-release-local " , "Path": "/my/jar/1.0/jar-1.0.jar", "created": ISO8601 (yyyy-MM-dd'H'H: mm: ss.SSSZ), "created": "userY "," Size "(" Md5 ": string," sha1 ": string}," originalchecksums ": {" md5 ": string," 1024 ", // by "MimeType": "app / java-archive", "checksum" Sha1 ": string}}  

So it seems that the Somelib-1.0.0.zip . My proposal to do this is as follows:

  // Groovy pseudo code for put unit: class publication {@JsonProperty string Yuri @JesenProperty String Download Yuri @Jesonproperty String Repo @JesenProperty String Path @ JsonProperty Date Created The @JesPrintPro String was created @Jesonproperty Integer Size @JesonProperty String MimeType @JesanProperty Map & lt; String, string & gt; Checksum @Jesanproporty map & lt; String, string & gt; However, 2 problems:  

security

A security barrier at the endpoint of a user with 'deployment' permissions Required. I have such users, although I am not sure how to implement this auth on client-side. Artifactory uses the original proof for your ending points? If so, then this work would be something like this (?):

  client client = client.require (); WebResource resources = client.resource (BASE_URI); Client.addFilter (new HTTPBasicAuthFilter ("Deployment", "12345"); // Dummy credentials, clearly  

put unit

most important , I do not understand that PUT unit should be jersey / jx-rs-style using POJOs, I can do something like this:

  // Then, Groovy pseudo code publication = get () // Ideally the zip is read in portable format, the path is webResource.path ("libs-release-local"). Path ("ourorg"). Path ("somelib"). Path ("1.0.0"). Path ("somelib-1.0.0.zip"). Type (mediatype ???) Unit (publication) .put (???)  

However, I still do not know how to send the actual ZIP file. There is a path field, which specifies the local (client-side) path to binary, but this is only a string / reference, not to publish the actual binary!

Also, according to Wikipedia, Zip Media Type is app \ zip , but there is no such definition in JX-RS.

Any ideas here?

Basic is the good unit again, you do not need any docs in the JSON you see That is the result of the PUT call.


No comments:

Post a Comment