> -----Original Message-----
> From: Mario Ivankovits [mailto:[EMAIL PROTECTED]
> 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.putNextEntry(zipEntry);
zos.write("Some content".getBytes());
zos.closeEntry();
zos.close();

Thanks again for all your help
-Vincent


        

        
                
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son 
interface révolutionnaire.
http://fr.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to