try( InputStream asStream = getResource( configType.primaryType(), resourceName ) )
try( InputStream asStream = getResource( configType.primaryType(), resourceName ) )
private <V> V tryLoadPropertiesFile( UnitOfWork buildUow, EntityDescriptor configType, Identity identity ) throws InstantiationException { @SuppressWarnings( "unchecked" ) EntityBuilder<V> configBuilder = buildUow.newEntityBuilder( (Class<V>) configType.primaryType(), identity ); String resourceName = identity + ".properties"; try( InputStream asStream = getResource( configType.primaryType(), resourceName ) ) { if( asStream != null ) { try { PropertyMapper.map( asStream, (Composite) configBuilder.instance() ); return configBuilder.newInstance(); } catch( IOException e1 ) { InstantiationException exception = new InstantiationException( "Could not read underlying Properties file." ); exception.initCause( e1 ); throw exception; } } return null; } catch( IOException ignored ) { return null; } }
private <V> V tryLoadPropertiesFile( UnitOfWork buildUow, EntityDescriptor configType, Identity identity ) throws InstantiationException { @SuppressWarnings( "unchecked" ) EntityBuilder<V> configBuilder = buildUow.newEntityBuilder( (Class<V>) configType.primaryType(), identity ); String resourceName = identity + ".properties"; try( InputStream asStream = getResource( configType.primaryType(), resourceName ) ) { if( asStream != null ) { try { PropertyMapper.map( asStream, (Composite) configBuilder.instance() ); return configBuilder.newInstance(); } catch( IOException e1 ) { InstantiationException exception = new InstantiationException( "Could not read underlying Properties file." ); exception.initCause( e1 ); throw exception; } } return null; } catch( IOException ignored ) { return null; } }