MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / relativeToAbsolute

Method relativeToAbsolute

CodenameOne/src/com/codename1/io/Util.java:1549–1555  ·  view source on GitHub ↗
(String baseURL, String relativeURL)

Source from the content-addressed store, hash-verified

1547 ///
1548 /// an absolute URL
1549 public static String relativeToAbsolute(String baseURL, String relativeURL) {
1550 if (relativeURL.startsWith("/")) {
1551 return getURLProtocol(baseURL) + "://" + getURLHost(baseURL) + relativeURL;
1552 } else {
1553 return getURLProtocol(baseURL) + "://" + getURLHost(baseURL) + getURLBasePath(baseURL) + relativeURL;
1554 }
1555 }
1556
1557 /// Returns the protocol of an absolute URL e.g. http, https etc.
1558 ///

Callers 2

invokeStatic16Method · 0.80

Calls 4

getURLProtocolMethod · 0.95
getURLHostMethod · 0.95
getURLBasePathMethod · 0.95
startsWithMethod · 0.65

Tested by

no test coverage detected