Here you can find the source of getURIs(final Object[] objs)
Parameter | Description |
---|---|
objs | - array contenente oggetti di tipo File, URL o URI |
public static URI[] getURIs(final Object[] objs) throws URISyntaxException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; import java.util.LinkedList; import java.util.List; public class Main { /**//from www .j ava 2s .c o m * ottengo un array di URI da un array contenente File o URL * @param objs - array contenente oggetti di tipo File, URL o URI */ public static URI[] getURIs(final Object[] objs) throws URISyntaxException { final List<URI> uris = new LinkedList<URI>(); for (final Object obj : objs) { if (obj instanceof URI) { uris.add((URI) obj); } else if (obj instanceof URL) { uris.add(((URL) obj).toURI()); } else if (obj instanceof File) { uris.add(((File) obj).toURI()); } else { continue; } } return uris.toArray(new URI[uris.size()]); } }