Convert to Modular JAR was: Publish and fetch a modular jar to a repository
Paul Sandoz
paul.sandoz at oracle.com
Tue Jul 17 02:16:06 PDT 2012
Hi,
On Jul 17, 2012, at 10:17 AM, Jaroslav Tulach wrote:
> Dne Po 16. července 2012 18:42:16, Alan Bateman napsal(a):
>> On 16/07/2012 17:21, Paul Sandoz wrote:
>>> OK, converted to upper case. I have no strong preference on the style,
> just wanna be consistent, like with code formatting (but wanna automate that
> bit):
>>> http://cr.openjdk.java.net/~psandoz/jigsaw/repo-add-jar/webrev.3/
>>
>> Thanks looks fine to me.
>
> Hello Paul,
> my comment may not be related to this particular webrev, but I think it is
> good time to remind that we plan to base the NetBeans IDE support for Jigsaw
> on modular JAR files and we need a way to convert any module to modular JAR
> format.
>
> There is method
>
> public abstract InputStream fetch(ModuleId mid);
>
> in the Repository class. Should not it be
>
> public abstract InputStream fetch(ModuleId mid, ModuleType format);
>
> so we can request any module in modular JAR format?
I did think about transformation but I opted for an initial solution of what you publish is what you get. So it would currently be up to the client to do such a transformation, using a Jigsaw API, TBD as i don't think it exists, but we can easily add an option to jmod and the API, at least that will move in the right direction.
If transformation is performed by the repository then we need to think carefully about what to do if the original published content is signed.
Maybe extraction of class files/resources is the right way to think about this? since there could be information loss when transforming from jmod to jar.
--
A repository could offer an extraction service using the Jigsaw API, that works appropriately with HTTP caching and local file caching e.g. if the URL to a module is:
GET /repository/{mid}/module
The URL to the class data could be:
GET /repository/{mid}/module/classes
and there could be a method:
InputStream fetchClasses(ModuleId mid, String mediaType);
In general the mid location will be a container for multiple content (src docs etc) so we need to work out how to identify that content, perhaps using link relations (as tags) + media types for content negotiation.
Paul.
More information about the jigsaw-dev
mailing list