- java.lang.Object
-
- net.sourceforge.urin.Authority
-
public abstract class Authority extends java.lang.Object
An authority component of a URI.An authority is made up of a host and optional user information and port.
- See Also:
- RFC 3986 - Authority
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static Authority
authority(Host host)
Factory method for creatingAuthority
s with just a host.static Authority
authority(Host host, Port port)
Factory method for creatingAuthority
s with host and port.static Authority
authority(UserInfo userInfo, Host host)
Factory method for creatingAuthority
s with user information and host.static Authority
authority(UserInfo userInfo, Host host, Port port)
Factory method for creatingAuthority
s with user information, host, and port.abstract Host
host()
static Authority
parse(java.lang.String authority)
Parses the givenString
as an authority.
-
-
-
Method Detail
-
authority
public static Authority authority(Host host)
Factory method for creatingAuthority
s with just a host.- Parameters:
host
- anyHost
.- Returns:
- an
Authority
representing the givenHost
.
-
authority
public static Authority authority(UserInfo userInfo, Host host)
Factory method for creatingAuthority
s with user information and host.- Parameters:
userInfo
- anyUserInfo
.host
- anyHost
.- Returns:
- an
Authority
representing the givenUserInfo
andHost
.
-
authority
public static Authority authority(Host host, Port port)
Factory method for creatingAuthority
s with host and port.- Parameters:
host
- anyHost
.port
- anyPort
- Returns:
- an
Authority
representing the givenHost
andPort
.
-
authority
public static Authority authority(UserInfo userInfo, Host host, Port port)
Factory method for creatingAuthority
s with user information, host, and port.- Parameters:
userInfo
- anyUserInfo
.host
- anyHost
.port
- anyPort
- Returns:
- an
Authority
representing the givenUserInfo
,Host
andPort
-
parse
public static Authority parse(java.lang.String authority) throws ParseException
Parses the givenString
as an authority.- Parameters:
authority
- aString
that represents a URI.- Returns:
- an
Authority
representing the authority represented by the givenString
. - Throws:
ParseException
- if the givenString
is not a valid authority.
-
host
public abstract Host host()
-
-