org.eclipse.core.runtime.internal.adaptor
Class URLConverterImpl

java.lang.Object
  extended by org.eclipse.core.runtime.internal.adaptor.URLConverterImpl
All Implemented Interfaces:
URLConverter

public class URLConverterImpl
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 Summary
URLConverterImpl()
           
 
Method Summary
 URL resolve(URL url)
          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).
 URL toFileURL(URL url)
          Converts a URL that uses a user-defined protocol into a URL that uses the file protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLConverterImpl

public URLConverterImpl()
Method Detail

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


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.