bump poms to 2.1.4-SNAPSHOT
[policy/xacml-pdp.git] / applications / common / src / main / java / org / onap / policy / pdp / xacml / application / common / XacmlPolicyUtils.java
index 2a5f21f..6f2a9f0 100644 (file)
@@ -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<Object, Object> 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
                 //