io.lemonlabs.uri

Type members

Classlikes

sealed trait AbsoluteOrEmptyPath extends UrlPath

This trait has two subclasses; AbsolutePath and EmptyPath. This encompasses the paths allowed to be used in URLs that have an Authority. As per RFC 3986:

This trait has two subclasses; AbsolutePath and EmptyPath. This encompasses the paths allowed to be used in URLs that have an Authority. As per RFC 3986:

When authority is present, the path must either be empty or begin with a slash ("/") character.

Companion
object
Companion
class
final case class AbsolutePath(parts: Vector[String])(implicit config: UriConfig) extends AbsoluteOrEmptyPath

An AbsolutePath is a path that starts with a slash

An AbsolutePath is a path that starts with a slash

Companion
object
object AbsolutePath
Companion
class
final case class AbsoluteUrl(scheme: String, authority: Authority, path: AbsoluteOrEmptyPath, query: QueryString, fragment: Option[String])(implicit config: UriConfig) extends UrlWithAuthority with UrlWithScheme

Represents absolute URLs, for example: http://example.com

Represents absolute URLs, for example: http://example.com

Companion
object
object AbsoluteUrl
Companion
class
case class Authority(userInfo: Option[UserInfo], host: Host, port: Option[Int])(implicit config: UriConfig)
Companion
object
object Authority
Companion
class
final case class DataUrl(mediaType: MediaType, base64: Boolean, data: Array[Byte])(implicit config: UriConfig) extends UrlWithoutAuthority

Represents URLs with the data scheme, for example: data:text/plain;charset=UTF-8;page=21,the%20data:1234,5678

Represents URLs with the data scheme, for example: data:text/plain;charset=UTF-8;page=21,the%20data:1234,5678

Companion
object
object DataUrl
Companion
class
final case class DomainName(value: String)(implicit conf: UriConfig) extends Host with PunycodeSupport
Companion
object
object DomainName
Companion
class
case object EmptyPath extends AbsoluteOrEmptyPath
sealed trait Host
Companion
object
object Host
Companion
class
final case class IpV4(octet1: Byte, octet2: Byte, octet3: Byte, octet4: Byte)(implicit conf: UriConfig) extends Host
Companion
object
object IpV4
Companion
class
final case class IpV6(piece1: Char, piece2: Char, piece3: Char, piece4: Char, piece5: Char, piece6: Char, piece7: Char, piece8: Char)(implicit conf: UriConfig) extends Host
Companion
object
object IpV6
Companion
class
case class MediaType(rawValue: Option[String], parameters: Vector[(String, String)])
Companion
object
object MediaType
Companion
class
sealed trait Path extends Product with Serializable
Companion
object
object Path
Companion
class
object PathParts
final case class ProtocolRelativeUrl(authority: Authority, path: AbsoluteOrEmptyPath, query: QueryString, fragment: Option[String])(implicit config: UriConfig) extends UrlWithAuthority

Represents protocol relative URLs, for example: //example.com

Represents protocol relative URLs, for example: //example.com

Companion
object
Companion
class
case class QueryString(params: Vector[(String, Option[String])])(implicit config: UriConfig)
Companion
object
object QueryString
Companion
class
final case class RelativeUrl(path: UrlPath, query: QueryString, fragment: Option[String])(implicit config: UriConfig) extends Url

Represents Relative URLs which do not contain an authority. Examples include:

Represents Relative URLs which do not contain an authority. Examples include:

  •  Root Relative: `/index.html?a=b`
    
  • Rootless Relative: index.html?a=b
  • Rootless Relative (with dot segment): ../index.html?a=b
Companion
object
object RelativeUrl
Companion
class
final case class RootlessPath(parts: Vector[String])(implicit config: UriConfig) extends UrlPath
Companion
object
object RootlessPath
Companion
class
final case class ScpLikeUrl(user: Option[String], host: Host, path: UrlPath)(implicit config: UriConfig) extends UrlWithAuthority

Represents scp-like URLs, for example: [email protected]:lemonlabsuk/scala-uri.git

Represents scp-like URLs, for example: [email protected]:lemonlabsuk/scala-uri.git

From the scp manpage: [user@]host:[path]

Companion
object
object ScpLikeUrl
Companion
class
final case class SimpleUrlWithoutAuthority(scheme: String, path: UrlPath, query: QueryString, fragment: Option[String])(implicit config: UriConfig) extends UrlWithoutAuthority

Represents URLs that do not have an authority, for example: mailto:[email protected]

Represents URLs that do not have an authority, for example: mailto:[email protected]

Companion
object
sealed trait Uri extends Product with Serializable

Represents a URI. See RFC 3986

Represents a URI. See RFC 3986

Can either be a URL or a URN

URLs will be one of these forms:

  •       Absolute: `http://example.com`
    
  • Protocol Relative: //example.com
  • Without Authority: mailto:[email protected]
  •  Root Relative: `/index.html?a=b`
    
  • Rootless Relative: index.html?a=b
  • Rootless Relative (with doc segment): ../index.html?a=b

URNs will be in the form urn:example:example2

Companion
object
object Uri
Companion
class
class UriConversionException(msg: String) extends UriException
class UriException(msg: String) extends Exception
sealed trait Url extends Uri

Represents a URL, which will be one of these forms:

Represents a URL, which will be one of these forms:

  •       Absolute: `http://example.com`
    
  • Protocol Relative: //example.com
  • Without Authority: mailto:[email protected]
  •  Root Relative: `/index.html?a=b`
    
  • Rootless Relative: index.html?a=b
  • Rootless Relative (with doc segment): ../index.html?a=b
Companion
object
object Url
Companion
class
sealed trait UrlPath extends Path
Companion
object
object UrlPath
Companion
class
sealed trait UrlWithAuthority extends Url

Represents absolute URLs with an authority (i.e. URLs with a host), examples include:

Represents absolute URLs with an authority (i.e. URLs with a host), examples include:

  •      Absolute URL: `http://example.com`
    
  • Protocol Relative URL: //example.com
Companion
object
Companion
class
sealed trait UrlWithScheme extends Url
sealed trait UrlWithoutAuthority extends Url with UrlWithScheme

Represents URLs that do not have an authority, for example: mailto:[email protected] and data:text/plain;charset=UTF-8;page=21,the%20data:1234,5678

Represents URLs that do not have an authority, for example: mailto:[email protected] and data:text/plain;charset=UTF-8;page=21,the%20data:1234,5678

Companion
object
Companion
class
final case class Urn(path: UrnPath)(implicit config: UriConfig) extends Uri

Represents a URN. See RFC 2141 and RFC 8141

Represents a URN. See RFC 2141 and RFC 8141

URNs will be in the form urn:nid:nss

Companion
object
object Urn
Companion
class
final case class UrnPath(nid: String, nss: String)(implicit config: UriConfig) extends Path
Companion
object
object UrnPath
Companion
class
case class UserInfo(user: String, password: Option[String])(implicit config: UriConfig)
Companion
object
object UserInfo
Companion
class