private void discoverResources()

in atomos.substrate.config/src/main/java/org/apache/felix/atomos/substrate/config/ResourceConfig.java [119:181]


    private void discoverResources(Set<String> allResourceBundles,
        Set<String> allResourcePatterns, Set<String> allResourcePackages)
    {
        for (Bundle b : context.getBundles())
        {
            if (b.equals(context.getBundle()))
            {
                continue;
            }
            pattern: for (String p : getPaths(b))
            {
                if (p.endsWith("/"))
                {
                    continue;
                }
                if (p.indexOf('/') == -1)
                {
                    continue;
                }
                if (p.startsWith(SERVICES))
                {
                    allResourcePatterns.add(p);
                    continue;
                }
                for (String excluded : EXCLUDE_NAMES)
                {
                    if (p.endsWith(excluded))
                    {
                        continue pattern;
                    }
                }
                for (String excluded : EXCLUDE_DIRS)
                {
                    if (p.startsWith(excluded))
                    {
                        continue pattern;
                    }
                }
                if (p.endsWith(CLASS_SUFFIX))
                {
                    // just looking for resource bundle for french as an indicator
                    if (p.endsWith(FRENCH_BUNDLE_CLASS))
                    {
                        String bundleName = p.substring(0,
                            p.length() - FRENCH_BUNDLE_CLASS.length()).replace('/', '.');
                        String bundlePackage = bundleName.substring(0,
                            bundleName.lastIndexOf('.'));
                        allResourceBundles.add(bundleName);
                        allResourcePackages.add(bundlePackage);
                    }
                    continue;
                }
                if (p.endsWith(FRENCH_BUNDLE_PROPS))
                {
                    allResourceBundles.add(
                        p.substring(0, p.length() - FRENCH_BUNDLE_PROPS.length()).replace(
                            '/', '.'));
                    continue;
                }
                allResourcePatterns.add(p);
            }
        }
    }