Java File to URL fileToURL(File... files)

Here you can find the source of fileToURL(File... files)

Description

file To URL

License

Apache License

Declaration

public static URL[] fileToURL(File... files) throws MalformedURLException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.File;

import java.net.MalformedURLException;
import java.net.URL;

public class Main {
    public static URL[] fileToURL(File... files) throws MalformedURLException {
        URL[] urls = new URL[files.length];
        int i = 0;
        for (File file : files) {
            urls[i] = file.toURI().toURL();
            i++;/*w ww.  j  ava2s. c  o m*/
        }
        return urls;
    }
}

Related

  1. fileToURL(File file)
  2. fileToURL(File file)
  3. fileToURL(File file)
  4. fileToURL(File file)
  5. fileToURL(File file)
  6. fileToURL(String file)
  7. fileToURL(String filename)
  8. fileToURL(String filename)
  9. fileToURLString(File file)