java.lang.Object
org.nustaq.kontraktor.webapp.javascript.KUrl
All Implemented Interfaces:
Serializable

public class KUrl extends Object implements Serializable
Created by ruedi on 19/07/15. url wrapper. note '//www.x.y' style not supported FIXME: replace/subclass with HttpUrl from okhttp lib
See Also:
  • Constructor Details

    • KUrl

      public KUrl(String url)
    • KUrl

      public KUrl(String protocol, String[] elements)
    • KUrl

      public KUrl(String[] elements)
  • Method Details

    • stripDoubleSeps

      public static String stripDoubleSeps(String url)
    • normalize

      protected void normalize()
    • concat

      public KUrl concat(String url)
    • concat

      public KUrl concat(KUrl url)
    • getProtocol

      public String getProtocol()
    • getElements

      public String[] getElements()
    • getExtension

      public String getExtension()
    • getFileNameNoExtension

      public String getFileNameNoExtension()
    • toUrlString

      public String toUrlString()
    • mangled

      public String mangled()
    • mangled

      public String mangled(boolean allowFileSep)
    • toUrlString

      public String toUrlString(boolean withProtocol)
    • getParentURL

      public KUrl getParentURL()
    • getName

      public String getName()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsIgnoreProtocol

      public boolean equalsIgnoreProtocol(Object obj)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isRelative

      public boolean isRelative()
    • prepend

      public KUrl prepend(String name)
    • startsWith

      public boolean startsWith(KUrl base)
    • unified

      public KUrl unified()
      removes www, protocol and country
      Returns:
    • normalizeDomain

      protected String normalizeDomain(String s)
      removes 'www' in case and removes country code. EXPECT protocol to be absent
      Parameters:
      s -
      Returns:
    • getDomain

      public String getDomain()