Constructor and Description |
---|
AuthScheme() |
Modifier and Type | Method and Description |
---|---|
protected abstract AuthScheme |
decode(String authorization)
Returns a
AuthScheme instance by decoding the authorization
header string. |
boolean |
matches(String authorization)
Tests whether the
authorization header string matches this
AuthScheme subclass's implementation. |
abstract String |
name()
Returns the name of this "Authorization" scheme.
|
AuthScheme |
parse(String authorization)
Returns a
AuthScheme instance by parsing the authorization
header string. |
static AuthScheme |
parse(String authorization,
Class<? extends AuthScheme>... schemes)
Returns an instance of a
AuthScheme subclass specified in
schemes that matches the spec of the authorization header
string. |
@SafeVarargs public static AuthScheme parse(String authorization, Class<? extends AuthScheme>... schemes)
AuthScheme
subclass specified in
schemes
that matches the spec of the authorization
header
string.authorization
- The "Authorization" header string to match.schemes
- The array of AuthScheme
classes to attempt to match.AuthScheme
subclass specified in
schemes
that matches the spec of the authorization
header string.UnsupportedOperationException
- If a AuthScheme
class in
schemes
does not implement a protected default
constructor, or if the constructor throws an exception when
invoked.public final boolean matches(String authorization)
authorization
header string matches this
AuthScheme
subclass's implementation.authorization
- The "Authorization" header string.true
if the authorization
header string matches
this AuthScheme
subclass's implementation; otherwise
false
.public final AuthScheme parse(String authorization)
AuthScheme
instance by parsing the authorization
header string.authorization
- The "Authorization" header string.AuthScheme
instance by parsing the authorization
header string.public abstract String name()
protected abstract AuthScheme decode(String authorization)
AuthScheme
instance by decoding the authorization
header string. This method is required to be overridden by subclasses
implementing an "Authorization" scheme.authorization
- The "Authorization" header string.AuthScheme
instance by decoding the authorization
header string.Copyright © 2019 LibJ. All rights reserved.