Re: invalid archives with java.util.zip



On Jun 30, 5:32 pm, j...@xxxxxxxxx wrote:
...
I have a problem with ZIP files in JDK 1.5.
I'm using the following code to create a ZIP file from an XML
document:

It is difficult to tell much from code snippets,
but you might try..

Document doc;
// create document and set root element
ZipOutputStream out = new ZipOutputStream(new
FileOutputStream(filenameZIP));
out.putNextEntry(new ZipEntry(filenameXML));

<http://java.sun.com/javase/6/docs/api/java/util/zip/
ZipOutputStream.html#closeEntry()>

// fill document and write it to output stream
out.close();

..closely followed by some if the other methods
meant to finish up ZIPs, that are mentioned in
them there JavaDocs.

--
Andrew Thompson
http://pscode.org/
.



Relevant Pages