config-caf/src/main/java/com/hpe/caf/api/CafConfigurationSource.java
private <T> T getConfig(final Class<T> configClass)
        throws ConfigurationException
    {
        Iterator<Name> it = getServicePath().descendingPathIterator();
        while (it.hasNext()) {
            try (InputStream in = getConfigurationStream(configClass, it.next())) {
                return decoder.deserialise(in, configClass);
            } catch (final ConfigurationException e) {
                LOG.trace("No configuration at this path level", e);
            } catch (final CodecException | IOException e) {
                incrementErrors();
                throw new ConfigurationException("Failed to get configuration for " + configClass.getSimpleName(), e);
            }
        }
        incrementErrors();
        throw new ConfigurationException("No configuration found for " + configClass.getSimpleName());
    }
private <T> T getConfig(final Class<T> configClass)
        throws ConfigurationException
    {
        Iterator<Name> it = getServicePath().descendingPathIterator();
        while (it.hasNext()) {
            try (InputStream in = getConfigurationStream(configClass, it.next())) {
                return decoder.deserialise(in, configClass);
            } catch (final ConfigurationException e) {
                LOG.trace("No configuration at this path level", e);
            } catch (final CodecException | IOException e) {
                incrementErrors();
                throw new ConfigurationException("Failed to get configuration for " + configClass.getSimpleName(), e);
            }
        }
        incrementErrors();
        throw new ConfigurationException("No configuration found for " + configClass.getSimpleName());
    }
private < T > T getConfig ( final Class < T > configClass ) throws ConfigurationException { Iterator < Name > it = getServicePath ( ) . descendingPathIterator ( ) ; while ( it . hasNext ( ) ) { try ( InputStream in = getConfigurationStream ( configClass , it . next ( ) ) ) { return decoder . deserialise ( in , configClass ) ; } catch ( final ConfigurationException e ) { LOG . trace ( "No configuration at this path level" , e ) ; } catch ( final CodecException | IOException e ) { incrementErrors ( ) ; throw new ConfigurationException ( "Failed to get configuration for " + configClass . getSimpleName ( ) , e ) ; } } incrementErrors ( ) ; throw new ConfigurationException ( "No configuration found for " + configClass . getSimpleName ( ) ) ; }
Acquire, decode and decrypt a configuration object from a data stream.

@param configClass the class representing configuration to acquire
@param <T> the class representing configuration to acquire
@return the decoded configuration object
@throws ConfigurationException if the configuration cannot be acquired
Acquire decode and decrypt a configuration object from a data stream .