title: How to get resources path from an Eclipse plugin
body: <p>I am developing an Eclipse plugin using Eclipse Plugin-in-project where it will add a menu item in the toolbar.</p>
  
  <p>My plugin project is depending on one file which is located in the same plugin project I want the path of that file.</p>
  
  <p>Below is the sample code I have used to get the path:</p>
  
  <pre class="lang-java prettyprint-override"><code>Bundle bundle = Platform.getBundle("com.feat.eclipse.plugin");
  URL fileURL = bundle.getEntry("webspy/lib/file.txt");
  File file = null;
  String path=null;
  try {
      file = new File(FileLocator.resolve(fileURL).toURI());
      path = file.getAbsolutePath();
  } catch (URISyntaxException e1) {
      e1.printStackTrace();
  } catch (IOException e1) {
      e1.printStackTrace();
  }
  </code></pre>
  
  <p>While running from Eclipse <em>Run as > Eclipse Application</em> it is giving me the correct path. But when I export my plugin as jar and add it in my Eclipse plugins folder its not giving me the correct path.</p>
  
  <p>Please help me to resolve this!</p>