@Test public void getRequestPathInfo() { final String expectedResourcePath = "/content/test"; final String expectedSuffix = "/content/my/suffix"; final String expectedExtension = "html"; final String[] expectedSelectors = new String[]{"foo", "bar"}; final String expectedSelectorString = StringUtils.join(expectedSelectors, "."); final Resource expectedSuffixResource = ctx.create().resource(expectedSuffix); final SlingHttpServletRequest request = new AssetRenditionDownloadRequest( ctx.request(), "GET", resource, expectedSelectors, expectedExtension, expectedSuffix); RequestPathInfo actual = request.getRequestPathInfo(); assertEquals(expectedResourcePath, actual.getResourcePath()); assertArrayEquals(expectedSelectors, actual.getSelectors()); assertEquals(expectedSelectorString, actual.getSelectorString()); assertEquals(expectedExtension, actual.getExtension()); assertEquals(expectedSuffix, actual.getSuffix()); assertEquals(expectedSuffixResource.getPath(), actual.getSuffixResource().getPath()); }
@Override public RequestPathInfo getRequestPathInfo() { return new RequestPathInfo() { @Nonnull @Override public String getResourcePath() { return getResource().getPath(); } @CheckForNull @Override public String getExtension() { return extension; } @CheckForNull @Override public String getSelectorString() { return StringUtils.join(selectors, "."); } @Nonnull @Override public String[] getSelectors() { return selectors; } @CheckForNull @Override public String getSuffix() { return suffix; } @CheckForNull @Override public Resource getSuffixResource() { return getResource().getResourceResolver().getResource(getSuffix()); } }; }
AssetRenditionDownloadRequest extends SlingHttpServletRequestWrapper { @Override public RequestPathInfo getRequestPathInfo() { return new RequestPathInfo() { @Nonnull @Override public String getResourcePath() { return getResource().getPath(); } @CheckForNull @Override public String getExtension() { return extension; } @CheckForNull @Override public String getSelectorString() { return StringUtils.join(selectors, "."); } @Nonnull @Override public String[] getSelectors() { return selectors; } @CheckForNull @Override public String getSuffix() { return suffix; } @CheckForNull @Override public Resource getSuffixResource() { return getResource().getResourceResolver().getResource(getSuffix()); } }; } }
AssetRenditionDownloadRequest extends SlingHttpServletRequestWrapper { @Override public RequestPathInfo getRequestPathInfo() { return new RequestPathInfo() { @Nonnull @Override public String getResourcePath() { return getResource().getPath(); } @CheckForNull @Override public String getExtension() { return extension; } @CheckForNull @Override public String getSelectorString() { return StringUtils.join(selectors, "."); } @Nonnull @Override public String[] getSelectors() { return selectors; } @CheckForNull @Override public String getSuffix() { return suffix; } @CheckForNull @Override public Resource getSuffixResource() { return getResource().getResourceResolver().getResource(getSuffix()); } }; } AssetRenditionDownloadRequest(final SlingHttpServletRequest wrappedRequest,
                                         final String method,
                                         final Resource resource,
                                         final String[] selectors,
                                         final String extension,
                                         final String suffix); }
AssetRenditionDownloadRequest extends SlingHttpServletRequestWrapper { @Override public RequestPathInfo getRequestPathInfo() { return new RequestPathInfo() { @Nonnull @Override public String getResourcePath() { return getResource().getPath(); } @CheckForNull @Override public String getExtension() { return extension; } @CheckForNull @Override public String getSelectorString() { return StringUtils.join(selectors, "."); } @Nonnull @Override public String[] getSelectors() { return selectors; } @CheckForNull @Override public String getSuffix() { return suffix; } @CheckForNull @Override public Resource getSuffixResource() { return getResource().getResourceResolver().getResource(getSuffix()); } }; } AssetRenditionDownloadRequest(final SlingHttpServletRequest wrappedRequest,
                                         final String method,
                                         final Resource resource,
                                         final String[] selectors,
                                         final String extension,
                                         final String suffix); @Override Object getAttribute(String name); @Override Resource getResource(); @Override String getMethod(); @Override RequestPathInfo getRequestPathInfo(); }
AssetRenditionDownloadRequest extends SlingHttpServletRequestWrapper { @Override public RequestPathInfo getRequestPathInfo() { return new RequestPathInfo() { @Nonnull @Override public String getResourcePath() { return getResource().getPath(); } @CheckForNull @Override public String getExtension() { return extension; } @CheckForNull @Override public String getSelectorString() { return StringUtils.join(selectors, "."); } @Nonnull @Override public String[] getSelectors() { return selectors; } @CheckForNull @Override public String getSuffix() { return suffix; } @CheckForNull @Override public Resource getSuffixResource() { return getResource().getResourceResolver().getResource(getSuffix()); } }; } AssetRenditionDownloadRequest(final SlingHttpServletRequest wrappedRequest,
                                         final String method,
                                         final Resource resource,
                                         final String[] selectors,
                                         final String extension,
                                         final String suffix); @Override Object getAttribute(String name); @Override Resource getResource(); @Override String getMethod(); @Override RequestPathInfo getRequestPathInfo();  }