- All Superinterfaces:
org.refcodes.mixin.CredentialsAccessor
,org.refcodes.mixin.Dumpable
,FragmentAccessor
,HostAccessor
,org.refcodes.mixin.IdentityAccessor
,IpAddressAccessor
,org.refcodes.mixin.PathAccessor
,org.refcodes.mixin.PortAccessor
,QueryFieldsAccessor
,SchemeAccessor
,org.refcodes.mixin.SecretAccessor
- All Known Subinterfaces:
Url.UrlBuilder
- All Known Implementing Classes:
UrlBuilderImpl
,UrlImpl
public interface Url extends org.refcodes.mixin.Dumpable, SchemeAccessor, HostAccessor, IpAddressAccessor, org.refcodes.mixin.PortAccessor, org.refcodes.mixin.PathAccessor, QueryFieldsAccessor, FragmentAccessor, org.refcodes.mixin.CredentialsAccessor
An URL looks something like this:
"scheme://[identity[:secret]@]host[:port][/path][?query][#fragment] In
contrast to the
java.net
URL
, this URL also supports
"relative" locators with neither a scheme nor a host declaration. If the
relative locator starts with a "/" slash, then we assume not having a host
being provided: "/path?query#fragment" When it does *not* start with a "/"
slash, then we assume that the first element being the host:
"[identity[:secret]@]host[:port]/path[?query][#fragment]"-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Url.UrlBuilder
Nested classes/interfaces inherited from interface org.refcodes.mixin.CredentialsAccessor
org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<B extends org.refcodes.mixin.CredentialsAccessor.CredentialsBuilder<B>>, org.refcodes.mixin.CredentialsAccessor.CredentialsMutator, org.refcodes.mixin.CredentialsAccessor.CredentialsProperty
Nested classes/interfaces inherited from interface org.refcodes.web.FragmentAccessor
FragmentAccessor.FragmentBuilder<B extends FragmentAccessor.FragmentBuilder<?>>, FragmentAccessor.FragmentMutator, FragmentAccessor.FragmentProperty
Nested classes/interfaces inherited from interface org.refcodes.web.HostAccessor
HostAccessor.HostBuilder<B extends HostAccessor.HostBuilder<?>>, HostAccessor.HostMutator, HostAccessor.HostProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.IdentityAccessor
org.refcodes.mixin.IdentityAccessor.IdentityBuilder<B extends org.refcodes.mixin.IdentityAccessor.IdentityBuilder<B>>, org.refcodes.mixin.IdentityAccessor.IdentityMutator, org.refcodes.mixin.IdentityAccessor.IdentityProperty
Nested classes/interfaces inherited from interface org.refcodes.web.IpAddressAccessor
IpAddressAccessor.IpAddressBuilder<B extends IpAddressAccessor.IpAddressBuilder<B>>, IpAddressAccessor.IpAddressMutator, IpAddressAccessor.IpAddressProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.PathAccessor
org.refcodes.mixin.PathAccessor.PathBuilder<B extends org.refcodes.mixin.PathAccessor.PathBuilder<?>>, org.refcodes.mixin.PathAccessor.PathMutator, org.refcodes.mixin.PathAccessor.PathProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.PortAccessor
org.refcodes.mixin.PortAccessor.PortBuilder<B extends org.refcodes.mixin.PortAccessor.PortBuilder<B>>, org.refcodes.mixin.PortAccessor.PortMutator, org.refcodes.mixin.PortAccessor.PortProperty
Nested classes/interfaces inherited from interface org.refcodes.web.QueryFieldsAccessor
QueryFieldsAccessor.QueryFieldsBuilder<B extends QueryFieldsAccessor.QueryFieldsBuilder<?>>, QueryFieldsAccessor.QueryFieldsMutator, QueryFieldsAccessor.QueryFieldsProperty
Nested classes/interfaces inherited from interface org.refcodes.web.SchemeAccessor
SchemeAccessor.SchemeBuilder<B extends SchemeAccessor.SchemeBuilder<B>>, SchemeAccessor.SchemeMutator, SchemeAccessor.SchemeProperty
Nested classes/interfaces inherited from interface org.refcodes.mixin.SecretAccessor
org.refcodes.mixin.SecretAccessor.SecretBuilder<B extends org.refcodes.mixin.SecretAccessor.SecretBuilder<B>>, org.refcodes.mixin.SecretAccessor.SecretMutator, org.refcodes.mixin.SecretAccessor.SecretProperty
-
Method Summary
Modifier and Type Method Description default String
toHost()
Returns the "host" depending on whether an IP-Address has been provided or a host name.default String
toHttpUrl()
default String
toLocator()
Creates the locator part from theUrl
instance's state, excluding the fragment or the query fields.default URL
toURL()
Methods inherited from interface org.refcodes.mixin.Dumpable
toDump, toDump, toPrintable
Methods inherited from interface org.refcodes.web.FragmentAccessor
getFragment
Methods inherited from interface org.refcodes.web.HostAccessor
getHost
Methods inherited from interface org.refcodes.mixin.IdentityAccessor
getIdentity
Methods inherited from interface org.refcodes.web.IpAddressAccessor
getIpAddress, toCidrNotation
Methods inherited from interface org.refcodes.mixin.PathAccessor
getPath
Methods inherited from interface org.refcodes.mixin.PortAccessor
getPort
Methods inherited from interface org.refcodes.web.QueryFieldsAccessor
getQueryFields
Methods inherited from interface org.refcodes.web.SchemeAccessor
getScheme, toProtocol
Methods inherited from interface org.refcodes.mixin.SecretAccessor
getSecret
-
Method Details
-
toHost
Returns the "host" depending on whether an IP-Address has been provided or a host name.- Returns:
- The determined host.
-
toHttpUrl
-
toLocator
Creates the locator part from theUrl
instance's state, excluding the fragment or the query fields.- Returns:
- The locator for the given
Url
.
-
toURL
- Returns:
- The according
URL
instance. - Throws:
MalformedURLException
- thrown in case the state of yourUrl
instance cannot be used to construct a validURL
, you may be missing some properties.
-