Package org.eclipse.emf.cdo.common.util

# Interface URIHandlerRegistry

public interface URIHandlerRegistry
A `global` URI handler registry.

Handlers registered here are available through this registry. They are not automatically available to arbitrary EMF URI converters. Use `installTo(URIConverter)` or `installTo(ResourceSet)` when a particular converter should consult this registry. For example:

     ResourceSet resourceSet = new ResourceSetImpl();
     URIHandlerRegistry.INSTANCE.install(resourceSet);
     URI uri = URI.createURI("cdo.checkout.text://my-checkout/path/to/file.txt");
     InputStream in = resourceSet.getURIConverter().createInputStream(uri);

The schemes available at runtime depend on the `URIHandlerFactory` contributions.

Since:
  4.13
Author:
  Eike Stepper
No Implement
  This interface is not intended to be implemented by clients.
No Extend
  This interface is not intended to be extended by clients.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final URIHandlerRegistry`
`INSTANCE`

## Method Summary

Modifier and Type
Method
Description
`URIHandler`
`addURIHandler(String scheme, URIHandler handler)`
Adds a URI handler for the given scheme to this registry.
`URIHandler`
`getURIHandler(String scheme)`
Returns the URI handler for the given scheme, or `null` if none is registered.
`boolean`
`installTo(ResourceSet resourceSet)`
Installs this registry into a resource set's URI converter, if it is not already present.
`boolean`
`installTo(URIConverter uriConverter)`
Installs this registry into a URI converter, if it is not already present.
`URIHandler`
`removeURIHandler(String scheme)`
Removes the URI handler for the given scheme from this registry and returns it.
`boolean`
`uninstallFrom(ResourceSet resourceSet)`
Removes this exact registry instance from a resource set's URI converter.
`boolean`
`uninstallFrom(URIConverter uriConverter)`
Removes this exact registry instance from a URI converter.

## Field Details

### INSTANCE

static final URIHandlerRegistry INSTANCE

## Method Details

### addURIHandler

URIHandler addURIHandler(String scheme, URIHandler handler)
Adds a URI handler for the given scheme to this registry.

If a handler was already registered for the scheme, it is replaced and returned.

### removeURIHandler

URIHandler removeURIHandler(String scheme)
Removes the URI handler for the given scheme from this registry and returns it.

### getURIHandler

URIHandler getURIHandler(String scheme)
Returns the URI handler for the given scheme, or `null` if none is registered.

### installTo

boolean installTo(URIConverter uriConverter)
Installs this registry into a URI converter, if it is not already present.

Returns:
  `true` if the converter was changed, or `false` if this registry was already installed.
Since:
  4.28

### installTo

boolean installTo(ResourceSet resourceSet)
Installs this registry into a resource set's URI converter, if it is not already present.

Returns:
  `true` if the resource set was changed, or `false` if this registry was already installed.
Since:
  4.28

### uninstallFrom

boolean uninstallFrom(URIConverter uriConverter)
Removes this exact registry instance from a URI converter.

Returns:
  `true` if the converter was changed, or `false` if this registry was not installed.
Since:
  4.28

### uninstallFrom

boolean uninstallFrom(ResourceSet resourceSet)
Removes this exact registry instance from a resource set's URI converter.

Returns:
  `true` if the resource set was changed, or `false` if this registry was not installed.
Since:
  4.28