@@ -46,11 +46,10 @@ public class Realm {
46
46
private final Uri uri ;
47
47
private final String methodName ;
48
48
private final boolean usePreemptiveAuth ;
49
- private final String enc ;
49
+ private final Charset charset ;
50
50
private final String host ;
51
51
private final boolean messageType2Received ;
52
52
private final String ntlmDomain ;
53
- private final Charset charset ;
54
53
private final boolean useAbsoluteURI ;
55
54
private final boolean omitQuery ;
56
55
private final boolean targetProxy ;
@@ -60,7 +59,7 @@ public enum AuthScheme {
60
59
}
61
60
62
61
private Realm (AuthScheme scheme , String principal , String password , String realmName , String nonce , String algorithm , String response ,
63
- String qop , String nc , String cnonce , Uri uri , String method , boolean usePreemptiveAuth , String ntlmDomain , String enc ,
62
+ String qop , String nc , String cnonce , Uri uri , String method , boolean usePreemptiveAuth , String ntlmDomain , Charset charset ,
64
63
String host , boolean messageType2Received , String opaque , boolean useAbsoluteURI , boolean omitQuery , boolean targetProxy ) {
65
64
66
65
this .principal = principal ;
@@ -78,10 +77,9 @@ private Realm(AuthScheme scheme, String principal, String password, String realm
78
77
this .methodName = method ;
79
78
this .usePreemptiveAuth = usePreemptiveAuth ;
80
79
this .ntlmDomain = ntlmDomain ;
81
- this .enc = enc ;
82
80
this .host = host ;
83
81
this .messageType2Received = messageType2Received ;
84
- this .charset = enc != null ? Charset . forName ( enc ) : null ;
82
+ this .charset = charset ;
85
83
this .useAbsoluteURI = useAbsoluteURI ;
86
84
this .omitQuery = omitQuery ;
87
85
this .targetProxy = targetProxy ;
@@ -140,10 +138,6 @@ public Uri getUri() {
140
138
return uri ;
141
139
}
142
140
143
- public String getEncoding () {
144
- return enc ;
145
- }
146
-
147
141
public Charset getCharset () {
148
142
return charset ;
149
143
}
@@ -279,7 +273,7 @@ public static class RealmBuilder {
279
273
private String methodName = "GET" ;
280
274
private boolean usePreemptive ;
281
275
private String ntlmDomain = System .getProperty ("http.auth.ntlm.domain" , "" );
282
- private String enc = UTF_8 . name () ;
276
+ private Charset charset = UTF_8 ;
283
277
private String host = "localhost" ;
284
278
private boolean messageType2Received ;
285
279
private boolean useAbsoluteURI = true ;
@@ -492,7 +486,7 @@ public RealmBuilder clone(Realm clone) {
492
486
setNonce (clone .getNonce ());
493
487
setPassword (clone .getPassword ());
494
488
setPrincipal (clone .getPrincipal ());
495
- setEncoding (clone .getEncoding ());
489
+ setCharset (clone .getCharset ());
496
490
setOpaque (clone .getOpaque ());
497
491
setQop (clone .getQop ());
498
492
setScheme (clone .getScheme ());
@@ -537,12 +531,12 @@ private String match(String headerLine, String token) {
537
531
return value .charAt (0 ) == '"' ? value .substring (1 ) : value ;
538
532
}
539
533
540
- public String getEncoding () {
541
- return enc ;
534
+ public Charset getCharset () {
535
+ return charset ;
542
536
}
543
537
544
- public RealmBuilder setEncoding ( String enc ) {
545
- this .enc = enc ;
538
+ public RealmBuilder setCharset ( Charset charset ) {
539
+ this .charset = charset ;
546
540
return this ;
547
541
}
548
542
@@ -629,7 +623,7 @@ public Realm build() {
629
623
}
630
624
631
625
return new Realm (scheme , principal , password , realmName , nonce , algorithm , response , qop , nc , cnonce , uri , methodName ,
632
- usePreemptive , ntlmDomain , enc , host , messageType2Received , opaque , useAbsoluteURI , omitQuery , targetProxy );
626
+ usePreemptive , ntlmDomain , charset , host , messageType2Received , opaque , useAbsoluteURI , omitQuery , targetProxy );
633
627
}
634
628
}
635
629
}
0 commit comments