public void indexURLs()

in connectfeaturelauncher/src/main/java/org/apache/sling/feature/launcher/extensions/connect/impl/PojoSRLauncher.java [198:247]


        public void indexURLs()
        {
            if (init.compareAndSet(false, true))
            {
                for (URL url : super.getURLs())
                {
                    try (JarFile jar = IOUtils.getJarFileFromURL(url, true, null))
                    {
                        for (Enumeration<JarEntry> entries = jar.entries(); entries.hasMoreElements(); )
                        {
                            JarEntry entry = entries.nextElement();
                            String[] paths;
                            if (entry.isDirectory())
                            {
                                paths = new String[]{entry.getName(), entry.getName().substring(0, entry.getName().length() - 1),
                                    "/" + entry.getName(), "/" + entry.getName().substring(0, entry.getName().length() - 1)};
                            }
                            else
                            {
                                paths = new String[]{entry.getName(), "/" + entry.getName()};
                            }

                            for (String path : paths)
                            {
                                resourcesIDX.compute(path, (key, value) ->
                                {
                                    if (value == null)
                                    {
                                        value = new ArrayList<>();
                                    }
                                    try
                                    {
                                        value.add(getJarFileURL(url, entry));
                                    }
                                    catch (Exception e)
                                    {
                                        e.printStackTrace();
                                    }
                                    return value;
                                });
                            }
                        }
                    }
                    catch (IOException e)
                    {
                        e.printStackTrace();
                    }
                }
            }
        }