[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();
file.flush();
file.close();
> throw new JDOMException("Broken JDOM", e);
> }
> catch (NullPointerException e) {
> e.printStackTrace();
file.flush();
file.close();
> 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:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
--
David A. Bartmess
Sr. Software Configuration Manager
eDingo Enterprises
http://edingo.net
_________________________________________________________________
jSyncManager Development Team (http://www.jsyncmanager.org)
jSyncManager Email List
(https://lists.sourceforge.net/lists/listinfo/jsyncmanager-devel)
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