• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading external xml files from a jar  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to read an xml file from a jar (which is not present inside the jar ) .
I am passing the file name as a string (like C:/folder/filename) to the SAXBuilder but it throwing
unknown protocol: c error.
i tried using an url , tried using a relative path but to no use.

My application needs to read two xml files , parse it, perform some operation and write
the result to an output file.
(I even tried converting them to URIs)
The xml files are in the same directory as the jar ( i dont know if it should matter as i am giving the absolute path).

The main class reads the names of the files and passes the names as strings to the SAXBuilder.
This is where i am getting an exception.

Any help would be appreciated.

Kindly reply at the earliest

TIA,
Harsha
 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Harsha,

Always read documentation ;-)

I suppose you are talking about SAXBuilder.build. This
function does not accept a path to a file. Try:


P.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!