List of usage examples for org.apache.wicket.request Url prependLeadingSegments
public void prependLeadingSegments(final List<String> newSegments)
segments
to the segments collection From source file:org.artifactory.webapp.wicket.application.ArtifactoryRequestCycleListener.java
License:Open Source License
private void fixSimpleRepoBrowsingUrl(Request request, Url url) { RepoPath repoPath = RequestUtils.getRepoPath((HttpServletRequest) request.getContainerRequest()); if (repoPath != null) { /*ArrayList<String> prefix = new ArrayList<String>(); String path = repoPath.getPath(); if (StringUtils.isNotEmpty(path)) { int nesting = new StringTokenizer(path, "/").countTokens() + 1; while (nesting > 0) {//from ww w . jav a 2s.c o m prefix.add(".."); nesting--; } } else { prefix.add(".."); } */ List<String> prefix = Lists.newArrayList(".."); String filterPath = request.getFilterPath(); if (StringUtils.isNotEmpty(filterPath) && filterPath.startsWith("/")) { prefix.add(filterPath.substring(1)); } url.prependLeadingSegments(prefix); } }