X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fauth%2FAAIMicroServiceAuthCore.java;h=0eec7e1a0b45c25e9bc8c5e276281c81244d74c0;hb=13494d99a913817342da23ffc58029bdc4203814;hp=648d9d0a245cf837f0fb979c9587e31d84f873d6;hpb=716e7f240c2f4a71d48e7708aa27194db2dd7f21;p=aai%2Fbabel.git diff --git a/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java b/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java index 648d9d0..0eec7e1 100644 --- a/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java +++ b/src/main/java/org/onap/aai/auth/AAIMicroServiceAuthCore.java @@ -1,9 +1,9 @@ /** - * ============LICENSE_START======================================================= + * ============LICENSE_START======================================================= * org.onap.aai * ================================================================================ - * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. - * Copyright © 2017-2018 European Software Marketing Ltd. + * Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (c) 2017-2019 European Software Marketing Ltd. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.aai.auth; import com.fasterxml.jackson.core.JsonProcessingException; @@ -26,12 +27,14 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.TimeUnit; @@ -43,13 +46,15 @@ public class AAIMicroServiceAuthCore { private static LogHelper applicationLogger = LogHelper.INSTANCE; - public static final String FILESEP = - (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator"); - public static final String APPCONFIG_DIR = (System.getProperty("CONFIG_HOME") == null) - ? System.getProperty("APP_HOME") + FILESEP + "appconfig" : System.getProperty("CONFIG_HOME"); - - private static String appConfigAuthDir = APPCONFIG_DIR + FILESEP + "auth"; - private static String defaultAuthFileName = appConfigAuthDir + FILESEP + "auth_policy.json"; + /** + * The default policy file is expected to be located in either one of + *