## org.eclipse.datatools.connectivity.services
Class PluginResourceLocator

    java.lang.Object
      org.eclipse.datatools.connectivity.services.PluginResourceLocator

    public class PluginResourceLocator

extends java.lang.Object

Locator of plug-in entries and resources. It supports locating entries and service resources in both Eclipse OSGi and OSGi-less platforms.

Since:
  1.9

Constructor Summary
`PluginResourceLocator()`

Method Summary
`static java.net.URL` `getConfigurableWorkspaceLocation(java.lang.String pluginId)` Returns the user configurable workspace location of the specified plug-in.
`static java.net.URL` `getPluginEntry(org.eclipse.core.runtime.IConfigurationElement configElement, java.lang.String path)` Returns a URL to the entry at the specified path in the plugin-in that contributes the specified configuration element.
`static java.net.URL` `getPluginEntry(java.lang.String pluginId, java.lang.String path)` Returns a URL to the entry at the specified path in the specified plug-in.
`static org.eclipse.core.runtime.IPath` `getPluginEntryPath(java.lang.String pluginId, java.lang.String path)` Returns a IPath to the entry at the specified path in the specified plug-in.
`static org.eclipse.core.runtime.IPath` `getPluginRootPath(org.eclipse.core.runtime.IConfigurationElement configElement)` Returns a IPath to the root entry of the plugin-in that contributes the specified configuration element.
`static org.eclipse.core.runtime.IPath` `getPluginRootPath(java.lang.String pluginId)` Returns a IPath to the root entry of the specified plug-in.
`static org.eclipse.core.runtime.IPath` `getPluginStateLocation(java.lang.String pluginId)` Returns the location in the local file system of the plug-in state area for the specified plug-in.
`static java.lang.String` `getResourceString(java.lang.String pluginId, java.lang.String value)` Returns a resource string corresponding to the given argument value.
`static java.net.URL` `resolve(java.net.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).
`static java.net.URL` `toFileURL(java.net.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
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PluginResourceLocator

    public PluginResourceLocator()

Method Detail

### getPluginRootPath

    public static org.eclipse.core.runtime.IPath getPluginRootPath(org.eclipse.core.runtime.IConfigurationElement configElement)

  Returns a IPath to the root entry of the plugin-in that contributes the specified configuration element.

  Parameters:
    `configElement` - configuration element
  Returns:
    A IPath to the plug-in root entry, or null if not found

### getPluginRootPath

    public static org.eclipse.core.runtime.IPath getPluginRootPath(java.lang.String pluginId)

  Returns a IPath to the root entry of the specified plug-in.

  Parameters:
    `pluginId` - unique identifier of a plug-in or bundle
  Returns:
    A IPath to the plug-in root entry, or null if not found

### getPluginEntryPath

    public static org.eclipse.core.runtime.IPath getPluginEntryPath(java.lang.String pluginId,
                                                                    java.lang.String path)

  Returns a IPath to the entry at the specified path in the specified plug-in.

  Parameters:
    `pluginId` - unique identifier of a plug-in or bundle
    `path` - the path name of the entry
  Returns:
    A IPath to the entry, or null if no entry could be found

### getPluginEntry

    public static java.net.URL getPluginEntry(org.eclipse.core.runtime.IConfigurationElement configElement,
                                              java.lang.String path)

  Returns a URL to the entry at the specified path in the plugin-in that contributes the specified configuration element.

  Parameters:
    `configElement` - configuration element
    `path` - the path name of the entry
  Returns:
    A URL to the entry, or null if no entry could be found

### getPluginEntry

    public static java.net.URL getPluginEntry(java.lang.String pluginId,
                                              java.lang.String path)

  Returns a URL to the entry at the specified path in the specified plug-in.

  Parameters:
    `pluginId` - unique identifier of a plug-in or bundle
    `path` - the path name of the entry
  Returns:
    A URL to the entry, or null if no entry could be found

### getPluginStateLocation

    public static org.eclipse.core.runtime.IPath getPluginStateLocation(java.lang.String pluginId)

  Returns the location in the local file system of the plug-in state area for the specified plug-in.
  The platform-defined state location is returned, if available. Otherwise, returns the configurable workspace location of the specified plug-in.

  Parameters:
    `pluginId` - the unique, symbolic name of a plug-in or bundle
  Returns:
    A URL to the location path of the state area for the specified plug-in, or null if none is available
  See Also:
    `#getConfigurableWorkspaceLocation(String)}`

### getConfigurableWorkspaceLocation

    public static java.net.URL getConfigurableWorkspaceLocation(java.lang.String pluginId)

  Returns the user configurable workspace location of the specified plug-in. It returns the value of the system property named "{pluginName}_workspacepath" if set, or the value of the environment variable under the same name.
  If no workspace path is specifically defined for the plug-in, return the path named with the plug-in namespace, under a shared, parent workspace path. The parent workspace path is the value of the system property named "org.eclipse.datatools_workspacepath" if set, or the value of the environment variable under the same name.

  Parameters:
    `pluginId` - the unique, symbolic name of a plug-in or bundle
  Returns:
    A URL to the absolute workspace location of the specified plug-in, or null if no configurable workspace path is specified

### resolve

    public static java.net.URL resolve(java.net.URL url)
                                throws java.io.IOException

  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).

  Parameters:
    `url` - the original URL
  Returns:
    the resolved URL or the original if the protocol is unknown to the converter
  Throws:
    `java.io.IOException` - if unable to resolve URL, or if an error occurs during the resolution

### toFileURL

    public static java.net.URL toFileURL(java.net.URL url)
                                  throws java.io.IOException

  Converts a URL that uses a user-defined protocol into a URL that uses the file protocol.

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

  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:
    `java.io.IOException` - if an error occurs during the conversion

### getResourceString

    public static java.lang.String getResourceString(java.lang.String pluginId,
                                                     java.lang.String value)

  Returns a resource string corresponding to the given argument value.

  Parameters:
    `pluginId` - unique identifier of a plug-in or bundle whose resource bundle is being queried
    `value` - the value to look for
  Returns:
    the resource string