@Override @Nonnull protected String filter (final @Nonnull Matcher matcher) { final ResourcePath relativePath = new ResourcePath(matcher.group(1)).prependedWith("media"); return siteProvider.get().getSite().createLink(relativePath); } }
/******************************************************************************************************************* * ******************************************************************************************************************/ @Test(dataProvider = "appendPrependProvider", dependsOnMethods = "must_properly_compute_asString") public void must_properly_prepend_string (final @Nonnull String pathAsString, final @Nonnull String secondPathAsString, final @Nonnull String expectedAppendedPathAsString, final @Nonnull String expectedPrependedPathAsString) { final ResourcePath underTest = new ResourcePath(pathAsString); assertThat(underTest.prependedWith(secondPathAsString).asString(), is(expectedPrependedPathAsString)); }
/******************************************************************************************************************* * ******************************************************************************************************************/ @Test(dataProvider = "appendPrependProvider", dependsOnMethods = "must_properly_compute_asString") public void must_properly_prepend_path (final @Nonnull String pathAsString, final @Nonnull String secondPathAsString, final @Nonnull String expectedAppendedPathAsString, final @Nonnull String expectedPrependedPathAsString) { final ResourcePath underTest = new ResourcePath(pathAsString); final ResourcePath prependingPath = new ResourcePath(secondPathAsString); assertThat(underTest.prependedWith(prependingPath).asString(), is(expectedPrependedPathAsString)); }
.appendedWith("" + size) .appendedWith("image." + extension); mediaUri = mediaUri.prependedWith(uriPrefix); final String redirect = mediaUri.asString(); log.info(">>>> permanently redirecting to {}", redirect);