Java File to URL fileToURLString(File file)

Here you can find the source of fileToURLString(File file)

Description

file To URL String

License

LGPL

Declaration

private static String fileToURLString(File file) throws MalformedURLException 

Method Source Code


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

import java.io.File;

import java.net.MalformedURLException;

public class Main {
    private static String fileToURLString(File file) throws MalformedURLException {
        return file.toURI().toURL().toString();
    }/*from  w  ww  .  j a  v a  2 s  .c o  m*/
}

Related

  1. fileToURL(File file)
  2. fileToURL(File... files)
  3. fileToURL(String file)
  4. fileToURL(String filename)
  5. fileToURL(String filename)