private InputStream resolveInLocalNamespace(String path) { try { return classLoaderService.locateResourceStream( path ); } catch ( Throwable t ) { return null; } }
private Reader getConfigStreamReader(String resource) { return new InputStreamReader( classLoaderService.locateResourceStream( resource ) ); }
private Properties getConfigProperties(String resource) { try { Properties properties = new Properties(); properties.load( classLoaderService.locateResourceStream( resource ) ); return properties; } catch (IOException e) { throw new HibernateException( "Unable to load properties from specified config file: " + resource, e ); } }
public Properties loadProperties(String resourceName) { final InputStream stream = bootstrapServiceRegistry.getService( ClassLoaderService.class ).locateResourceStream( resourceName ); if ( stream == null ) { throw new ConfigurationException( "Unable to apply settings from properties file [" + resourceName + "]" ); } try { Properties properties = new Properties(); properties.load( stream ); return properties; } catch (IOException e) { throw new ConfigurationException( "Unable to apply settings from properties file [" + resourceName + "]", e ); } finally { try { stream.close(); } catch (IOException e) { log.debug( String.format( "Unable to close properties file [%s] stream", resourceName ), e ); } } }
public LoadedConfig loadConfigXmlResource(String cfgXmlResourceName) { final InputStream stream = bootstrapServiceRegistry.getService( ClassLoaderService.class ).locateResourceStream( cfgXmlResourceName ); if ( stream == null ) { throw new ConfigurationException( "Could not locate cfg.xml resource [" + cfgXmlResourceName + "]" ); } try { final JaxbCfgHibernateConfiguration jaxbCfg = jaxbProcessorHolder.getValue().unmarshal( stream, new Origin( SourceType.RESOURCE, cfgXmlResourceName ) ); return LoadedConfig.consume( jaxbCfg ); } finally { try { stream.close(); } catch (IOException e) { log.debug( "Unable to close cfg.xml resource stream", e ); } } }
private InputStream resolveInLocalNamespace(String path) { try { return classLoaderService.locateResourceStream( path ); } catch ( Throwable t ) { return null; } }
private Reader getConfigStreamReader(String resource) { return new InputStreamReader( classLoaderService.locateResourceStream( resource ) ); }
private Properties getConfigProperties(String resource) { try { Properties properties = new Properties(); properties.load( classLoaderService.locateResourceStream( resource ) ); return properties; } catch (IOException e) { throw new HibernateException( "Unable to load properties from specified config file: " + resource, e ); } }
@Override public InputStream locateResourceStream(String name) { InputStream in = hibernateClassLoaderService.locateResourceStream( name ); if ( in == null ) { in = internalClassLoaderService.locateResourceStream( name ); } return in; }
@Override public InputStream locateResourceStream(String name) { InputStream in = hibernateClassLoaderService.locateResourceStream( name ); if ( in == null ) { in = internalClassResolver.locateResourceStream( name ); } return in; }
public Properties loadProperties(String resourceName) { final InputStream stream = bootstrapServiceRegistry.getService( ClassLoaderService.class ).locateResourceStream( resourceName ); if ( stream == null ) { throw new ConfigurationException( "Unable to apply settings from properties file [" + resourceName + "]" ); } try { Properties properties = new Properties(); properties.load( stream ); return properties; } catch (IOException e) { throw new ConfigurationException( "Unable to apply settings from properties file [" + resourceName + "]", e ); } finally { try { stream.close(); } catch (IOException e) { log.debug( String.format( "Unable to close properties file [%s] stream", resourceName ), e ); } } }
public LoadedConfig loadConfigXmlResource(String cfgXmlResourceName) { final InputStream stream = bootstrapServiceRegistry.getService( ClassLoaderService.class ).locateResourceStream( cfgXmlResourceName ); if ( stream == null ) { throw new ConfigurationException( "Could not locate cfg.xml resource [" + cfgXmlResourceName + "]" ); } try { final JaxbCfgHibernateConfiguration jaxbCfg = jaxbProcessorHolder.getValue().unmarshal( stream, new Origin( SourceType.RESOURCE, cfgXmlResourceName ) ); return LoadedConfig.consume( jaxbCfg ); } finally { try { stream.close(); } catch (IOException e) { log.debug( "Unable to close cfg.xml resource stream", e ); } } }