Skip to content

Instantly share code, notes, and snippets.

@giraldeau
Created January 6, 2016 21:00
Show Gist options
  • Save giraldeau/b0f32ae1ab31a0a23ff3 to your computer and use it in GitHub Desktop.
Save giraldeau/b0f32ae1ab31a0a23ff3 to your computer and use it in GitHub Desktop.
@Test
public void readBundleResource() throws IOException {
Bundle bundle = CTestPlugin.getDefault().getBundle();
URL entry = bundle.getEntry("resources/elf/build.log");
URL resource = bundle.getResource("resources/elf/build.log");
System.out.println(entry);
System.out.println(resource);
try (InputStream s1 = entry.openStream()) {
BufferedReader reader = new BufferedReader(new InputStreamReader(s1));
System.out.println("build first line:" + reader.readLine());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment