Here you can find the source of toURIArray(String[] array)
Parameter | Description |
---|---|
array | An array of strings - must not be null |
public static URI[] toURIArray(String[] array)
//package com.java2s; /*/*ww w.j av a2 s.c o m*/ * Copyright 2004,2005 The Apache Software Foundation. * * 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; public class Main { /** * Convert an array of strings into an array of URI instances. The string * values should be in a format which can be reliably converted into the URI * type using the URI.create() method. * * @param array An array of strings - must not be null * @return An array of URI instances */ public static URI[] toURIArray(String[] array) { URI[] uris = new URI[array.length]; for (int i = 0; i < array.length; i++) { uris[i] = URI.create(array[i].trim()); } return uris; } }