/** * gives an {@link URLPath}, which contains all elements starting from the * given index. * * @param start of the first element (including) {@link URLPath} * @return the {@link URLPath} with the sub elements */ public URLPath getSubPath(int start) { return getSubPath(start, size()); }
/** * gives a {@link URLPath} without a trailing slash * * @return a new created {@link URLPath}, which have all elements, without a * trailing slash */ public URLPath removeTrailingSlash() { if (!hasTrailingSlash()) { return this; } return getSubPath(0, size() - 1); }
@Override public String getEffectivePathInfo() { int start = 1; if (!isAuthenticationSchemeInServletPath()) { start = 2; } URLPath path = getPath().getSubPath(start); if (path.isEmpty()) { return ""; } return "/" + path.removeTrailingSlash().asString(); }