code: public static String getRelativeSubPath(String base, String path) {
  
          String result = null;
          base = CmsStringUtil.joinPaths(base, "/");
          path = CmsStringUtil.joinPaths(path, "/");
          if (path.startsWith(base)) {
              result = path.substring(base.length());
          }
          if (result != null) {
              if (result.endsWith("/")) {
                  result = result.substring(0, result.length() - 1);
              }
              if (!result.startsWith("/")) {
                  result = "/" + result;
              }
          }
          return result;
      }
docs: Converts the given path to a path relative to a base folder,
  but only if it actually is a sub-path of the latter,
  otherwise <code>null</code> is returned.<p>
  
  <b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p>
  
  @param base the base path
  @param path the path which should be converted to a relative path
  
  @return 'path' converted to a path relative to 'base', or null if 'path' is not a sub-folder of 'base'