Have actually tried looking at the source code e.g .C:\j2sdk1.4.1_01\src.zip supplied with the jdk. Unless the error is coming from a native method in the zip dll there is no way the comment is sent to stderr.
Regards Andrew -----Original Message----- From: Stefan Carlsson [mailto:[EMAIL PROTECTED]] Sent: 07 February 2003 08:26 To: JDJList Subject: [jdjlist] SV: Re: Unexpected std err output from ZipEntry comment s I tried your code and got no output at all... I'm running jdk 1.4.1_01. What jdk are you using ? Regards, stefan -----Ursprungligt meddelande----- Fr�n: Alastair Rodgers [mailto:[EMAIL PROTECTED]] Skickat: den 6 februari 2003 19:28 Till: JDJList �mne: [jdjlist] Re: Unexpected std err output from ZipEntry comments Hi Jason, > -----Original Message----- > From: Jason Bell (Pharmalicensing) [mailto:[EMAIL PROTECTED]] > > Sorry about that. You are right, please accept my apologies. No problem. Easily done. > Do you want to paste your full code, I want to give it a try > and see what happens. You can see the problem with the following simple app: /** * Usage: "java ZipWithComments <zipfile>". */ public class ZipWithComments { public static void main(String[] args) { try { new java.util.zip.ZipFile(new java.io.File(args[0])); } catch (java.io.IOException e) { e.printStackTrace(); } } } Also I've attached a small zip file which you can use to try it out. This contains a single item with a comment attached. NB: When I tried previously, I was either running from an IDE or from my app server. I just tried running the above app from the command line, and on Linux I get the odd output, but on Windows I don't see anything - I guess this is just because Windows isn't directing stderr to the console; I do get the output when I run it from my IDE on Windows. Regards, Al. > > ----- Original Message ----- > From: "Alastair Rodgers" <[EMAIL PROTECTED]> > To: "JDJList" <[EMAIL PROTECTED]> > Sent: Thursday, February 06, 2003 3:43 PM > Subject: [jdjlist] Re: Unexpected std err output from > ZipEntry comments > > > > > > Someone is obviously not reading the API docs right are they? > > > > Hmm, someone is obviously not reading my original post correctly!! :-( > > I know how to use getComment(), the problem is that even when > I don't use this method at all the comments are getting > dumped to stderr! Perhaps I should clarify: > > Even if my code is simply: > > File file = "SomeFile.zip"; > ZipFile zip = new ZipFile(file); > > ...I still get the following output on stderr: > > Allocating ZIP comments array > Added ZIP comment "Test comment 1" > Added ZIP comment "Test comment 2" > Added ZIP comment "Test comment 3" > > This is bizarre behaviour and is not down to incorrect use of > the API! It almost looks as if some debug code was left in > the JVM implementation (!). > > Since zip file entries rarely have comments attached, you > might never see this behaviour, however, the zip files I am > concerned with can use comments for metadata... > > > > > -----Original Message----- > > From: Jason Bell (Pharmalicensing) > [mailto:[EMAIL PROTECTED]] > > Sent: 06 February 2003 15:33 > > To: JDJList > > Subject: [jdjlist] Re: Unexpected std err output from ZipEntry > > comments > > > > > > > > Someone is obviously not reading the API docs right are they? > > > > http://java.sun.com/j2se/1.4/docs/api/java/util/zip/ZipEntry.html > > or http://java.sun.com/j2se/1.3/docs/api/java/util/zip/ZipEntry.html > > > > Look at the method getComment() > > > > Jase Bell > > --- > > Jason Bell - J2SE Editor > > Java Developers Journal > > e: [EMAIL PROTECTED] > > > > > > | -------Original Message------- > > | From: Alastair Rodgers <[EMAIL PROTECTED]> > > | Sent: 02/05/03 12:26 PM > > | To: JDJList <[EMAIL PROTECTED]> > > | Subject: [jdjlist] Unexpected std err output from > ZipEntry comments > > | > > | > > > | > I'm using java.util.zip.ZipFile to check the contents of > > a zip file. > > | > The > > | zip file in question has comments attached to each zip entry. The > > | problem is that as soon as I create the ZipFile object (new > > | ZipFile(file)), the following message is printed to the > > standard error > > | stream: > > | > > | > > | Allocating ZIP comments array > > | Added ZIP comment "Test comment 1" > > | Added ZIP comment "Test comment 2" > > | Added ZIP comment "Test comment 3" > > | > > | > > | (zip file contains 3 files, each with a distinct comment). > > | > > | Although this doesn't affect functionality, I'm using this > > in a server > > | app where remote clients can upload zip files, and I don't > > really want > > | lots of spurious comments in the logs. > > | > > | I can't find anywhere in the JRE source code where it > > prints out these > > | messages, & Google failed to turn anything up. Has anyone > else come > > | across this and can anyone explain why I'm seeing these > > messages and > > | where they're coming from? > > | > > | I've tried this using a Sun 1.3.1 JVM on Win2000 & RedHat > > and get the > > | same results on both. > > | > > | Thanks, > > | Al. ____________________________________________________ To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm Be respectful! Clean up your posts before replying ____________________________________________________ ____________________________________________________ To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm Be respectful! Clean up your posts before replying ____________________________________________________
