[jdom-interest] File lockup with invalid did

Jason Long jason at supernovasoftware.com
Wed Mar 26 16:02:44 PST 2003


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





More information about the jdom-interest mailing list