private static Resource getScriptResource()

in src/main/java/org/apache/sling/scripting/sightly/engine/ResourceResolution.java [187:202]


    private static Resource getScriptResource(@NotNull ResourceResolver resourceResolver, @NotNull String path) {
        if (path.startsWith("/")) {
            return resourceResolver.getResource(path);
        } else {
            for (String searchPath : resourceResolver.getSearchPath()) {
                String resourcePath = ResourceUtil.normalize(searchPath + path);
                if (resourcePath != null) {
                    Resource resource = resourceResolver.getResource(resourcePath);
                    if (resource != null) {
                        return resource;
                    }
                }
            }
        }
        return null;
    }