Here you can find the source of buildURLForParamsWithPrefix(String prefix, String... urlParams)
Parameter | Description |
---|---|
prefix | given prefix |
urlParams | given params |
public static String buildURLForParamsWithPrefix(String prefix, String... urlParams)
//package com.java2s; /*//from w ww . ja v a 2 s. co m Copyright 2013 Rene Nowak 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. */ public class Main { /** * Returns a URL created from the given params and with the given prefix * * @param prefix given prefix * @param urlParams given params * @return URL with the given params and prefix */ public static String buildURLForParamsWithPrefix(String prefix, String... urlParams) { String url = "/" + prefix + buildURLForParams(urlParams); return url; } /** * Returns a URL created from the given params * * @param urlParams given params * @return URL with the given params */ public static String buildURLForParams(String... urlParams) { String url = "/"; for (String param : urlParams) { url += param + "/"; } return url; } }