Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Wednesday, November 21, 2007

How to get a Proper URL from a File Object in java

import java.io.*;
import java.net.*;

public class FileURL {
public static void main(String args[]) throws MalformedURLException {
File file = new File("The End");
URL url2 = file.toURI().toURL();
System.out.printf("Good url %s%n", url2);
}
}

No comments: