Here you can find the source of buildUrl(String[] indexNames, String[] types, String operationOrId)
public static String buildUrl(String[] indexNames, String[] types, String operationOrId)
//package com.java2s; //License from project: Apache License public class Main { public static final String[] EMPTY_ARRAY = new String[] {}; public static String buildUrl(String[] indexNames, String[] types, String operationOrId) { StringBuilder urlBuilder = new StringBuilder(); if (indexNames != null && indexNames.length > 0) { urlBuilder.append("/").append(String.join(",", indexNames)); }/*www . j a v a 2 s .c o m*/ if (types != null && types.length > 0) { urlBuilder.append("/").append(String.join(",", types)); } if (operationOrId != null) { // final String[] splitBySlash = operationOrId.split("/"); urlBuilder.append("/").append(operationOrId); } return urlBuilder.toString(); } public static String buildUrl(String indexName, String type, String operationOrId) { String[] types = type != null ? new String[] { type } : EMPTY_ARRAY; String[] indexNames = indexName != null ? new String[] { indexName } : EMPTY_ARRAY; return buildUrl(indexNames, types, operationOrId); } public static String buildUrl(String indexName, String documentType) { return buildUrl(indexName, documentType, null); } }