[jdom-interest] File lockup with invalid did -- handle in SAXBuilder??

Jason Long jason at supernovasoftware.com
Wed Mar 26 17:33:58 PST 2003

flush and close are methods of the Writer class not the file class.
Shouldn't this be handled in the SAXBuilder?

-----Original Message-----
From: Dave Bartmess [mailto:dingodave at edingo.net]
Sent: Thursday, March 27, 2003 11:35 AM
To: Jason Long
Subject: Re: [jdom-interest] File lockup with invalid did

The code added below should do the trick...

On Wed, 2003-03-26 at 17:02, Jason Long wrote:
> I am using the following to read files.
>   public Document getJDOMFromFile(File file)
>       throws JDOMException,
>       NullPointerException, IOException {
>     Document docJDOM = null;
>     try {
>       SAXBuilder builder = new SAXBuilder();
>       docJDOM = builder.build(file);
>     }
>     catch (JDOMException e) {
>       e.printStackTrace();
>       throw new JDOMException("Broken JDOM", e);
>     }
>     catch (NullPointerException e) {
>       e.printStackTrace();
>       throw new NullPointerException("Broken JDOM");
>     }
>     return docJDOM;
>   }
> The client needs to edit the dtd, and send it by ftp.
> The only thing defined in the dtd entities.
> When an entity is not defined an error is throw, but the file is then
> locked.
> How can I read in a file and release it if there are errors?
> Jason Long - CEO and Chief Software Engineer
> Supernova Software - supernovasoftware.com
> BS Physics, MS  Chemical Engineering
> _______________________________________________
> To control your jdom-interest membership:
David A. Bartmess
Sr. Software Configuration Manager
eDingo Enterprises
jSyncManager Development Team (http://www.jsyncmanager.org)
jSyncManager Email List

But one should not forget that money can buy a bed but not sleep,
finery but not beauty, a house but not a home,
medicine but not health, luxuries but not culture,
sex but not love, and amusements but not happiness.

More information about the jdom-interest mailing list