code: private String getPreviousPath(String contextPath, String path) {
          if (StringUtils.isBlank(path)) {
              return null;
          }
          int lastIndexOfSlash = path.lastIndexOf('/');
          if (lastIndexOfSlash == -1) {
              return null;
          }
          return contextPath + DIR_LISTING_PREFIX + path.substring(0, lastIndexOfSlash);
      }
docs: Helper method that retrieves the URL to the previous path if available.
  Previous in this case always means one step up in the hierarchy. It is
  assumed that this is always a directory i.e. the URL will point to the
  {@value #DIR_LISTING_PREFIX} service.
  
  @param contextPath
  Webapp context path.
  @param path
  Webapp-specific path.
  @return The previous path, or null.