Here you can find the source of getIniFileInputStreamEclipse()
public static InputStream getIniFileInputStreamEclipse()
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.io.InputStream; import java.net.URL; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Bundle; public class Main { /**/*ww w.java 2 s. c o m*/ * Get the bpel4chor.ini file InputStream, the File Path is provided from eclipse bundle. * <p> * <b>Note</b>: This method works only with eclipse runtime dependencies * @return inputStream */ public static InputStream getIniFileInputStreamEclipse() { InputStream in = null; Bundle bundle = Platform.getBundle("org.bpel4chor.model");// bundle-ID in plug-in-descriptor Path path = new Path("config/bpel4chor.ini"); URL fileURL = FileLocator.find(bundle, path, null); try { if (fileURL != null) { URL absoluteUrl = Platform.resolve(fileURL); //System.out.println("Get InputStream: "+new File(absoluteUrl.getFile()).getAbsolutePath()); in = absoluteUrl.openStream(); } } catch (IOException e) { e.printStackTrace(); } return in; } }