Class S3Source
java.lang.Object
dev.hardwood.s3.S3Source
- All Implemented Interfaces:
Closeable, AutoCloseable
A configured connection to an S3-compatible object store.
Holds the region, endpoint, credentials, and HTTP client needed
to create S3InputFile instances. Reuse a single S3Source across
multiple files for connection pooling and credential reuse.
URL styles:
- Virtual-hosted (default):
https://{bucket}.s3.{region}.amazonaws.com/{key} - Path-style (opt-in via
S3Source.Builder.pathStyle):{endpoint}/{bucket}/{key}
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic S3Source.Builderbuilder()Creates a newS3Source.Builder.voidclose()Creates anS3InputFilefrom ans3://bucket/keyURI.Creates anS3InputFilefor the given bucket and key.inputFiles(String... uris) CreatesS3InputFileinstances froms3://URIs (may span buckets).inputFilesInBucket(String bucket, String... keys) CreatesS3InputFileinstances for multiple keys in the same bucket.
-
Method Details
-
inputFile
Creates anS3InputFilefor the given bucket and key. When the source is configured withRangeBacking.SPARSE_TEMPFILE, the returned file transparently caches fetched byte ranges in a mmap-backed sparse temp file; the cache is an internal implementation detail and does not change the returned type. -
inputFile
Creates anS3InputFilefrom ans3://bucket/keyURI. SeeinputFile(String, String)for theRangeBackingpolicy. -
inputFilesInBucket
CreatesS3InputFileinstances for multiple keys in the same bucket. -
inputFiles
CreatesS3InputFileinstances froms3://URIs (may span buckets). -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
builder
Creates a newS3Source.Builder.
-