/** * 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 InputStream getConfigStream(final String path) throws HibernateException { final URL url = ConfigHelper.locateConfig( path ); if ( url == null ) { String msg = LOG.unableToLocateConfigFile( path ); LOG.error( 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 InputStream getConfigStream(final String path) throws HibernateException { final URL url = ConfigHelper.locateConfig(path); if (url == null) { String msg = LOG.unableToLocateConfigFile(path); LOG.error(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 InputStream getConfigStream(final String path) throws HibernateException { final URL url = ConfigHelper.locateConfig(path); if (url == null) { String msg = LOG.unableToLocateConfigFile(path); LOG.error(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 InputStream getConfigStream(final String path) throws HibernateException { final URL url = ConfigHelper.locateConfig( path ); if ( url == null ) { String msg = LOG.unableToLocateConfigFile( path ); LOG.error( msg ); throw new HibernateException( msg ); } try { return url.openStream(); } catch (IOException e) { throw new HibernateException( "Unable to open config file: " + path, e ); } }