|
Java HTTP Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.net.httpserver.HttpPrincipal
public class HttpPrincipal
Represents a user authenticated by HTTP Basic or Digest authentication.
Constructor Summary | |
---|---|
HttpPrincipal(String username,
String realm)
creates a HttpPrincipal from the given username and realm |
Method Summary | |
---|---|
boolean |
equals(Object another)
Compares two HttpPrincipal. |
String |
getName()
returns the contents of this principal in the form realm:username |
String |
getRealm()
returns the realm this object was created with. |
String |
getUsername()
returns the username this object was created with. |
int |
hashCode()
returns a hashcode for this HttpPrincipal. |
String |
toString()
returns the same string as getName() |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HttpPrincipal(String username, String realm)
username
- The name of the user within the realmrealm
- The realm.
NullPointerException
- if either username or realm are nullMethod Detail |
---|
public boolean equals(Object another)
true
if another is an instance of HttpPrincipal, and its
username and realm are equal to this object's username
and realm. Returns false
otherwise.
equals
in interface Principal
equals
in class Object
public String getName()
getName
in interface Principal
public String getUsername()
public String getRealm()
public int hashCode()
(getUsername()+getRealm().hashCode()
hashCode
in interface Principal
hashCode
in class Object
public String toString()
toString
in interface Principal
toString
in class Object
|
Java HTTP Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |