java.lang.Object
com.aoapps.net.partialurl.URLFieldSource
- All Implemented Interfaces:
FieldSource
Obtains fields for
PartialURL
from a URL
.
Implementation Note:
This implementation is not thread safe due to results caching.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the context path for this URL, only ending in a slash (/) when isthe root context
.getHost()
Gets the IP address or hostname for this URL.getPath()
Gets the path for this URL ornull
when the path does not exist or is empty.getPort()
Gets the port number for this URL.Gets the scheme (such as https/http/other) for this URL.
-
Constructor Details
-
URLFieldSource
Creates a field source for the given URL.
-
-
Method Details
-
getScheme
Gets the scheme (such as https/http/other) for this URL.- Specified by:
getScheme
in interfaceFieldSource
- See Also:
-
getHost
Gets the IP address or hostname for this URL.- Specified by:
getHost
in interfaceFieldSource
- Throws:
MalformedURLException
- When unable to obtain the host or the obtained host is invalid- See Also:
-
getPort
Gets the port number for this URL.Implementation Note:
The implementation assumesProtocol.TCP
.- Specified by:
getPort
in interfaceFieldSource
- Throws:
MalformedURLException
- When unable to obtain the port or the obtained port is invalid- See Also:
-
getContextPath
Gets the context path for this URL, only ending in a slash (/) when isthe root context
.Implementation Note:
This always returnsPath.ROOT
.- Specified by:
getContextPath
in interfaceFieldSource
- See Also:
-
getPath
Gets the path for this URL ornull
when the path does not exist or is empty.- Specified by:
getPath
in interfaceFieldSource
- Throws:
MalformedURLException
- When unable to obtain the path or the obtained path is invalid- See Also:
-