Java URL Build buildURLForPath(String[] _path)

Here you can find the source of buildURLForPath(String[] _path)

Description

build URL For Path

License

Open Source License

Declaration

public static String buildURLForPath(String[] _path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String buildURLForPath(String[] _path) {
        if (_path == null)
            return null;

        int len = _path.length;
        if (len == 0)
            return "";

        StringBuilder url = new StringBuilder(len * 16);
        for (int i = 0; i < len; i++) {
            if (i != 0)
                url.append("/");

            // TODO: escape HTML
            url.append(_path[i]);/*from ww  w .j  av  a 2  s.  c o m*/
        }

        return url.toString();
    }
}

Related

  1. buildUrl(String uri)
  2. buildUrl(String[] indexNames, String[] types, String operationOrId)
  3. buildUrlAsString(String scheme, String host, int port, String path)
  4. buildURLForParams(String... urlParams)
  5. buildURLForParamsWithPrefix(String prefix, String... urlParams)
  6. buildUrlFromParts(String... parts)
  7. buildUrlWithFilter(String url, String[] filterArrayString)
  8. queryString(final Map> params)
  9. queryString(final Map values)