com.sun.jini.jeri.internal.http
Class ServerInfo.LineParser

java.lang.Object
  extended by com.sun.jini.jeri.internal.http.ServerInfo.LineParser
Enclosing class:
ServerInfo

private static class ServerInfo.LineParser
extends Object

Class for parsing multi-part HTTP header lines that may appear as the values of the WWW-Authenticate, Proxy-Authenticate, Authorization-Info or Proxy-Authorization-Info header lines.


Field Summary
private  char[] ca
           
private static int COMMA
           
private  List entries
           
private static int EOL
           
private static int EQUALS
           
private  int pos
           
private static int QUOTE
           
private  String tokenString
           
private static int WORD
           
 
Constructor Summary
ServerInfo.LineParser(String line)
          Attempts to parse the given line into a series of key/optional value definitions.
 
Method Summary
(package private)  Map getAllEntries()
          Returns the key/value entries encountered in the parsed line.
(package private)  Map getEntries(String scheme)
          Returns all key/value entries associated with the given authorization scheme in the parsed line, or null if the given scheme was not described in the parsed line.
private  int nextToken()
          Returns code indicating next token in line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EOL

private static final int EOL
See Also:
Constant Field Values

WORD

private static final int WORD
See Also:
Constant Field Values

QUOTE

private static final int QUOTE
See Also:
Constant Field Values

COMMA

private static final int COMMA
See Also:
Constant Field Values

EQUALS

private static final int EQUALS
See Also:
Constant Field Values

entries

private final List entries

ca

private final char[] ca

pos

private int pos

tokenString

private String tokenString
Constructor Detail

ServerInfo.LineParser

ServerInfo.LineParser(String line)
                throws HttpParseException
Attempts to parse the given line into a series of key/optional value definitions. Throws an HttpParseException if the line contains syntax errors.

Throws:
HttpParseException
Method Detail

nextToken

private int nextToken()
               throws HttpParseException
Returns code indicating next token in line. If token type is WORD, tokenString is set to the word text; if returned type is QUOTE, tokenString is set to the quoted string's contents.

Throws:
HttpParseException

getEntries

Map getEntries(String scheme)
Returns all key/value entries associated with the given authorization scheme in the parsed line, or null if the given scheme was not described in the parsed line. Authorization scheme identifiers are those which appear without a subsequent '=' or ',' character before the next word; key/value entries are associated with the nearest preceding scheme identifier. All key strings are converted to lower case.


getAllEntries

Map getAllEntries()
Returns the key/value entries encountered in the parsed line. This method should be used to obtain the parse results for Authorization-Info and Proxy-Authorization-Info values, which do not contain authorization scheme identifiers. All key strings are converted to lower case.



Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.