public class ProtocolFactory
extends java.lang.Object
Protocol
plugins. Protocol plugins should define
the attribute "protocolName" with the name of the protocol that they
implement. Configuration object is used for caching. Cache key is constructed
from appending protocol name (eg. http) to constant
Protocol.X_POINT_ID
.Constructor and Description |
---|
ProtocolFactory(Configuration conf) |
Modifier and Type | Method and Description |
---|---|
Protocol |
getProtocol(java.lang.String urlString)
Returns the appropriate
Protocol implementation for a url. |
Protocol |
getProtocol(java.net.URL url)
Returns the appropriate
Protocol implementation for a url. |
public ProtocolFactory(Configuration conf)
public Protocol getProtocol(java.lang.String urlString) throws ProtocolNotFound
Protocol
implementation for a url.urlString
- Url StringProtocol
implementation for a given
URL
.ProtocolNotFound
- when Protocol can not be found for urlString or urlString is not
a valid URLpublic Protocol getProtocol(java.net.URL url) throws ProtocolNotFound
Protocol
implementation for a url.url
- URL to be fetched by returned Protocol
implementationProtocol
implementation for a given
URL
.ProtocolNotFound
- when Protocol can not be found for urlCopyright © 2018 The Apache Software Foundation