docs: @SuppressFBWarnings(value = "DMI_COLLECTION_OF_URLS", justification = "Plugin loading happens only once on Jenkins startup")
      protected @Nonnull Set<String> loadPluginsFromWar(@Nonnull String fromPath, @CheckForNull FilenameFilter filter) {
          Set<String> names = new HashSet();
  
          ServletContext context = Jenkins.getActiveInstance().servletContext;
          Set<String> plugins = Util.fixNull((Set<String>) context.getResourcePaths(fromPath));
          Set<URL> copiedPlugins = new HashSet<>();
          Set<URL> dependencies = new HashSet<>();
  
          for( String pluginPath : plugins) {
              String fileName = pluginPath.substring(pluginPath.lastIndexOf('/')+1);
              if(fileName.length()==0) {
                  // see http://www.nabble.com/404-Not-Found-error-when-clicking-on-help-td24508544.html
                  // I suspect some containers are returning directory names.
                  continue;
              }
              try {
                  URL url = context.getResource(pluginPath);
                  if (filter != null && url != null) {
                      if (!filter.accept(new File(url.getFile()).getParentFile(), fileName)) {
                          continue;
                      }
                  }
  
                  names.add(fileName);
                  copyBundledPlugin(url, fileName);
                  copiedPlugins.add(url);
                  try {
                      addDependencies(url, fromPath, dependencies);
                  } catch (Exception e) {
                      LOGGER.log(Level.SEVERE, "Failed to resolve dependencies for the bundled plugin " + fileName, e);
                  }
              } catch (IOException e) {
                  LOGGER.log(Level.SEVERE, "Failed to extract the bundled plugin "+fileName,e);
              }
          }
  
          // Copy dependencies. These are not detached plugins, but are required by them.
          for (URL dependency : dependencies) {
              if (copiedPlugins.contains(dependency)) {
                  // Ignore. Already copied.
                  continue;
              }
  
              String fileName = new File(dependency.getFile()).getName();
              try {
                  names.add(fileName);
                  copyBundledPlugin(dependency, fileName);
                  copiedPlugins.add(dependency);
              } catch (IOException e) {
                  LOGGER.log(Level.SEVERE, "Failed to extract the bundled dependency plugin " + fileName, e);
              }
          }
  
          return names;
      }