Package org.apache.tika.pipes.fetcher.s3
Class S3Fetcher
java.lang.Object
org.apache.tika.plugins.AbstractTikaExtension
org.apache.tika.pipes.fetcher.s3.S3Fetcher
- All Implemented Interfaces:
Fetcher,RangeFetcher,TikaExtension,org.pf4j.ExtensionPoint
Fetches files from s3. Example file: s3://my_bucket/path/to/my_file.pdf
The bucket must be specified via the tika-config or before
initialization, and the fetch key is "path/to/my_file.pdf".
-
Field Summary
Fields inherited from class org.apache.tika.plugins.AbstractTikaExtension
pluginConfig -
Method Summary
Modifier and TypeMethodDescriptionstatic S3Fetcherbuild(ExtensionConfig extensionConfig) fetch(String fetchKey, long startRange, long endRange, Metadata metadata, ParseContext parseContext) fetch(String fetchKey, Metadata metadata, ParseContext parseContext) Fetches a resource and returns it as a TikaInputStream.Methods inherited from class org.apache.tika.plugins.AbstractTikaExtension
getExtensionConfigMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.tika.pipes.api.fetcher.RangeFetcher
fetchMethods inherited from interface org.apache.tika.plugins.TikaExtension
getExtensionConfig
-
Method Details
-
build
public static S3Fetcher build(ExtensionConfig extensionConfig) throws IOException, TikaConfigException - Throws:
IOExceptionTikaConfigException
-
fetch
public TikaInputStream fetch(String fetchKey, Metadata metadata, ParseContext parseContext) throws TikaException, IOException Description copied from interface:FetcherFetches a resource and returns it as a TikaInputStream.- Specified by:
fetchin interfaceFetcher- Parameters:
fetchKey- the key identifying the resource to fetch (interpretation depends on the implementation, e.g., file path, URL, S3 key)metadata- metadata object to be updated with resource informationparseContext- the parse context- Returns:
- a TikaInputStream for reading the resource content
- Throws:
TikaException- if a Tika-specific error occurs during fetchingIOException- if an I/O error occurs during fetching
-
fetch
public TikaInputStream fetch(String fetchKey, long startRange, long endRange, Metadata metadata, ParseContext parseContext) throws TikaException, IOException - Specified by:
fetchin interfaceRangeFetcher- Throws:
TikaExceptionIOException
-