Package uk.ac.starlink.util

# Class CustomURLStreamHandlerFactory

java.lang.Object
uk.ac.starlink.util.CustomURLStreamHandlerFactory

All Implemented Interfaces:
  `URLStreamHandlerFactory`

public class CustomURLStreamHandlerFactory extends Object implements URLStreamHandlerFactory
Customisable implementation of `URLStreamHandlerFactory`. The handlers it can dispense are configured using a map; the keys of the map are protocol names and its values are the names of classes which implement `URLStreamHandler` (and have no-arg constructors).

Since:
  25 Aug 2006
Author:
  Mark Taylor
See Also:
  - `URL`

## Constructor Summary

Constructors
Constructor
Description
`CustomURLStreamHandlerFactory()`
Constructs a no-op handler factory.
`CustomURLStreamHandlerFactory(Map<String,String> classMap)`
Constructs a handler factory initialised with a given protocol->classname map.

## Method Summary

Modifier and Type
Method
Description
`URLStreamHandler`
`createURLStreamHandler(String protocol)`
`Map<String,String>`
`getHandlerClassMap()`
Returns the protocol->classname map that describes this factory.

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

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

## Constructor Details

### CustomURLStreamHandlerFactory

public CustomURLStreamHandlerFactory()
Constructs a no-op handler factory.

### CustomURLStreamHandlerFactory

public CustomURLStreamHandlerFactory(Map<String,String> classMap)
Constructs a handler factory initialised with a given protocol->classname map.

Parameters:
  `classMap` - handler class map

## Method Details

### getHandlerClassMap

public Map<String,String> getHandlerClassMap()
Returns the protocol->classname map that describes this factory. It may be altered to modify behaviour.

Returns:
  handler class map

### createURLStreamHandler

public URLStreamHandler createURLStreamHandler(String protocol)

Specified by:
  `createURLStreamHandler` in interface `URLStreamHandlerFactory`