private URL loadResource(String configurationResourceName) { URL url = ConfigHelper.locateConfig( configurationResourceName ); if (log.isDebugEnabled()) { log.debug("Creating EhCacheProvider from a specified resource: " + configurationResourceName + " Resolved to URL: " + url); } return url; }
/** Open an InputStream to the URL represented by the incoming path. First makes a call * to {@link #locateConfig(java.lang.String)} in order to find an appropriate URL. * {@link java.net.URL#openStream()} is then called to obtain the stream. * * @param path The path representing the config location. * @return An input stream to the requested config resource. * @throws HibernateException Unable to open stream to that resource. */ public static final InputStream getConfigStream(final String path) throws HibernateException { final URL url = ConfigHelper.locateConfig(path); if (url == null) { String msg = "Unable to locate config file: " + path; log.fatal(msg); throw new HibernateException(msg); } try { return url.openStream(); } catch(IOException e) { throw new HibernateException("Unable to open config file: " + path, e); } }
/** Open an InputStream to the URL represented by the incoming path. First makes a call * to {@link #locateConfig(java.lang.String)} in order to find an appropriate URL. * {@link java.net.URL#openStream()} is then called to obtain the stream. * * @param path The path representing the config location. * @return An input stream to the requested config resource. * @throws HibernateException Unable to open stream to that resource. */ public static final InputStream getConfigStream(final String path) throws HibernateException { final URL url = ConfigHelper.locateConfig(path); if (url == null) { String msg = "Unable to locate config file: " + path; log.fatal(msg); throw new HibernateException(msg); } try { return url.openStream(); } catch(IOException e) { throw new HibernateException("Unable to open config file: " + path, e); } }