Read A Properties File Inside Jar File
Join the DZone community and get the full member experience.
Join For Free
String sConfigFile = "config/mail.properties";
InputStream in = mailSender.class.getClassLoader().getResourceAsStream(sConfigFile);
if (in == null) {
//File not found! (Manage the problem)
}
Properties props = new java.util.Properties();
props.load(in);
JAR (file format)
Opinions expressed by DZone contributors are their own.
Comments