Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-3342

Throw FileNotFound exception when trying to get a resource that does not exist

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • framework-4.0.2
    • None
    • Framework
    • None

    Description

      Currently when a resource is not found inside a bundle, an IOException is thrown with the message: "Resource does not exist" . It would be more useful to throw instead a FileNotFound exception. This behavior happens outside OSGi and also in Equinox. For example look the stack trace in Equinox:

      java.io.FileNotFoundException: /resource/myresource.stg
      at
      org.eclipse.osgi.framework.internal.protocol.bundleresource.Handler.findBundleEntry(Handler.java:51)
      at
      org.eclipse.osgi.framework.internal.core.BundleResourceHandler.openConnection(BundleResourceHandler.java:175)
      at java.net.URL.openConnection(URL.java:945)
      at java.net.URL.openStream(URL.java:1010)

      This small fix would improve compatibility with 3rd parties that rely on this behavior, and also improve compatibility with the behavior in equinox.

      Attachments

        Activity

          People

            Unassigned Unassigned
            irvingc Irving Cordova
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: