• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get inside a .ear file

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a java code, at a particular point in this class, I was reading a file. I used to give the path as C:\temp\subTemp\myfile.xml.

Now i have to access a file from inside an .ear file, how do I go about giving the path?
How to get inside the .ear file. What path do I use.
NOTE: I have to place the class file outside the .ear file

Regards,
Prashant
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remember that an ear file basically is a jar file with some special content. So you can use a jar-URL to reference files inside it:

jar:file athToEar/myEar.ear!/pathInsideEar/myfile.xml
reply
    Bookmark Topic Watch Topic
  • New Topic