Here you can find the source of loadPropertiesFromFile(JarFile jar)
public static Map<String, String> loadPropertiesFromFile(JarFile jar) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.jar.JarEntry; import java.util.jar.JarFile; public class Main { public static Map<String, String> loadPropertiesFromFile(JarFile jar) throws IOException { Map<String, String> result = new HashMap<String, String>(); Properties props = new Properties(); JarEntry entry = jar.getJarEntry("conf/plugin.properties"); if (entry != null) { InputStream in = jar.getInputStream(entry); props.load(in);/*from w w w. j a va2 s . c o m*/ Enumeration<?> en = props.propertyNames(); while (en.hasMoreElements()) { String key = en.nextElement().toString().trim(); result.put(key, props.getProperty(key, "")); } } return result; } }