ResourceLocator implements Locator<ResourceLocation> { @Override public InputStream openInputStream(ResourceLocation location) { return ResourceLocator.class.getResourceAsStream(location.getPath()); }  @Override File locate(ResourceLocation location); @Override File copyToDirectory(ResourceLocation location, File toDir); @Override InputStream openInputStream(ResourceLocation location); @Override File copyToFile(ResourceLocation location, File toFile);  }
@Test public void openInputStream() throws Exception { ResourceLocation location = ResourceLocation.create("/com/sonar/orchestrator/locator/ResourceLocatorTest/foo.txt"); InputStream input = resourceLocator.openInputStream(location); assertThat(IOUtils.toString(input)).isEqualTo("foo"); }