After thinking about this further, I think I should probably clarify
something here, as this thread has discussed both the forms of the parse
method, one which takes in a uri and one which takes in an InputSource.

My original problem occurred when sending in a uri.  An exception was thrown
in the parse method, and my file was not closed, unless I am missing
something somewhere.  I checked the source code, and it appears that this is
the case.  This means that I am left with a file that I cannot close after
the parse method exits via an Exception.  This is bad, because the file is
still held by the parser.

Over the course of this thread, I changed my code to use an InputSource, and
now I have this control over the file.  However, the original problem I
experienced I believe is something that needs to be fixed, unless I am
mistaken about this behavior.

BradO

-----Original Message-----
From: Andy Clark [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 07, 2001 2:22 PM
To: [EMAIL PROTECTED]
Subject: Re: Explicit file closing


Brad O'Hearne wrote:
> Is this the proper behavior?  The second situation is the one that I am
in.
> If this is the accepted behavior, then I will just close the InputSource
> myself.

If you provide the stream, you should close it. We've had people
in the past that needed the stream to remain open so we don't
touch it if you opened it.

--
Andy Clark * IBM, TRL - Japan * [EMAIL PROTECTED]

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

Reply via email to