diff options
-rw-r--r-- | certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/AbstractConfigurationFactory.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/AbstractConfigurationFactory.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/AbstractConfigurationFactory.java index 092cd3c3..b72ef7a1 100644 --- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/AbstractConfigurationFactory.java +++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/factory/AbstractConfigurationFactory.java @@ -25,9 +25,7 @@ import org.onap.aaf.certservice.client.configuration.exception.CsrConfigurationE import org.onap.aaf.certservice.client.configuration.model.ConfigurationModel; import java.util.Arrays; -import java.util.HashSet; import java.util.Locale; -import java.util.Set; import java.util.regex.Pattern; public abstract class AbstractConfigurationFactory<T extends ConfigurationModel> { @@ -53,6 +51,10 @@ public abstract class AbstractConfigurationFactory<T extends ConfigurationModel> return Pattern.compile("[~#@*$+%!()?/{}<>\\|_^]").matcher(stringToCheck).find(); } + public boolean isCountryValid(String country) { + return Arrays.asList(Locale.getISOCountries()).contains(country); + } + private boolean isPortNumberPresent(String stringToCheck) { return Pattern.compile(":[0-9]{1,5}").matcher(stringToCheck).find(); } @@ -64,9 +66,4 @@ public abstract class AbstractConfigurationFactory<T extends ConfigurationModel> private boolean isHttpProtocolsPresent(String stringToCheck) { return Pattern.compile("[h][t][t][p][:][/][/]|[h][t][t][p][s][:][/][/]").matcher(stringToCheck).find(); } - - public boolean isCountryValid(String country) { - Set<String> countryNames = new HashSet<>(Arrays.asList(Locale.getISOCountries())); - return countryNames.contains(country); - } } |