java - Load a file that's been bundled within the .jar? -


i'm building project ant , during build i'd bundle number of property/config files directly .jar make distribution simpler. i've been successful in adding these files .jar, i'm unable load them in program.

what procedure open/read file that's been bundled .jar file?

use getresourceasstream method on class:

properties p = new properties(); p.load(myclass.class.getresourceasstream("/myprops.properties")); 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -