Raj
Raj

Reputation: 2493

How to read the xml file in netbeans

I am using net beans IDE for development and keeping all my xml files under the folder XML(created under Web Pages folder) ..

I am using the following code to read the xml file .

File file = new File("XML/TableNamesAndColumnNames.xml");

but it is giving file not found exception ..

Can any one suggest how to read the file

Thanks in Advance

Raj

Upvotes: 0

Views: 2296

Answers (1)

Geo
Geo

Reputation: 96767

Probably the path you are specifying is not the correct one. Find out what you application's working directory is. Run this:

System.out.println(new File(".").getAbsolutePath());

And then adjust from there accordingly.

Upvotes: 2

Related Questions