diff options
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java')
-rw-r--r-- | mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/InfraUtils.java | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/InfraUtils.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/InfraUtils.java index 37cbb4de66..7088a33b16 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/InfraUtils.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/InfraUtils.java @@ -22,6 +22,8 @@ package org.openecomp.mso.apihandlerinfra; +import java.util.Arrays; + import org.openecomp.mso.properties.MsoJavaProperties; public class InfraUtils { @@ -29,27 +31,12 @@ public class InfraUtils { // Check for allowable actions String actionsPropertyName = requestType + "." + version + ".ApiAllowableActions"; String allowableActions = props.getProperty(actionsPropertyName, null); - boolean actionAllowed = false; - if (allowableActions != null) { - String allowableActionsList[] = allowableActions.split(","); - for (int i=0; i<allowableActionsList.length; i++) { - if (action.equals (allowableActionsList[i])) { - actionAllowed = true; - break; - } - } - } - else { - actionAllowed = true; - } - return actionAllowed; + return allowableActions == null || Arrays.asList(allowableActions.split(",")).contains(action); } // Checks if the name is acceptable for heat stack public static boolean isValidHeatName(String name) { - if (name.matches("^[a-zA-Z][a-zA-Z0-9_\\.-]*$")) - return true; - return false; + return name.matches("^[a-zA-Z][a-zA-Z0-9_\\.-]*$"); } |