mirror of https://github.com/apache/lucene.git
SOLR-4525: Fix remaining issues with windows and not-closed files. Test is now passing. The problem here: The old code that used XML files did not need to close the streams, because XML parsers generally do it (for no good reason)...
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1452146 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6ba62cd0a2
commit
326531d820
|
@ -49,6 +49,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.solr.cloud.CloudDescriptor;
|
||||
import org.apache.solr.cloud.CurrentCoreDescriptorProvider;
|
||||
|
@ -339,7 +340,12 @@ public class CoreContainer
|
|||
*/
|
||||
public void load(String dir, File configFile) throws FileNotFoundException {
|
||||
this.configFile = configFile;
|
||||
this.load(dir, new FileInputStream(configFile), configFile.getName().endsWith(".xml"), configFile.getName());
|
||||
InputStream in = new FileInputStream(configFile);
|
||||
try {
|
||||
this.load(dir, in, configFile.getName().endsWith(".xml"), configFile.getName());
|
||||
} finally {
|
||||
IOUtils.closeQuietly(in);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue