aboutsummaryrefslogtreecommitdiffstats
path: root/PolicyEngineUtils/src/main
diff options
context:
space:
mode:
authorrb7147 <rb7147@att.com>2018-02-01 12:07:13 -0500
committerrb7147 <rb7147@att.com>2018-02-01 13:50:11 -0500
commit1148834bc4b10d00c1b1830b087357e63af8293f (patch)
treef3a6d166f8a86c8b2b0a9bc1b062f9fc87cd3d58 /PolicyEngineUtils/src/main
parent066fc4529f36d210a4a4700e8dbfd2cb42f4dc66 (diff)
Included Policy GUI Enhancements and validations
Added hover messages for all policy templates. Resolved few sonar issues. Added fixes for Policy GUI Validations. Issue-ID: POLICY-597 Change-Id: I74abb92dd6ac8722d7869b6a316fad1d8db11d9c Signed-off-by: rb7147 <rb7147@att.com>
Diffstat (limited to 'PolicyEngineUtils/src/main')
-rw-r--r--PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java b/PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java
index fa23f4a31..c058a7997 100644
--- a/PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java
+++ b/PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java
@@ -53,12 +53,12 @@ import com.google.gson.JsonSyntaxException;
public class PolicyUtils {
private static final Logger LOGGER = FlexLogger.getLogger(PolicyUtils.class);
-
+ public static final String CATCH_EXCEPTION = "PE500: An exception was caught.";
public static final String EMAIL_PATTERN =
"^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
private static final String PACKAGE_ERROR = "mismatched input '{' expecting one of the following tokens: '[package";
- private static final String SUCCESS = "success";
+ public static final String SUCCESS = "success";
private PolicyUtils(){
// Private Constructor
@@ -276,6 +276,9 @@ public class PolicyUtils {
* @return
*/
public static boolean isXMLValid(String data) {
+ if(data == null || data.isEmpty()){
+ return false;
+ }
SAXParserFactory factory = SAXParserFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);