Hi Monica!
> I need to extract the files contained in a zip after a web upload.
If you have a InputStream only you can feed this stream to the tmp:
filesystem with something like this:

        FileObject foZip =
VFS.getManager().resolveFile("tmp:/xml-rpc.net.0.9.2.zip");
        OutputStream os = foZip.getContent().getOutputStream();
        byte[] buf = new byte[4096];
        int read;
        while ((read = is.read(buf)) > -1)
        {
            os.write(buf, 0, read);
        }
        os.close();
        FileObject foZipContent =
VFS.getManager().resolveFile("zip:tmp:/xml-rpc.net.0.9.2.zip!/");
        System.err.println(foZipContent.getChildren().length);

But for sure, this requires at least a writable temporary filespace (by
default the os tmpdir as you can find in java system environment
"java.io.tmpdir").
If it is really absolutely not possible to write to the local disk you
can replace the "tmp:/" in the above example (two times) with "ram:/",
though, that requires you to have enough memory available to hold the
zipped data.

Ciao,
Mario


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

Reply via email to