Brooklyn

brooklyn.util.net
[Java] Class Urls

java.lang.Object
  brooklyn.util.net.Urls

public class Urls

Method Summary
static java.lang.String encode(java.lang.String text)

encodes the string suitable for use in a URL, using default character set (non-deprecated version of URLEncoder.encode)

static boolean isUrlWithProtocol(java.lang.String x)

returns true if the string begins with a non-empty string of letters followed by a colon, i.e.

static java.lang.String mergePaths(java.lang.String... items)

returns the items with exactly one "/" between items (whether or not the individual items start or end with /), except where character before the / is a : (url syntax) in which case it will permit multiple (will not remove any)

static Function stringToUriFunction()

static Function stringToUrlFunction()

static java.net.URI toUri(java.lang.String uri)

creates a URI, preserving null and propagating exceptions *unchecked*

static java.net.URI toUri(java.net.URL url)

creates a URI, preserving null and propagating exceptions *unchecked*

static java.net.URL toUrl(java.lang.String url)

creates a URL, preserving null and propagating exceptions *unchecked*

static java.net.URL toUrl(java.net.URI uri)

creates a URL, preserving null and propagating exceptions *unchecked*

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

encode

}
public static java.lang.String encode(java.lang.String text)
encodes the string suitable for use in a URL, using default character set (non-deprecated version of URLEncoder.encode)


isUrlWithProtocol

public static boolean isUrlWithProtocol(java.lang.String x)
returns true if the string begins with a non-empty string of letters followed by a colon, i.e. "protocol:" returns true, but "/" returns false


mergePaths

public static java.lang.String mergePaths(java.lang.String... items)
returns the items with exactly one "/" between items (whether or not the individual items start or end with /), except where character before the / is a : (url syntax) in which case it will permit multiple (will not remove any)


stringToUriFunction

public static Function stringToUriFunction()


stringToUrlFunction

public static Function stringToUrlFunction()


toUri

public static final java.net.URI toUri( java.lang.String uri)
creates a URI, preserving null and propagating exceptions *unchecked*


toUri

public static final java.net.URI toUri( java.net.URL url)
creates a URI, preserving null and propagating exceptions *unchecked*


toUrl

public static final java.net.URL toUrl(@Nullable java.lang.String url)
creates a URL, preserving null and propagating exceptions *unchecked*


toUrl

public static final java.net.URL toUrl(; java.net.URI uri)
creates a URL, preserving null and propagating exceptions *unchecked*


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.