• Post Reply Bookmark Topic Watch Topic
  • New Topic

Parsing XML from local system's D Drive

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,

I want to read xml file from local local system's D drive.

my directory structure is D:\xml\mail.xml

I want to read mail.xml file

I have tried the following codes but its giving null

(1)

(2)

(3)

(4)

(5)

(6)


I've tried all thise options but its giving null value in SOP

my mail.xml is not in .war file. and i don't want it to be in .war file.
any solution ??? waiting for your reply...

thanks in advance
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not a servlet question.

 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you have created your own custom class loader, the resource you are trying to load must be on the classpath. If you are unfamiliar with the classpath, take a look at this.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul Bhattacharjee:
not a servlet question.



The resource must be visible to the classloader or to its parents.
One more thing you can try as you need an inputstream.
Make a file object and then use it to get file inputstream.



now use fin.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!