aspose file tools
The moose likes Java in General and the fly likes Loading an XML file in a classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Loading an XML file in a classpath" Watch "Loading an XML file in a classpath" New topic
Author

Loading an XML file in a classpath

Vrinda Werdel
Ranch Hand

Joined: Jan 03, 2004
Posts: 75
Hi All,

I have a requirement where I have a an XML config file. the path of this config file is specified in the classpath. I need to load this config file at run time by just specifying the name of the file.

Eg. Assume the file abc.xml is in c:/temp/abc.xml. and my classpath is set c:/temp;


and I want to do something like this.

File file = new File("abc.xml");

Does the JRE furnish the complete the path of the file at run time?

Is something like this possible?

regards
Vrinda
Ajay Singh
Ranch Hand

Joined: Dec 13, 2006
Posts: 182
You can use this to get the URL of the file:

 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: Loading an XML file in a classpath
 
Similar Threads
temp location
please help me
Class Path
How to Create a Byte Arrary from a XML File?
modifying Jboss classpath