private void addByPath()

in src/main/java/org/apache/sling/servlets/resolver/internal/resource/ServletResourceProviderFactory.java [217:239]


    private void addByPath(Set<String> pathSet, ServiceReference<Servlet> ref) {
        String[] paths = Converters.standardConverter()
                .convert(ref.getProperty(SLING_SERVLET_PATHS))
                .to(String[].class);
        for (String path : paths) {
            if (!path.startsWith("/")) {
                path = getPrefix(ref).concat(path);
            }

            // add the unmodified path
            pathSet.add(path);

            String[] types = Converters.standardConverter()
                    .convert(ref.getProperty(SLING_SERVLET_RESOURCE_TYPES))
                    .to(String[].class);
            final String ext = FilenameUtils.getExtension(path);
            if ((types.length == 0) || ext == null || ext.isEmpty()) {
                // ensure we have another entry which has the .servlet ext. if there wasn't one to begin with
                // Radu says: this will make sure that scripts are equal to servlets in the resolution process
                pathSet.add(ensureServletNameExtension(path));
            }
        }
    }