Class HostPort
java.lang.Object
org.eclipse.jetty.util.HostPort
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptiongetHost()Get the host.intgetPort()Get the port.intgetPort(int defaultPort) Get the port or the given default port.booleanhasHost()booleanhasPort()protected booleanisValidHostName(String name) protected booleanstatic StringnormalizeHost(String host) static intParse a string representing a port validating it is a valid port value.toString()static HostPortCreate a HostPort from an unsafe (and not validated) authority. 
- 
Constructor Details
- 
HostPort
 - 
HostPort
- Throws:
 IllegalArgumentException
 
 - 
 - 
Method Details
- 
unsafe
Create a HostPort from an unsafe (and not validated) authority.There are no validations performed against the provided authority. It is quite possible to end up with HostPort that cannot be used to generate valid URL, URI, InetSocketAddress, Location header, etc.
- Parameters:
 authority- raw authority- Returns:
 - the HostPort
 
 - 
isValidIpAddress
 - 
isValidHostName
 - 
getHost
 - 
getPort
 - 
getPort
public int getPort(int defaultPort) Get the port or the given default port.- Parameters:
 defaultPort- , the default port to return if a port is not specified- Returns:
 - the port
 
 - 
hasHost
public boolean hasHost() - 
hasPort
public boolean hasPort() - 
toString
 - 
normalizeHost
 - 
parsePort
Parse a string representing a port validating it is a valid port value.- Parameters:
 rawPort- the port string.- Returns:
 - the integer value for the port.
 - Throws:
 IllegalArgumentException- if the port is invalid
 
 -