• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

is Document object closes the open file

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm using
SAXBuilder xmlFilebuilder = new SAXBuilder();
Document xmlDocument = xmlFilebuilder.build(filePath);

to parse the XML file. But my application requires many hits to XML file.
the app I'm developing is getting one problem as "Too Many open files".
I'm using JDK 6.

I'm not closing the file explicitly as I don't have instance of file. I'm using SAXBuilder.
is Document object closes the object explicitly or not...

thanks
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, Im not familiar with JDOM but generally we expect XML parsers to close the input stream no matter where it comes from.

You could always build a java.io.InputStream and use the build( inputstream ) then close the stream explicitly.

Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic