X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sparkybe-onap-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fsparky%2Fsecurity%2Ffilter%2FCspCookieFilter.java;fp=sparkybe-onap-service%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fsparky%2Fsecurity%2Ffilter%2FCspCookieFilter.java;h=94d9013aafa021bb7932c8178aa4deb5844e0687;hb=41921e717d71352d3c623d137875d37b64460774;hp=0f58e09d2255884f14c8c5ad08e640ddd1c23ec7;hpb=28fd048dcd052449ac2f8da76ccb9255f33fa387;p=aai%2Fsparky-be.git 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(",")); + } } /**