Simplify the user management
[clamp.git] / src / main / java / org / onap / clamp / clds / config / CldsUserJsonDecoder.java
index 8af1286..626227e 100644 (file)
@@ -5,6 +5,8 @@
  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
  *                             reserved.
  * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -31,11 +33,14 @@ import java.nio.charset.StandardCharsets;
 
 import org.apache.commons.io.IOUtils;
 import org.onap.clamp.clds.exception.CldsUsersException;
-import org.onap.clamp.clds.service.CldsUser;
+import org.onap.clamp.authorization.CldsUser;
 import org.onap.clamp.clds.util.JsonUtils;
 
 public class CldsUserJsonDecoder {
 
+    private CldsUserJsonDecoder() {
+    }
+
     /**
      * This method decodes the JSON file provided to a CldsUser Array. The stream is
      * closed after this call, this is not possible to reuse it.
@@ -53,6 +58,12 @@ public class CldsUserJsonDecoder {
         }
     }
 
+    /**
+     * This method decodes the JSON string to a CldsUser Array.
+     *
+     * @param cldsUsersString JSON string
+     * @return CldsUser[] Array containing a list of the user defined in the JSON
+     */
     public static CldsUser[] decodeJson(String cldsUsersString) {
         try {
             // the ObjectMapper readValue method closes the stream no need to do
@@ -62,7 +73,4 @@ public class CldsUserJsonDecoder {
             throw new CldsUsersException("Exception occurred during the decoding of the clds-users.json", e);
         }
     }
-
-    private CldsUserJsonDecoder() {
-    }
 }