(String url)
| 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 | /// |
no test coverage detected