File tree Expand file tree Collapse file tree
apim-adapter/src/main/java/com/axway/apim/lib
apis/src/main/java/com/axway/apim/apiimport/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,15 @@ public enum Mode {
2424 replace ,
2525 ignore ,
2626 add ;
27+
28+ public static Mode valueOfDefault (String key ) {
29+ for (Mode e : values ()) {
30+ if (e .name ().equals (key )) {
31+ return e ;
32+ }
33+ }
34+ return Mode .add ;
35+ }
2736 }
2837
2938 public static String APIM_CLI_HOME = "AXWAY_APIM_CLI_HOME" ;
Original file line number Diff line number Diff line change @@ -110,9 +110,9 @@ public APIImportParams getAPIImportParams() throws AppException {
110110 if (getValue ("replaceHostInSwagger" )!=null ) params .setReplaceHostInSwagger (Boolean .parseBoolean (getValue ("replaceHostInSwagger" )));
111111 params .setUseFEAPIDefinition (hasOption ("useFEAPIDefinition" ));
112112 params .setIgnoreQuotas (hasOption ("ignoreQuotas" ));
113- params .setClientOrgsMode (Mode .valueOf (getValue ("clientOrgsMode" )));
114- params .setClientAppsMode (Mode .valueOf (getValue ("clientAppsMode" )));
115- params .setQuotaMode (Mode .valueOf (getValue ("quotaMode" )));
113+ params .setClientOrgsMode (Mode .valueOfDefault (getValue ("clientOrgsMode" )));
114+ params .setClientAppsMode (Mode .valueOfDefault (getValue ("clientAppsMode" )));
115+ params .setQuotaMode (Mode .valueOfDefault (getValue ("quotaMode" )));
116116 params .setDetailsExportFile (getValue ("detailsExportFile" ));
117117 if (getValue ("allowOrgAdminsToPublish" )!=null ) params .setAllowOrgAdminsToPublish (Boolean .parseBoolean (getValue ("allowOrgAdminsToPublish" )));
118118 return params ;
You can’t perform that action at this time.
0 commit comments