}
String fixedUri = uriStr.replace('\\', '/');
fixedUri = fixedUri.replace(" ", "%20");
+ fixedUri = fixedUri.replace("{", "%7B");
+ fixedUri = fixedUri.replace("}", "%7D");
URI baseURI = new URI(fixedUri);
return baseURI;
}
assertNull(InternalResourceResolver.cleanURI(null));
}
+ @Test
+ public void testCurlyBrackets() throws Exception {
+ assertEquals(InternalResourceResolver.cleanURI("{test}.jpg"), new URI("%7Btest%7D.jpg"));
+ }
+
private void test(String uriStr, URI uri, URI expected) throws IOException, URISyntaxException {
ResourceResolver resolver = mock(ResourceResolver.class);
InternalResourceResolver sut = new InternalResourceResolver(base, resolver);