You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2016/06/16 12:09:16 UTC

[46/50] [abbrv] lucene-solr:apiv2: SOLR-8048: bin/solr script should support basic auth credentials provided in solr.in.sh

SOLR-8048: bin/solr script should support basic auth credentials provided in solr.in.sh


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5ee4e8a6
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5ee4e8a6
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5ee4e8a6

Branch: refs/heads/apiv2
Commit: 5ee4e8a6141b6d9ac0016e82b6561bca9587faf0
Parents: 2e101c4
Author: Noble Paul <no...@apache.org>
Authored: Tue Jun 14 19:47:18 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Jun 14 19:47:18 2016 +0530

----------------------------------------------------------------------
 solr/core/src/java/org/apache/solr/util/SolrCLI.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5ee4e8a6/solr/core/src/java/org/apache/solr/util/SolrCLI.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/SolrCLI.java b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
index 5e6908a..474d1fc 100644
--- a/solr/core/src/java/org/apache/solr/util/SolrCLI.java
+++ b/solr/core/src/java/org/apache/solr/util/SolrCLI.java
@@ -104,6 +104,7 @@ import org.noggit.ObjectBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
 import static org.apache.solr.common.params.CommonParams.NAME;
 /**
  * Command-line utility for working with Solr.
@@ -164,8 +165,8 @@ public class SolrCLI {
 
         HttpClientUtil.addRequestInterceptor((httpRequest, httpContext) -> {
           String pair = ss.get(0) + ":" + ss.get(1);
-          byte[] encodedBytes = Base64.encodeBase64(pair.getBytes(StandardCharsets.UTF_8));
-          httpRequest.addHeader(new BasicHeader("Authorization", "Basic "+ new String(encodedBytes)));
+          byte[] encodedBytes = Base64.encodeBase64(pair.getBytes(UTF_8));
+          httpRequest.addHeader(new BasicHeader("Authorization", "Basic "+ new String(encodedBytes, UTF_8)));
         });
       }
     }
@@ -2344,7 +2345,7 @@ public class SolrCLI {
       
       echo("\nWelcome to the SolrCloud example!\n");
 
-      Scanner readInput = prompt ? new Scanner(userInput, StandardCharsets.UTF_8.name()) : null;
+      Scanner readInput = prompt ? new Scanner(userInput, UTF_8.name()) : null;
       if (prompt) {
         echo("This interactive session will help you launch a SolrCloud cluster on your local workstation.");