LUCENE-1455: close FileInputStream after parsing

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@783595 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2009-06-11 01:13:51 +00:00
parent 5b654095c6
commit 85f5a9c740
1 changed files with 7 additions and 2 deletions

View File

@ -60,8 +60,13 @@ public class HtmlDocument {
Tidy tidy = new Tidy();
tidy.setQuiet(true);
tidy.setShowWarnings(false);
org.w3c.dom.Document root =
tidy.parseDOM(new FileInputStream(file), null);
org.w3c.dom.Document root = null;
InputStream is = new FileInputStream(file);
try {
root = tidy.parseDOM(is, null);
} finally {
is.close();
}
rawDoc = root.getDocumentElement();
}