Alex Rivera | Logout

URI for local resources

Asked 2010-03-17T22:29:11.280
18

In Java can I create a URI for a file located locally in the hard drive? If so, how should it be constructed?

Edit
Report

1 Answer

10
URI uri = new URI("file:///filename.txt");

If you're using Windows:

URI uri = new URI("file:///C:/fun/filename.txt");
answered 2010-03-17T22:36:47.633

Your Answer