org.apache.nutch.protocol
Class ProtocolFactory
java.lang.Object
org.apache.nutch.protocol.ProtocolFactory
public class ProtocolFactory
- extends Object
Creates and caches 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
.
Field Summary |
static org.slf4j.Logger |
LOG
|
Constructor Summary |
ProtocolFactory(org.apache.hadoop.conf.Configuration conf)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
public static final org.slf4j.Logger LOG
ProtocolFactory
public ProtocolFactory(org.apache.hadoop.conf.Configuration conf)
getProtocol
public Protocol getProtocol(String urlString)
throws ProtocolNotFound
- Returns the appropriate
Protocol
implementation for a url.
- Parameters:
urlString
- Url String
- Returns:
- The appropriate
Protocol
implementation for a given URL
.
- Throws:
ProtocolNotFound
- when Protocol can not be found for urlString
getFields
public Collection<WebPage.Field> getFields()
Copyright © 2013 The Apache Software Foundation