Class KUrl
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:
- Serialized Form
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description KUrlconcat(String url)KUrlconcat(KUrl url)booleanequals(Object obj)booleanequalsIgnoreProtocol(Object obj)StringgetDomain()String[]getElements()StringgetExtension()StringgetFileNameNoExtension()StringgetName()KUrlgetParentURL()StringgetProtocol()inthashCode()booleanisRelative()Stringmangled()Stringmangled(boolean allowFileSep)protected voidnormalize()protected StringnormalizeDomain(String s)removes 'www' in case and removes country code.KUrlprepend(String name)booleanstartsWith(KUrl base)static StringstripDoubleSeps(String url)StringtoString()StringtoUrlString()StringtoUrlString(boolean withProtocol)KUrlunified()removes www, protocol and country
-
Constructor Details
-
Method Details
-
stripDoubleSeps
-
normalize
protected void normalize() -
concat
-
concat
-
getProtocol
-
getElements
-
getExtension
-
getFileNameNoExtension
-
toUrlString
-
mangled
-
mangled
-
toUrlString
-
getParentURL
-
getName
-
equals
-
equalsIgnoreProtocol
-
hashCode
public int hashCode() -
toString
-
isRelative
public boolean isRelative() -
prepend
-
startsWith
-
unified
removes www, protocol and country- Returns:
-
normalizeDomain
removes 'www' in case and removes country code. EXPECT protocol to be absent- Parameters:
s-- Returns:
-
getDomain
-