Created
June 23, 2017 21:01
-
-
Save davidjgonzalez/38550e36e66be3c234c6944fabf67d8f to your computer and use it in GitHub Desktop.
SlingContextBuilder with Mapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SlingContextBuilder slingContextBuilder = new SlingContextBuilder(ResourceResolverType.RESOURCERESOLVER_MOCK); | |
SlingContext context = slingContextBuilder.resourceResolverFactoryActivatorProps(ImmutableMap.<String, Object>builder() | |
.put("resource.resolver.mapping", new String[]{"/:/", "/content/test/</"}) | |
.build()) | |
.resourceResolverType(ResourceResolverType.RESOURCERESOLVER_MOCK) | |
.build(); | |
context.create().resource("/content/test/simple", "sling:vanityPath", "/my-vanity"); | |
log.debug(context.resourceResolver().map("/content/test/foo")); // --> LOGS..... /content/test/foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment