Package com.helger.http.basicauth
Class BasicAuthServerBuilder
java.lang.Object
com.helger.http.basicauth.BasicAuthServerBuilder
Builder for creating HTTP Basic Authentication server challenge header
values.
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BasicAuthServerBuilder
public BasicAuthServerBuilder()Default constructor.
-
-
Method Details
-
getRealm
- Returns:
- The currently set realm. May be
nullif not yet set.
-
setRealm
Set the realm to be used.- Parameters:
sRealm- The realm to be used. May not benulland should not be empty.- Returns:
- this
-
isValid
public boolean isValid()- Returns:
trueif this builder has all required fields set (i.e. the realm is notnull),falseotherwise.
-
build
Build the HTTP Basic Authentication server challenge header value string.- Returns:
- The formatted Basic auth header value. Neither
nullnor empty. - Throws:
IllegalStateException- if this builder is not valid (i.e. the realm has not been set).
-
toString
-