docs: public static int getPathLevel(String resource) {
  
          int level = -1;
          int pos = 0;
          while (resource.indexOf('/', pos) >= 0) {
              pos = resource.indexOf('/', pos) + 1;
              level++;
          }
          return level;
      }