public class HttpFetcher extends AbstractFetcher implements Initializable, RangeFetcher
Modifier and Type | Field and Description |
---|---|
static Property |
HTTP_CONTENT_ENCODING |
static Property |
HTTP_CONTENT_TYPE |
static String |
HTTP_FETCH_PREFIX |
static Property |
HTTP_FETCH_TRUNCATED |
static String |
HTTP_HEADER_PREFIX |
static Property |
HTTP_NUM_REDIRECTS
Number of redirects
|
static Property |
HTTP_STATUS_CODE
http status code
|
static Property |
HTTP_TARGET_IP_ADDRESS |
static Property |
HTTP_TARGET_URL
If there were redirects, this captures the final URL visited
|
Constructor and Description |
---|
HttpFetcher() |
Modifier and Type | Method and Description |
---|---|
void |
checkInitialization(InitializableProblemHandler problemHandler) |
InputStream |
fetch(String fetchKey,
long startRange,
long endRange,
Metadata metadata) |
InputStream |
fetch(String fetchKey,
Metadata metadata) |
void |
initialize(Map<String,Param> params) |
void |
setAuthScheme(String authScheme) |
void |
setConnectTimeout(int connectTimeout) |
void |
setHttpHeaders(List<String> headers)
Which http headers should we capture in the metadata.
|
void |
setMaxConnections(int maxConnections) |
void |
setMaxConnectionsPerRoute(int maxConnectionsPerRoute) |
void |
setMaxErrMsgSize(int maxErrMsgSize) |
void |
setMaxRedirects(int maxRedirects) |
void |
setMaxSpoolSize(long maxSpoolSize)
Set the maximum number of bytes to spool to a temp file.
|
void |
setNtDomain(String domain) |
void |
setOverallTimeout(long overallTimeout)
This sets an overall timeout on the request.
|
void |
setPassword(String password) |
void |
setProxyHost(String proxyHost) |
void |
setProxyPort(int proxyPort) |
void |
setRequestTimeout(int requestTimeout) |
void |
setSocketTimeout(int socketTimeout) |
void |
setUserAgent(String userAgent)
When making the request, what User-Agent is sent in the request.
|
void |
setUserName(String userName) |
getName, setName
public static String HTTP_HEADER_PREFIX
public static String HTTP_FETCH_PREFIX
public static Property HTTP_STATUS_CODE
public static Property HTTP_NUM_REDIRECTS
public static Property HTTP_TARGET_URL
public static Property HTTP_TARGET_IP_ADDRESS
public static Property HTTP_FETCH_TRUNCATED
public static Property HTTP_CONTENT_ENCODING
public static Property HTTP_CONTENT_TYPE
public InputStream fetch(String fetchKey, Metadata metadata) throws IOException, TikaException
fetch
in interface Fetcher
IOException
TikaException
public InputStream fetch(String fetchKey, long startRange, long endRange, Metadata metadata) throws IOException
fetch
in interface RangeFetcher
IOException
@Field public void setProxyPort(int proxyPort)
@Field public void setConnectTimeout(int connectTimeout)
@Field public void setRequestTimeout(int requestTimeout)
@Field public void setSocketTimeout(int socketTimeout)
@Field public void setMaxConnections(int maxConnections)
@Field public void setMaxConnectionsPerRoute(int maxConnectionsPerRoute)
@Field public void setMaxSpoolSize(long maxSpoolSize)
-1
, the full stream will be spooled to a temp file
Default size is -1.maxSpoolSize
- @Field public void setMaxRedirects(int maxRedirects)
@Field public void setHttpHeaders(List<String> headers)
HTTP_HEADER_PREFIX
headers
- @Field public void setOverallTimeout(long overallTimeout)
overallTimeout
- @Field public void setMaxErrMsgSize(int maxErrMsgSize)
@Field public void setUserAgent(String userAgent)
userAgent
- public void initialize(Map<String,Param> params) throws TikaConfigException
initialize
in interface Initializable
params
- params to use for initializationTikaConfigException
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException
checkInitialization
in interface Initializable
problemHandler
- if there is a problem and no
custom initializableProblemHandler has been configured
via Initializable parameters,
this is called to respond.TikaConfigException
Copyright © 2007–2023 The Apache Software Foundation. All rights reserved.