Loading file

Hi,I want to know how to load file located anywhere in the hard disk or do i have to specify full path? if so how the url should be specified i.e. with escape characters?Can anyone give example of it?
[214 byte] By [ms_mahesh123a] at [2007-10-3 4:13:08]
# 1
URL url = new URL("file:///path/to/resource.bin");File f = new File("/path/to/resource.bin");J
jagulara at 2007-7-14 22:14:05 > top of Java-index,Java Essentials,Java Programming...
# 2
You can specify either a full path, or a path relative to the "current directory" in a File object. If you need a URL then use File.toURL().
malcolmmca at 2007-7-14 22:14:05 > top of Java-index,Java Essentials,Java Programming...
# 3
Here is my situation.. I have an xml file which is situated somewhere in the hard disk.. I want to somehow load file in Java. The file is not kept in Java classpath nor in the current user directory. How can i achieve it?Does Java provide feature of loading any file from hard disk?
ms_mahesh123a at 2007-7-14 22:14:05 > top of Java-index,Java Essentials,Java Programming...
# 4

> Does Java provide feature of loading any file from hard disk?

Yes, and you've been given some suggestions on how to specify the file name.

If you problem is on actually reading the file then would need to use a FileReader to read the file. Read the API or search the forum for I/O examples using the FileReader if you need more help.

camickra at 2007-7-14 22:14:05 > top of Java-index,Java Essentials,Java Programming...