0

I have created a Jar library which its initialization, capabilities, features, etc. should be customized. The problem is that I want this customization to be performed using an external XML file, so the Jar library reads that file and initializes accordingly. The scenario is the following:

I have a Java application which contains the Jar library and the config.xml file. How do I make the Jar library to read the config.xml file? An image for a better understanding:

Diagram http://imageshack.us/a/img826/1888/readxmlfromjar.png

I have been searching for hours but all I find is how to read files within the same jar file with the resources approach. Can this be done at all? If not, any good alternative out there?

Roman C
  • 49,761
  • 33
  • 66
  • 176
  • How you solved this issue. I've similar issue, I made a maven library file but I need end user who use the library to customize it by adding information to .properties file in his own project? – Ayman Al-Absi Nov 12 '14 at 21:12

1 Answers1

0

You can use zip utils from java.util.zip package http://docs.oracle.com/javase/6/docs/api/java/util/zip/package-summary.html

Like here Read a file inside a Zip archive and put its content into a String in Android

Community
  • 1
  • 1
zacheusz
  • 8,750
  • 3
  • 36
  • 60