/** * Opens the stream to the resource. * * @param resource the resource whose stream is requested. * @return the stream to the resource or <code>null</code> if the resource * cannot be found on the class path. If a stream is returned, the * client is responsible to close that stream. */ public InputStream getResourceAsStream(final String resource) { final URL url = getResource(resource); if (url != null) { try { return url.openStream(); } catch (final IOException e) { // return null; } } return null; }
final URL resourcePathUrl = context.getResource(resourcePath); if (resourcePathUrl == null)