code: private Map<String, String> generateUrlsFromDirectoryPaths(String currentPath, String contextPath, List<String> directoryPaths) {
          Map<String, String> urls = new TreeMap<>();
          for (String oneDir : directoryPaths) {
              String oneDirName = StringUtils.isNotBlank(currentPath) && StringUtils.startsWith(oneDir, currentPath) ? oneDir
                      .substring(currentPath.length() + 1) : oneDir;
              urls.put(oneDirName, contextPath + DIR_LISTING_PREFIX + oneDir);
          }
          return urls;
      }
docs: Will return each directory as a map entry. The key will be a nicer
  display name of the directory (just the directory name without the path).<br>
  The value will be the public directory path (such as returned from the
  {@link GalleryService}) prepended by the context path and service path.
  
  @param currentPath
  Webapp-specific path.
  @param contextPath
  Webapp context path.
  @param directoryPaths
  Directory paths.
  @return A Map where each key is a directory name for display, and each
  value is the URL for that directory listing.