diff options
Diffstat (limited to 'sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java')
-rw-r--r-- | sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java index 0f58e09..94d9013 100644 --- a/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java +++ b/sparkybe-onap-service/src/main/java/org/onap/aai/sparky/security/filter/CspCookieFilter.java @@ -140,14 +140,16 @@ public class CspCookieFilter implements Filter { * @throws IOException if the properties failed to load. */ private void setConfigurationProperties(FilterConfig filterConfig) throws IOException { - InputStream inputStream = new FileInputStream(SparkyConstants.CONFIG_HOME - + filterConfig.getInitParameter(FILTER_PARAMETER_CONFIG)); - Properties cspProperties = new Properties(); - cspProperties.load(inputStream); - globalLoginUrl = cspProperties.getProperty(PROPERTY_GLOBAL_LOGIN_URL); - applicationId = cspProperties.getProperty(PROPERTY_APPLICATION_ID); - gateKeeperEnvironment = cspProperties.getProperty(PROPERTY_GATEKEEPER_ENVIRONMENT); - redirectDomains = Arrays.asList(cspProperties.getProperty(PROPERTY_REDIRECT_DOMAINS).split(",")); + try (InputStream inputStream = new FileInputStream(SparkyConstants.CONFIG_HOME + + filterConfig.getInitParameter(FILTER_PARAMETER_CONFIG))) { + Properties cspProperties = new Properties(); + cspProperties.load(inputStream); + globalLoginUrl = cspProperties.getProperty(PROPERTY_GLOBAL_LOGIN_URL); + applicationId = cspProperties.getProperty(PROPERTY_APPLICATION_ID); + gateKeeperEnvironment = cspProperties.getProperty(PROPERTY_GATEKEEPER_ENVIRONMENT); + redirectDomains = + Arrays.asList(cspProperties.getProperty(PROPERTY_REDIRECT_DOMAINS).split(",")); + } } /** |