/** * Appends the given url path to this path. */ public URLPath append(URLPath toAppend) { if (toAppend == null || toAppend.isEmpty()) { return this; } if (this.isEmpty()) { return toAppend; } if (this.isRoot() && toAppend.isRoot()) { return ROOT; } ArrayList newParts = new ArrayList(removeTrailingSlash().segments); newParts.addAll(toAppend.segments); return new URLPath(newParts); }
@Override public String getEffectivePathInfo() { int start = 1; if (!isAuthenticationSchemeInServletPath()) { start = 2; } URLPath path = getPath().getSubPath(start); if (path.isEmpty()) { return ""; } return "/" + path.removeTrailingSlash().asString(); }