Afficher le nom d’un fichier en format URL

Author:

 fichier, url, set, url
{filelink=282}

import java.net.*;

public class FileToURL
 { 
    public static void main(String[] argv) 
   { 

        Class c = FileToURL.class; 

        java.net.URL u = c.getResource("FileToURL.java"); 

        System.out.println(u); 

    } 

}

/*
 * Exemple d'affichage
 * file:/C:/Documents%20and%20Settings/Administrateur/xx/FileToURL.java
 *
 */

Leave a Reply

Your email address will not be published. Required fields are marked *