ResourceUtils { public String getResourceAsString(String url) { try { return Streams.readFullyStringAndClose(getResourceFromUrl(url)); } catch (Exception e) { log.debug("ResourceUtils got error reading "+url+(context==null?"":" "+context)+" (rethrowing): "+e); throw Throwables.propagate(e); } } ResourceUtils(ClassLoader loader, Object contextObject, String contextMessage);  ResourceUtils(BrooklynClassLoadingContext loader, Object contextObject, String contextMessage);  ResourceUtils(Object contextObject, String contextMessage);  ResourceUtils(Object contextObject); static final ResourceUtils create(ClassLoader loader, Object contextObject, String contextMessage); static final ResourceUtils create(BrooklynClassLoadingContext loader, Object contextObject, String contextMessage); static final ResourceUtils create(Object contextObject, String contextMessage); static final ResourceUtils create(Object contextObject); static final ResourceUtils create(); static void addClassLoaderProvider(Function<Object,BrooklynClassLoadingContext> provider); Iterable<URL> getResources(String name); InputStream getResourceFromUrl(String url,
            @Nullable org.apache.brooklyn.util.http.auth.Credentials credentials); InputStream getResourceFromUrl(String url); static URL tidy(URL url); static String tidyFileUrl(String url); String getResourceAsString(String url); String checkUrlExists(String url); String checkUrlExists(String url, String message); boolean doesUrlExist(String url); Optional<String> firstAvailableUrl(String ...urls); String getClassLoaderDir(); String getClassLoaderDir(String resourceInThatDir); static URL getContainerUrl(URL url, String resourceInThatDir);  }
@Test public void testDataUrl() throws Exception { assertEquals(utils.getResourceAsString("data:,hello"), "hello"); assertEquals(utils.getResourceAsString("data:,hello%20world"), "hello world"); assertEquals(utils.getResourceAsString("data:hello"), "hello"); assertEquals(utils.getResourceAsString("data: assertEquals(utils.getResourceAsString("data:hello world"), "hello world"); assertEquals(utils.getResourceAsString(Urls.asDataUrlBase64("hello world")), "hello world"); String longString = Identifiers.makeRandomId(256); for (int a=32; a<128; a++) longString += (char)a; assertEquals(utils.getResourceAsString(Urls.asDataUrlBase64(longString)), longString); }