Code example for ResourcePropertySource

Methods: getProperty

     * This enables overriding the env-${envTarget}.properties location, which is by default resolved internally from the classpath. The entire purpose of overriding this specific properties file is to be able to control 
     * the active Spring profile without defining system wide variables on the OS that runs staging 
    private final String getTargetFromOverride() {
        try { 
            final ResourcePropertySource overrideProperties = new ResourcePropertySource("file:///opt/override/");
            return (String) overrideProperties.getProperty(ENV_TARGET);
        } catch (final IOException e) {
            logger.trace("The file is not accessible. No property overridden by external properties"); 
        return null;