docs: static PluginMeta loadMeta(final File jar, final ZipInputStream zipinput) throws IOException {
          final String basename = basename(jar);
          PluginMeta metadata = null;
          boolean topfound = false;
          boolean found = false;
          boolean dirfound = false;
          boolean resfound = false;
          ZipEntry nextEntry = zipinput.getNextEntry();
          Set<String> paths = new HashSet<>();
          while (null != nextEntry) {
              paths.add(nextEntry.getName());
  
              if (!found && !nextEntry.isDirectory() && nextEntry.getName().equals(basename + "/plugin.yaml")) {
  //                debug("Found metadata: " + nextEntry.getName());
                  try {
                      metadata = loadMetadataYaml(zipinput);
                      found = true;
                  } catch (Throwable e) {
                      log.error("Error parsing metadata file plugin.yaml: " + e.getMessage(), e);
                  }
              }
              nextEntry = zipinput.getNextEntry();
          }
          if (!found || metadata == null) {
              log.error("Plugin not loaded: Found no " + basename + "/plugin.yaml within: " + jar.getAbsolutePath());
          }
          String resdir = null != metadata ? getResourcesBasePath(metadata) : null;
  
          for (String path : paths) {
              if (!topfound && path.startsWith(basename + "/")) {
                  topfound = true;
              }
              if (!dirfound && (path.startsWith(basename + "/contents/") || path.equals(basename + "/contents"))) {
                  dirfound = true;
              }
              if (!resfound
                  && resdir != null
                  && (path.startsWith(basename + "/" + resdir + "/") || path.equals(basename + "/" + resdir))) {
                  resfound = true;
              }
          }
          if (!topfound) {
              log.error("Plugin not loaded: Found no " + basename + "/ dir within file: " + jar.getAbsolutePath());
          }
          if (!dirfound && !resfound) {
              log.error("Plugin not loaded: Found no " +
                        basename +
                        "/contents or " +
                        basename +
                        "/" + resdir + " dir within: " +
                        jar.getAbsolutePath());
          }
          if (found && (dirfound || resfound)) {
              return metadata;
          }
          return null;
      }