public InputStream openResource(String resource) throws IOException {final InputStream stream = (clazz != null) ?clazz.getResourceAsStream(resource) :loader.getResourceAsStream(resource);if (stream == null)throw new IOException("Resource not found: " + resource);return stream;}