org.apache.sling.jcr.classloader.internal.net

## Class JCRURLHandler

- java.lang.Object
- - java.net.URLStreamHandler
  - - org.apache.sling.jcr.classloader.internal.net.JCRURLHandler

    public class JCRURLHandler
    extends URLStreamHandler

The `JCRURLHandler` is the `URLStreamHandler` for JCR Repository URLs identified by the scheme `jcr`.

JCR Repository URLs have not been standardized yet and may only be created in the context of an existing `Session`. Therefore this handler is not globally available and JCR Repository URLs may only be created through the factory method.

This class is not intended to be subclassed or instantiated by clients.

See Also:
  `JCRURLConnection`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static URL` `createURL(ClassLoaderWriterImpl writer, String path)` Creates a new JCR Repository URL for the given session and item path.
`protected URLConnection` `openConnection(URL url)` Gets a connection object to connect to an JCR Repository URL.

### Methods inherited from class java.net.URLStreamHandler

`equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### createURL

    public static URL createURL(ClassLoaderWriterImpl writer,
                                String path)
                         throws MalformedURLException

Creates a new JCR Repository URL for the given session and item path.

Parameters:
  `writer` - The writer session providing access to the item.
  `path` - The absolute path to the item. This must be an absolute path with a leading slash character. If this is `null` the root node path - `/` - is assumed.
Returns:
  The JCR Repository URL
Throws:
  `MalformedURLException` - If an error occurrs creating the `URL` instance.

#### openConnection

    protected URLConnection openConnection(URL url)

Gets a connection object to connect to an JCR Repository URL.

Specified by:
  `openConnection` in class `URLStreamHandler`
Parameters:
  `url` - The JCR Repository URL to connect to.
Returns:
  An instance of the `JCRURLConnection` class.
See Also:
  `JCRURLConnection`