Package org.wiremock.url
Interface RelativeUrl
- All Known Subinterfaces:
PathAndQuery,SchemeRelativeUrl
Represents a relative reference as defined in RFC 3986 Section 4.2.
A relative reference is a URI reference that does not have a scheme component. It can have an authority, path, query, and fragment. Relative references are typically resolved against a base URI to produce another URI.
Implementations must be immutable and thread-safe.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionstatic RelativeUrl.Builderbuilder()Creates a new builderstatic RelativeUrl.Builderbuilder(RelativeUrl url) Creates a builder initialized with the values from the given URL.default @Nullable SchemeDeprecated.This always returns null so you have no reason to ever call itdefault booleanReturnstrueif this is an absolute URI (either an absolute URL or an Opaque URI).default booleanReturnstrueif this is an absolute URL (has a scheme and authority).default booleanReturnstrueif this is an Opaque URI (has a scheme but no authority).default booleanReturnstrueif this is a relative reference (has no scheme).static RelativeUrlParses a string into a relative reference.default RelativeUrl.Transformerthaw()Creates a transformer initialized with the values from this URL.Methods inherited from interface org.wiremock.stringparser.ParsedString
toStringMethods inherited from interface org.wiremock.url.Uri
getAuthority, getFragment, getHost, getPath, getPort, getQuery, getQueryOrEmpty, getResolvedPort, getUserInfo, toJavaUriMethods inherited from interface org.wiremock.url.Url
getPathAndQuery, transform
-
Method Details
-
getScheme
Deprecated.This always returns null so you have no reason to ever call itImplementations must ALWAYS return null -
isRelative
default boolean isRelative()Description copied from interface:UriReturnstrueif this is a relative reference (has no scheme).- Specified by:
isRelativein interfaceUri- Returns:
trueif this is a relative reference
-
isAbsolute
default boolean isAbsolute()Description copied from interface:UriReturnstrueif this is an absolute URI (either an absolute URL or an Opaque URI).- Specified by:
isAbsolutein interfaceUri- Returns:
trueif this is an absolute URI
-
isAbsoluteUrl
default boolean isAbsoluteUrl()Description copied from interface:UriReturnstrueif this is an absolute URL (has a scheme and authority).- Specified by:
isAbsoluteUrlin interfaceUri- Returns:
trueif this is an absolute URL
-
isOpaqueUri
default boolean isOpaqueUri()Description copied from interface:UriReturnstrueif this is an Opaque URI (has a scheme but no authority).- Specified by:
isOpaqueUriin interfaceUri- Returns:
trueif this is an Opaque URI
-
thaw
Description copied from interface:UrlCreates a transformer initialized with the values from this URL. -
parse
Parses a string into a relative reference.- Parameters:
relativeRef- the string to parse- Returns:
- the parsed relative reference
- Throws:
IllegalRelativeUrl- if the string is not a valid relative reference
-
builder
Creates a new builder- Returns:
- a new builder
-
builder
Creates a builder initialized with the values from the given URL.- Parameters:
url- the URL to copy values from- Returns:
- a new builder
-