o

com.codedx.util

UrlUtils

object UrlUtils

Created by ryanm on 6/14/2017.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UrlUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def getUrlPath(url: String, extraHostnames: List[String] = Nil): String

    For any URL, returns the "path" component (including query params and anchor.)

    For any URL, returns the "path" component (including query params and anchor.)

    Meant to be used for possibly-malformed URLs with special characters (eg '{', '}') which would fail to be parsed by default URL/URI behavior.

    url

    Any URL (absolute, relative, with/without scheme, etc.)

    extraHostnames

    Keywords to treat as potential "hostnames" when parsing a URI without any transport scheme. These are in addition to localhost.

    returns

    The path component of the given URL.

  11. def getUrlWithSubdomain(url: String, subd: String): String
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. def joinUrl(base: String, add: String*): String

    Concatenate a series of strings that are treated as URL segments, adding / between each segment as needed, preserving the trailing slash in the final segment, as well as any leading slash in the first segment.

    Concatenate a series of strings that are treated as URL segments, adding / between each segment as needed, preserving the trailing slash in the final segment, as well as any leading slash in the first segment.

    This method assumes the base is some already-valid URL that has at least a protocol and a host, and so will treat each of the given add segments as PATH segments where ensuring a / between each segment is the right thing to do.

    One caveat of this is that if for some reason you need to have an empty path segment, leading to a URL like https://example.com/foo//bar (empty segment between foo and bar), this method is not appropriate to use; e.g. joinUrl("https://example.com", "foo", "", "bar") will output "https://example.com/foo/bar". Instead, you should use the java.net.URL constructor, or treat the foo//bar segments as a single segment, since this method will not attempt to modify the insides of any given segment (only the edges).

    Note that the semantics of this method differ from the new URL(context: URL, spec: String) constructor, as this method is not trying to resolve relative-vs-absolute paths. If spec has a leading slash, the URL "context" constructor will replace the entire path with that spec, whereas this method will simply append the spec as the next segment. This method also assumes that all of the segments have already been properly escaped; it will not interpret escape sequences or make any noise if an segment contains string data that would create an invalid URL.

    See the unit tests at UrlUtilsSpec for a suite of expected behaviors.

  15. def lastHrefSegment(s: String): String
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped