Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

forgot to close input stream

  • Loading branch information...
commit c98e521017ec14077c4bcc80499ade32705317ee 1 parent f855b8a
@jalpedersen authored
View
8 src/main/java/com/github/rnewson/couchdb/lucene/LuceneServlet.java
@@ -19,6 +19,7 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.HashSet;
@@ -84,12 +85,17 @@ public void init(ServletConfig config) throws ServletException {
try {
if (configFile != null) {
final URL url = new URL(configFile);
+ InputStream ignoredStream = null;
try {
- url.openStream(); //Check that file actually exists
+ ignoredStream = url.openStream(); //Check that file actually exists
init(new Config(url));
} catch (FileNotFoundException e ) {
LOG.error("Cannot open: " + configFile + ". Using defaults");
init(new Config());
+ } finally {
+ if (ignoredStream != null) {
+ ignoredStream.close();
+ }
}
} else {
init(new Config());
Please sign in to comment.
Something went wrong with that request. Please try again.