Java URI Create createURI(List proxyPorts)

Here you can find the source of createURI(List proxyPorts)

Description

create URI

License

Apache License

Declaration

private static URI createURI(List<Integer> proxyPorts) 

Method Source Code

//package com.java2s;
/*//from ww  w.j  a v  a  2  s.  c o m
 * Copyright Terracotta, Inc.
 *
 * 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.
 */

import java.net.URI;

import java.util.List;

import java.util.stream.Collectors;

public class Main {
    private static URI createURI(List<Integer> proxyPorts) {

        String uri = proxyPorts.stream().map(port -> "localhost:" + port)
                .collect(Collectors.joining(",", "terracotta://", ""));

        return URI.create(uri);
    }
}

Related

  1. createUri(final String path)
  2. createUri(final String path, final String query)
  3. createURI(final String scheme, final String host, final int port)
  4. createURI(final String scheme, final String host, int port, final String path, final String query, final String fragment)
  5. createURI(final String scheme, final String[] pathAsArray)
  6. createUri(String base)
  7. createURI(String extension)
  8. createURI(String filename)
  9. createURI(String hostname, int port)