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:
Uwe Schindler 2013-03-03 21:56:43 +00:00
parent 6e94771693
commit 716f10c0c1
1 changed files with 7 additions and 7 deletions

View File

@ -26,7 +26,7 @@ import org.junit.Test;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileWriter; import java.io.FileOutputStream;
import java.io.StringReader; import java.io.StringReader;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
@ -57,9 +57,9 @@ public class TestSolrDiscoveryProperties extends SolrTestCaseJ4 {
String[] parts = extra.split("="); String[] parts = extra.split("=");
props.put(parts[0], parts[1]); props.put(parts[0], parts[1]);
} }
FileWriter writer = new FileWriter(solrProps.getAbsolutePath()); FileOutputStream out = new FileOutputStream(solrProps.getAbsolutePath());
props.store(writer, null); props.store(out, null);
writer.close(); out.close();
} }
private void addSolrXml() throws Exception { private void addSolrXml() throws Exception {
@ -91,9 +91,9 @@ public class TestSolrDiscoveryProperties extends SolrTestCaseJ4 {
File parent = propFile.getParentFile(); File parent = propFile.getParentFile();
assertTrue("Failed to mkdirs for " + parent.getAbsolutePath(), parent.mkdirs()); assertTrue("Failed to mkdirs for " + parent.getAbsolutePath(), parent.mkdirs());
FileWriter writer = new FileWriter(propFile); FileOutputStream out = new FileOutputStream(propFile);
stockProps.store(writer, null); stockProps.store(out, null);
writer.close(); out.close();
addConfFiles(new File(parent, "conf")); addConfFiles(new File(parent, "conf"));
} }