@@ -1266,7 +1266,7 @@ protected String validateConfigurationValue(final String name, String value, fin
12661266
12671267 if (UnmanagedVMsManager .ThreadsOnMSToDownloadVMwareVMFiles .key ().equalsIgnoreCase (name )) {
12681268 if (val > 10 ) {
1269- throw new InvalidParameterValueException ("Please enter a value less than 10 for the configuration parameter:" + name );
1269+ throw new InvalidParameterValueException ("Please enter a value less than or equals to 10 for the configuration parameter:" + name );
12701270 }
12711271 }
12721272
@@ -1276,32 +1276,25 @@ protected String validateConfigurationValue(final String name, String value, fin
12761276 }
12771277 }
12781278
1279- if (type .equals (Integer .class ) && configValuesForValidation .contains (name )) {
1280- try {
1281- final int val = Integer .parseInt (value );
1282- if (val <= 0 ) {
1283- throw new InvalidParameterValueException ("Please enter a positive value for the configuration parameter:" + name );
1284- }
1285- if ("vm.password.length" .equalsIgnoreCase (name ) && val < 6 ) {
1286- throw new InvalidParameterValueException ("Please enter a value greater than 5 for the configuration parameter:" + name );
1287- }
1288- if ("remote.access.vpn.psk.length" .equalsIgnoreCase (name )) {
1289- if (val < 8 ) {
1290- throw new InvalidParameterValueException ("Please enter a value greater than 7 for the configuration parameter:" + name );
1279+ if (configValuesForValidation .contains (name )) {
1280+ if (val <= 0 ) {
1281+ throw new InvalidParameterValueException ("Please enter a positive value for the configuration parameter:" + name );
12911282 }
1292- if (val > 256 ) {
1293- throw new InvalidParameterValueException ("Please enter a value less than 257 for the configuration parameter:" + name );
1283+ if ("vm.password.length" . equalsIgnoreCase ( name ) && val < 6 ) {
1284+ throw new InvalidParameterValueException ("Please enter a value greater than 5 for the configuration parameter:" + name );
12941285 }
1295- }
1296- if (VM_USERDATA_MAX_LENGTH_STRING .equalsIgnoreCase (name )) {
1297- if (val > 1048576 ) {
1298- throw new InvalidParameterValueException ("Please enter a value less than 1048576 for the configuration parameter:" + name );
1286+ if ("remote.access.vpn.psk.length" .equalsIgnoreCase (name )) {
1287+ if (val < 8 ) {
1288+ throw new InvalidParameterValueException ("Please enter a value greater than 7 for the configuration parameter:" + name );
1289+ }
1290+ if (val > 256 ) {
1291+ throw new InvalidParameterValueException ("Please enter a value less than 257 for the configuration parameter:" + name );
1292+ }
12991293 }
1300- }
1301-
1302- if (UnmanagedVMsManager .ThreadsOnKVMHostToTransferVMwareVMFiles .key ().equalsIgnoreCase (name )) {
1303- if (val >= 100 ) {
1304- throw new InvalidParameterValueException ("Please enter a value less than 100 for the configuration parameter:" + name );
1294+ if (UserDataManager .VM_USERDATA_MAX_LENGTH_STRING .equalsIgnoreCase (name )) {
1295+ if (val > 1048576 ) {
1296+ throw new InvalidParameterValueException ("Please enter a value less than 1048576 for the configuration parameter:" + name );
1297+ }
13051298 }
13061299 }
13071300 } catch (final NumberFormatException e ) {
0 commit comments