|
@@ -17,6 +17,7 @@
|
|
*/
|
|
*/
|
|
package org.apache.hadoop.fs.http.server;
|
|
package org.apache.hadoop.fs.http.server;
|
|
|
|
|
|
|
|
+import org.apache.commons.io.Charsets;
|
|
import org.apache.hadoop.classification.InterfaceAudience;
|
|
import org.apache.hadoop.classification.InterfaceAudience;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.security.authentication.server.AuthenticationFilter;
|
|
import org.apache.hadoop.security.authentication.server.AuthenticationFilter;
|
|
@@ -24,8 +25,10 @@ import org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthentica
|
|
|
|
|
|
import javax.servlet.FilterConfig;
|
|
import javax.servlet.FilterConfig;
|
|
import javax.servlet.ServletException;
|
|
import javax.servlet.ServletException;
|
|
-import java.io.FileReader;
|
|
|
|
|
|
+
|
|
|
|
+import java.io.FileInputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.io.InputStreamReader;
|
|
import java.io.Reader;
|
|
import java.io.Reader;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.Properties;
|
|
import java.util.Properties;
|
|
@@ -77,7 +80,8 @@ public class HttpFSAuthenticationFilter
|
|
|
|
|
|
try {
|
|
try {
|
|
StringBuilder secret = new StringBuilder();
|
|
StringBuilder secret = new StringBuilder();
|
|
- Reader reader = new FileReader(signatureSecretFile);
|
|
|
|
|
|
+ Reader reader = new InputStreamReader(new FileInputStream(
|
|
|
|
+ signatureSecretFile), Charsets.UTF_8);
|
|
int c = reader.read();
|
|
int c = reader.read();
|
|
while (c > -1) {
|
|
while (c > -1) {
|
|
secret.append((char)c);
|
|
secret.append((char)c);
|