mirror of https://github.com/apache/lucene.git
SOLR-4525: Fix forbidden-apis violation. Java Properties are defined to be binary not character based. The format is using a binary protocol to write them (see javadocs).
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1452136 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6e94771693
commit
716f10c0c1
|
@ -26,7 +26,7 @@ import org.junit.Test;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.StringReader;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
@ -57,9 +57,9 @@ public class TestSolrDiscoveryProperties extends SolrTestCaseJ4 {
|
|||
String[] parts = extra.split("=");
|
||||
props.put(parts[0], parts[1]);
|
||||
}
|
||||
FileWriter writer = new FileWriter(solrProps.getAbsolutePath());
|
||||
props.store(writer, null);
|
||||
writer.close();
|
||||
FileOutputStream out = new FileOutputStream(solrProps.getAbsolutePath());
|
||||
props.store(out, null);
|
||||
out.close();
|
||||
}
|
||||
|
||||
private void addSolrXml() throws Exception {
|
||||
|
@ -91,9 +91,9 @@ public class TestSolrDiscoveryProperties extends SolrTestCaseJ4 {
|
|||
File parent = propFile.getParentFile();
|
||||
assertTrue("Failed to mkdirs for " + parent.getAbsolutePath(), parent.mkdirs());
|
||||
|
||||
FileWriter writer = new FileWriter(propFile);
|
||||
stockProps.store(writer, null);
|
||||
writer.close();
|
||||
FileOutputStream out = new FileOutputStream(propFile);
|
||||
stockProps.store(out, null);
|
||||
out.close();
|
||||
|
||||
addConfFiles(new File(parent, "conf"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue