title: How to use a property file in an OSGi bundle
body: <p>In an OSGi bundle in my application I have a property file included named <code>ontologymapping.properties</code>.
  Now I want to read the content of this property file.
  In some example code I found something like this in the start method of the bundle:</p>
  
  <pre><code>public void startObservationAdapter(BundleContext context) {
      String filename = context.getProperty("ontologymapping.properties");
      try {
          File file = new File(filename);
          InputStream in = new FileInputStream(file);
          ontologymapping.load(in);
          in.close();
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>where <code>ontologymapping</code> is a Properties instance.
  When I run this code the JVM can't find the file.
  I guess the reason is that the file isn't included in the BundleContext.
  How can I do that? Or what is another way to read the contents of the property file?
  The bundle is not declarative, it's an api bundle for another one which is declarative.</p>