commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <>
Subject RE: [VFS] Creating a JAR file using VFS?
Date Mon, 17 Jul 2006 12:14:44 GMT

> -----Original Message-----
> From: Mario Ivankovits []
> Sent: lundi 17 juillet 2006 09:30
> To: Jakarta Commons Users List
> Subject: Re: [VFS] Creating a JAR file using VFS?
> Hi Vincent!
> > Actually what is was looking for was the ability to easily create JAR
> files
> > in memory (zip:ram) for Cargo's unit tests. I think it would be quite
> neat
> > to be able to do so rather than have to go through the local file
> system.
> >
> > Would you know of a framework that could help do this?
> >
> No. VFS will support it sometimes .... if it wouldnt be that much work :-(
> What you can try is to use ZipOutputStream and feed it to a VFS ram url.
> Not nice, but might work and you can use VFS ram filesystem.

Thanks Mario. The following is working quite fine. I'm putting it here for
posterity in case anyone is interested in doing the same:

FileObject testJar = VFS.getManager().resolveFile("ram:///test.jar");
ZipOutputStream zos = 
    new ZipOutputStream(testJar.getContent().getOutputStream());
ZipEntry zipEntry = new ZipEntry("rootResource.txt");
zos.write("Some content".getBytes());

Thanks again for all your help


Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message