lenientDatetimeFormat
is enabled.
- */
- public static final String LENIENT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZ";
-
- private String basePath = "https://localhost";
- private boolean lenientOnJson = false;
- private boolean debugging = false;
- private MapparseDatetime
.
- this.lenientDatetimeFormat = true;
-
- // Set default User-Agent.
- setUserAgent("Swagger-Codegen/1.0.0/java");
-
- // Setup authentications (key: authentication name, value: authentication).
- authentications = new HashMapdateFormat
supports these ISO 8601 date formats:
- * 2015-08-16
- * 2015-8-16
- * @param str String to be parsed
- * @return Date
- */
- public Date parseDate(String str) {
- if (str == null)
- return null;
- try {
- return dateFormat.parse(str);
- } catch (ParseException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Parse the given datetime string into Date object.
- * When lenientDatetimeFormat is enabled, the following ISO 8601 datetime formats are supported:
- * 2015-08-16T08:20:05Z
- * 2015-8-16T8:20:05Z
- * 2015-08-16T08:20:05+00:00
- * 2015-08-16T08:20:05+0000
- * 2015-08-16T08:20:05.376Z
- * 2015-08-16T08:20:05.376+00:00
- * 2015-08-16T08:20:05.376+00
- * Note: The 3-digit milli-seconds is optional. Time zone is required and can be in one of
- * these formats:
- * Z (same with +0000)
- * +08:00 (same with +0800)
- * -02 (same with -0200)
- * -0200
- * @see ISO 8601
- * @param str Date time string to be parsed
- * @return Date representation of the string
- */
- public Date parseDatetime(String str) {
- if (str == null)
- return null;
-
- DateFormat format;
- if (lenientDatetimeFormat) {
- /*
- * When lenientDatetimeFormat is enabled, normalize the date string
- * into LENIENT_DATETIME_FORMAT
to support various formats
- * defined by ISO 8601.
- */
- // normalize time zone
- // trailing "Z": 2015-08-16T08:20:05Z => 2015-08-16T08:20:05+0000
- str = str.replaceAll("[zZ]\\z", "+0000");
- // remove colon in time zone: 2015-08-16T08:20:05+00:00 => 2015-08-16T08:20:05+0000
- str = str.replaceAll("([+-]\\d{2}):(\\d{2})\\z", "$1$2");
- // expand time zone: 2015-08-16T08:20:05+00 => 2015-08-16T08:20:05+0000
- str = str.replaceAll("([+-]\\d{2})\\z", "$100");
- // add milliseconds when missing
- // 2015-08-16T08:20:05+0000 => 2015-08-16T08:20:05.000+0000
- str = str.replaceAll("(:\\d{1,2})([+-]\\d{4})\\z", "$1.000$2");
- format = new SimpleDateFormat(LENIENT_DATETIME_FORMAT);
- } else {
- format = this.datetimeFormat;
- }
-
- try {
- return format.parse(str);
- } catch (ParseException e) {
- throw new RuntimeException(e);
- }
- }
-
- /*
- * Parse date or date time in string format into Date object.
- *
- * @param str Date time string to be parsed
- * @return Date representation of the string
- */
- public Date parseDateOrDatetime(String str) {
- if (str == null)
- return null;
- else if (str.length() <= dateLength)
- return parseDate(str);
- else
- return parseDatetime(str);
- }
-
- /**
- * Format the given Date object into string (Date format).
- *
- * @param date Date object
- * @return Formatted date in string representation
- */
- public String formatDate(Date date) {
- return dateFormat.format(date);
- }
-
- /**
- * Format the given Date object into string (Datetime format).
- *
- * @param date Date object
- * @return Formatted datetime in string representation
- */
- public String formatDatetime(Date date) {
- return datetimeFormat.format(date);
- }
-
- /**
- * Get authentications (key: authentication name, value: authentication).
- *
- * @return Map of authentication objects
- */
- public Mapnull
, i.e. using
- * the system's default tempopary folder.
- *
- * @see createTempFile
- * @return Temporary folder path
- */
- public String getTempFolderPath() {
- return tempFolderPath;
- }
-
- /**
- * Set the tempoaray folder path (for downloading files)
- *
- * @param tempFolderPath Temporary folder path
- * @return ApiClient
- */
- public ApiClient setTempFolderPath(String tempFolderPath) {
- this.tempFolderPath = tempFolderPath;
- return this;
- }
-
- /**
- * Get connection timeout (in milliseconds).
- *
- * @return Timeout in milliseconds
- */
- public int getConnectTimeout() {
- return httpClient.getConnectTimeout();
- }
-
- /**
- * Sets the connect timeout (in milliseconds).
- * A value of 0 means no timeout, otherwise values must be between 1 and
- *
- * @param connectionTimeout connection timeout in milliseconds
- * @return Api client
- */
- public ApiClient setConnectTimeout(int connectionTimeout) {
- httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS);
- return this;
- }
-
- /**
- * Format the given parameter object into string.
- *
- * @param param Parameter
- * @return String representation of the parameter
- */
- public String parameterToString(Object param) {
- if (param == null) {
- return "";
- } else if (param instanceof Date) {
- return formatDatetime((Date) param);
- } else if (param instanceof Collection) {
- StringBuilder b = new StringBuilder();
- for (Object o : (Collection)param) {
- if (b.length() > 0) {
- b.append(",");
- }
- b.append(String.valueOf(o));
- }
- return b.toString();
- } else {
- return String.valueOf(param);
- }
- }
-
- /**
- * Format to {@code Pair} objects.
- *
- * @param collectionFormat collection format (e.g. csv, tsv)
- * @param name Name
- * @param value Value
- * @return A list of Pair objects
- */
- public List- * Note: This might be replaced by utility method from commons-lang or guava someday - * if one of those libraries is added as dependency. - *
- * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) return ""; - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); - } - return out.toString(); - } -} diff --git a/apps/AppDevelopmentAPI_v1.0.0_java/src/main/java/org/wso2/client/api/auth/ApiKeyAuth.java b/apps/AppDevelopmentAPI_v1.0.0_java/src/main/java/org/wso2/client/api/auth/ApiKeyAuth.java deleted file mode 100644 index bf99e9c8..00000000 --- a/apps/AppDevelopmentAPI_v1.0.0_java/src/main/java/org/wso2/client/api/auth/ApiKeyAuth.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * AppDevelopmentAPI - * - * - * OpenAPI spec version: v1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package org.wso2.client.api.auth; - -import org.wso2.client.api.Pair; - -import java.util.Map; -import java.util.List; - -@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-29T10:16:56.409+05:30") -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(Listtrue
- true
- true
- true
- true
- true
- true
- true
- true
- true
- true
- true
-