X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=applications%2Fcommon%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpdp%2Fxacml%2Fapplication%2Fcommon%2FXacmlPolicyUtils.java;h=6f2a9f0e5c5bcb89f5d24bdc1fcd01b8e3dc8223;hb=0ae998fcb08390a0d4a2dd2b98116be280c299d5;hp=2a5f21f031326e2d03f90832360c3746059b11f9;hpb=432cec9fa6f143dad324cd11f62fb052c7da32b7;p=policy%2Fxacml-pdp.git diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtils.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtils.java index 2a5f21f0..6f2a9f0e 100644 --- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtils.java +++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtils.java @@ -52,6 +52,9 @@ import org.slf4j.LoggerFactory; public class XacmlPolicyUtils { private static final Logger LOGGER = LoggerFactory.getLogger(XacmlPolicyUtils.class); + + public static final String XACML_PROPERTY_FILE = "xacml.properties"; + private static final String DOT_FILE_SUFFIX = ".file"; private static final String NOT_FOUND_MESSAGE = "NOT FOUND"; @@ -367,14 +370,14 @@ public class XacmlPolicyUtils { * @throws IOException If unable to read file */ public static Properties loadXacmlProperties(Path propertyPath) throws IOException { - LOGGER.debug("Loading xacml properties {}", propertyPath); + LOGGER.info("Loading xacml properties {}", propertyPath); try (InputStream is = Files.newInputStream(propertyPath)) { Properties properties = new Properties(); properties.load(is); - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Loaded xacml properties {} {}", System.lineSeparator(), properties); + if (LOGGER.isInfoEnabled()) { + LOGGER.info("Loaded xacml properties {} {}", System.lineSeparator(), properties); for (Entry entrySet : properties.entrySet()) { - LOGGER.debug("{} -> {}", entrySet.getKey(), entrySet.getValue()); + LOGGER.info("{} -> {}", entrySet.getKey(), entrySet.getValue()); } } return properties; @@ -387,8 +390,8 @@ public class XacmlPolicyUtils { * @throws IOException If unable to store the file. */ public static void storeXacmlProperties(Properties properties, Path propertyPath) throws IOException { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("Storing xacml properties {} {} {}", properties, System.lineSeparator(), propertyPath); + if (LOGGER.isInfoEnabled()) { + LOGGER.info("Storing xacml properties {} {} {}", properties, System.lineSeparator(), propertyPath); } try (OutputStream os = Files.newOutputStream(propertyPath)) { String strComments = "#"; @@ -403,7 +406,7 @@ public class XacmlPolicyUtils { * @return Path to rootPath/xacml.properties file */ public static Path getPropertiesPath(Path rootPath) { - return Paths.get(rootPath.toAbsolutePath().toString(), "xacml.properties"); + return Paths.get(rootPath.toAbsolutePath().toString(), XACML_PROPERTY_FILE); } @FunctionalInterface @@ -434,7 +437,7 @@ public class XacmlPolicyUtils { // // Now we create a new xacml.properties in the temporary folder location // - File propertiesFile = creator.createAFile("xacml.properties"); + File propertiesFile = creator.createAFile(XACML_PROPERTY_FILE); // // Iterate through any root policies defined // @@ -443,7 +446,7 @@ public class XacmlPolicyUtils { // Get a file // Path rootPath = Paths.get(properties.getProperty(root + DOT_FILE_SUFFIX)); - LOGGER.debug("Root file {} {}", rootPath, rootPath.getFileName()); + LOGGER.info("Root file {} {}", rootPath, rootPath.getFileName()); // // Construct new path for the root policy // @@ -466,7 +469,7 @@ public class XacmlPolicyUtils { // Get a file // Path refPath = Paths.get(properties.getProperty(referenced + DOT_FILE_SUFFIX)); - LOGGER.debug("Referenced file {} {}", refPath, refPath.getFileName()); + LOGGER.info("Referenced file {} {}", refPath, refPath.getFileName()); // // Construct new path for the root policy //