|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimple.util.parse.Parser
simple.util.parse.PrincipalParser
public class PrincipalParser
PrincipalParser is a parser class for the HTTP basic authorization
header. It decodes the base64
encoding of the user and
password pair.
This follows the parsing tree of RFC 2617. The goal of this parser
is to decode the base64
encoding of the user name and
password. After the string has been decoded then the user name and
password are extracted. This will only parse headers that are from
the Basic
authorization scheme. The format of the basic
scheme can be found in RFC 2617 and is of the form
Basic SP base64-encoding.
Field Summary |
---|
Fields inherited from class simple.util.parse.Parser |
---|
buf, count, off |
Constructor Summary | |
---|---|
PrincipalParser()
Creates a Parser for the basic authorization
scheme. |
|
PrincipalParser(java.lang.String header)
Creates a Parser for the basic authorization
scheme. |
Method Summary | |
---|---|
java.lang.String |
getName()
Gets the users name from the Authorization header value. |
java.lang.String |
getPassword()
Gets the users password parsed from the Authorization header value. |
protected void |
init()
This will initialize the Parser when it is ready
to parse a new String . |
protected void |
parse()
Used to parse the actual header data. |
Methods inherited from class simple.util.parse.Parser |
---|
digit, ensureCapacity, parse, skip, space, toLower |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrincipalParser()
Parser
for the basic authorization
scheme. This allows headers that are of this scheme to be
broken into its component parts i.e. user name and password.
public PrincipalParser(java.lang.String header)
Parser
for the basic authorization
scheme. This allows headers that are of this scheme to be
broken into its component parts i.e. user name and password.
This constructor will parse the String
given as
the header.
header
- this is a header value from the basic schemeMethod Detail |
---|
public java.lang.String getPassword()
null
getPassword
in interface Principal
null
public java.lang.String getName()
null
if there is no user
name extracted from the base64 header value.
getName
in interface Principal
protected void parse()
parse
in class Parser
protected void init()
Parser
when it is ready
to parse a new String
. This will reset the
Parser
to a ready state. The init
method
is invoked by the Parser
when the parse
method is invoked.
init
in class Parser
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |