Class BundleURLConverter

java.lang.Object
org.eclipse.osgi.storage.url.BundleURLConverter
All Implemented Interfaces:
URLConverter

public class BundleURLConverter extends Object implements URLConverter
The service implementation that allows bundleresource or bundleentry URLs to be converted to native file URLs on the local file system.

Internal class.

  • Constructor Details

    • BundleURLConverter

      public BundleURLConverter()
  • Method Details

    • toFileURL

      public URL toFileURL(URL url) throws IOException
      Description copied from interface: URLConverter
      Converts a URL that uses a user-defined protocol into a URL that uses the file protocol. The contents of the URL may be extracted into a cache on the file-system in order to get a file URL.

      If the protocol for the given URL is not recognized by this converter, the original URL is returned as-is.

      Specified by:
      toFileURL in interface URLConverter
      Parameters:
      url - the original URL
      Returns:
      the converted file URL or the original URL passed in if it is not recognized by this converter
      Throws:
      IOException - if an error occurs during the conversion
    • resolve

      public URL resolve(URL url) throws IOException
      Description copied from interface: URLConverter
      Converts a URL that uses a client-defined protocol into a URL that uses a protocol which is native to the Java class library (file, jar, http, etc).

      Note however that users of this API should not assume too much about the results of this method. While it may consistently return a file: URL in certain installation configurations, others may result in jar: or http: URLs.

      If the protocol is not recognized by this converter, then the original URL is returned as-is.

      Specified by:
      resolve in interface URLConverter
      Parameters:
      url - the original URL
      Returns:
      the resolved URL or the original if the protocol is unknown to this converter
      Throws:
      IOException - if unable to resolve URL