• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Find path of a file inside a jar file????  RSS feed

 
Chris Jebaraj
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a jar file which contains an xml file. How to find out the path of the xml file since one of my class (which is also inside the jar) will read the content of the jar. And the jar file can be put in any directory and will be included to the client application either through the IDE or -classpath option. Pls guys!! help me to find out this, this is an urgent requirement....... Thanks in advance..
 
Joe Ess
Bartender
Posts: 9426
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class.getResource() or Class.getResourceAsStream() will do the trick.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!