docs: public static String formatResourceName(String name, int maxLength) {
  
          if (name == null) {
              return null;
          }
  
          if (name.length() <= maxLength) {
              return name;
          }
  
          int total = name.length();
          String[] names = CmsStringUtil.splitAsArray(name, "/");
          if (name.endsWith("/")) {
              names[names.length - 1] = names[names.length - 1] + "/";
          }
          for (int i = 1; (total > maxLength) && (i < (names.length - 1)); i++) {
              if (i > 1) {
                  names[i - 1] = "";
              }
              names[i] = "...";
              total = 0;
              for (int j = 0; j < names.length; j++) {
                  int l = names[j].length();
                  total += l + ((l > 0) ? 1 : 0);
              }
          }
          if (total > maxLength) {
              names[0] = (names.length > 2) ? "" : (names.length > 1) ? "..." : names[0];
          }
  
          StringBuffer result = new StringBuffer();
          for (int i = 0; i < names.length; i++) {
              if (names[i].length() > 0) {
                  result.append("/");
                  result.append(names[i]);
              }
          }
  
          return result.toString();
      }