Here you can find the source of getProperties(String bundleName, String fileName)
public static Properties getProperties(String bundleName, String fileName)
//package com.java2s; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.net.URL; import java.util.Properties; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; public class Main { public static Properties getProperties(String bundleName, String fileName) { Properties props = new Properties(); try {/* www . j a v a 2s. com*/ if (Platform.isRunning()) { Bundle bundle = Platform.getBundle(bundleName); URL url = bundle.getResource(fileName); String filepath = FileLocator.toFileURL(url).getFile(); props.load(new FileInputStream(new File(filepath))); } else { props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName)); } } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return props; } }