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

Method getURLBasePath

CodenameOne/src/com/codename1/io/Util.java:1620–1627  ·  view source on GitHub ↗
(String url)

Source from the content-addressed store, hash-verified

1618 ///
1619 /// the path within the host
1620 public static String getURLBasePath(String url) {
1621 int start = url.indexOf('/', url.indexOf("://") + 3);
1622 int end = url.lastIndexOf('/');
1623 if (start != -1 && end > start) {
1624 return url.substring(start, end + 1);
1625 }
1626 return "/";
1627 }
1628
1629 /// Writes a string with a null flag, this allows a String which may be null
1630 ///

Callers 2

relativeToAbsoluteMethod · 0.95
invokeStatic16Method · 0.80

Calls 3

indexOfMethod · 0.65
lastIndexOfMethod · 0.65
substringMethod · 0.65

Tested by

no test coverage detected