src/share/classes/sun/net/www/protocol/http/DigestAuthentication.java
Print this page
@@ -198,26 +198,16 @@
}
/**
* @return true if this authentication supports preemptive authorization
*/
- boolean supportsPreemptiveAuthorization() {
+ @Override
+ public boolean supportsPreemptiveAuthorization() {
return true;
}
/**
- * @return the name of the HTTP header this authentication wants set
- */
- String getHeaderName() {
- if (type == SERVER_AUTHENTICATION) {
- return "Authorization";
- } else {
- return "Proxy-Authorization";
- }
- }
-
- /**
* Reclaculates the request-digest and returns it.
*
* <P> Used in the common case where the requestURI is simply the
* abs_path.
*
@@ -227,11 +217,12 @@
* @param method
* the HTTP method
*
* @return the value of the HTTP header this authentication wants set
*/
- String getHeaderValue(URL url, String method) {
+ @Override
+ public String getHeaderValue(URL url, String method) {
return getHeaderValueImpl(url.getFile(), method);
}
/**
* Reclaculates the request-digest and returns it.
@@ -257,11 +248,12 @@
* and return true. Otherwise return false.
* returning true means the request can be retried with the same userid/password
* returning false means we have to go back to the user to ask for a new
* username password.
*/
- boolean isAuthorizationStale (String header) {
+ @Override
+ public boolean isAuthorizationStale (String header) {
HeaderParser p = new HeaderParser (header);
String s = p.findValue ("stale");
if (s == null || !s.equals("true"))
return false;
String newNonce = p.findValue ("nonce");
@@ -277,11 +269,12 @@
* @param conn The connection to apply the header(s) to
* @param p A source of header values for this connection, if needed.
* @param raw Raw header values for this connection, if needed.
* @return true if all goes well, false if no headers were set.
*/
- boolean setHeaders(HttpURLConnection conn, HeaderParser p, String raw) {
+ @Override
+ public boolean setHeaders(HttpURLConnection conn, HeaderParser p, String raw) {
params.setNonce (p.findValue("nonce"));
params.setOpaque (p.findValue("opaque"));
params.setQop (p.findValue("qop"));
String uri;