mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 02:58:58 +00:00
More charset violations
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1067163 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0188da6a73
commit
783c8fd7b5
@ -46,7 +46,7 @@ public class TestXPathEntityProcessor extends AbstractDataImportHandlerTestCase
|
|||||||
tmpdir.delete();
|
tmpdir.delete();
|
||||||
tmpdir.mkdir();
|
tmpdir.mkdir();
|
||||||
tmpdir.deleteOnExit();
|
tmpdir.deleteOnExit();
|
||||||
createFile(tmpdir, "x.xsl", xsl.getBytes(), false);
|
createFile(tmpdir, "x.xsl", xsl.getBytes("UTF-8"), false);
|
||||||
Map entityAttrs = createMap("name", "e", "url", "cd.xml",
|
Map entityAttrs = createMap("name", "e", "url", "cd.xml",
|
||||||
XPathEntityProcessor.FOR_EACH, "/catalog/cd");
|
XPathEntityProcessor.FOR_EACH, "/catalog/cd");
|
||||||
List fields = new ArrayList();
|
List fields = new ArrayList();
|
||||||
@ -211,7 +211,7 @@ public class TestXPathEntityProcessor extends AbstractDataImportHandlerTestCase
|
|||||||
tmpdir.delete();
|
tmpdir.delete();
|
||||||
tmpdir.mkdir();
|
tmpdir.mkdir();
|
||||||
tmpdir.deleteOnExit();
|
tmpdir.deleteOnExit();
|
||||||
TestFileListEntityProcessor.createFile(tmpdir, "x.xsl", xsl.getBytes(),
|
TestFileListEntityProcessor.createFile(tmpdir, "x.xsl", xsl.getBytes("UTF-8"),
|
||||||
false);
|
false);
|
||||||
Map entityAttrs = createMap("name", "e",
|
Map entityAttrs = createMap("name", "e",
|
||||||
XPathEntityProcessor.USE_SOLR_ADD_SCHEMA, "true", "xsl", ""
|
XPathEntityProcessor.USE_SOLR_ADD_SCHEMA, "true", "xsl", ""
|
||||||
|
@ -25,6 +25,7 @@ import org.apache.commons.collections.ExtendedProperties;
|
|||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -56,7 +57,11 @@ public class SolrParamResourceLoader extends ResourceLoader {
|
|||||||
@Override
|
@Override
|
||||||
public InputStream getResourceStream(String s) throws ResourceNotFoundException {
|
public InputStream getResourceStream(String s) throws ResourceNotFoundException {
|
||||||
String template = templates.get(s);
|
String template = templates.get(s);
|
||||||
return template == null ? null : new ByteArrayInputStream(template.getBytes());
|
try {
|
||||||
|
return template == null ? null : new ByteArrayInputStream(template.getBytes("UTF-8"));
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
throw new RuntimeException(e); // may not happen
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
package org.apache.solr.servlet.cache;
|
package org.apache.solr.servlet.cache;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
@ -75,11 +76,15 @@ public final class HttpCacheHeaderUtil {
|
|||||||
if (currentIndexVersion != indexVersionCache) {
|
if (currentIndexVersion != indexVersionCache) {
|
||||||
indexVersionCache=currentIndexVersion;
|
indexVersionCache=currentIndexVersion;
|
||||||
|
|
||||||
|
try {
|
||||||
etagCache = "\""
|
etagCache = "\""
|
||||||
+ new String(Base64.encodeBase64((Long.toHexString
|
+ new String(Base64.encodeBase64((Long.toHexString
|
||||||
(Long.reverse(indexVersionCache))
|
(Long.reverse(indexVersionCache))
|
||||||
+ etagSeed).getBytes()))
|
+ etagSeed).getBytes()), "US-ASCII")
|
||||||
+ "\"";
|
+ "\"";
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
throw new RuntimeException(e); // may not happen
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return etagCache;
|
return etagCache;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user