posted 22 years ago
Don't be lazy, construct a FileReader first, after build, close it. This will solve too many files open problem. This is extremely important to busy websites. The resources will be used really quickly. You don't DOS (deny of services) by your own mistake. You original code will never close the valuable resources.
All 60 files are closed after build, but all Documents are still available for traversal.
See complete tested code here:
http://bobcat.webappcabaret.net/javachina/faq/xml_java_01.htm#jaxp_jdom_Q30
[ April 12, 2003: Message edited by: Roseanne Zhang ]