public class S3OutputFile extends java.lang.Object implements OutputFile, NativelyEncryptedFile
| Modifier and Type | Method and Description |
|---|---|
PositionOutputStream |
create()
Create an output stream for the specified location if the target object does not exist in S3 at
the time of invocation.
|
PositionOutputStream |
createOrOverwrite()
Create a new file and return a
PositionOutputStream to it. |
boolean |
exists()
Note: this may be stale if file was deleted since metadata is cached for size/existence checks.
|
static S3OutputFile |
fromLocation(java.lang.String location,
software.amazon.awssdk.services.s3.S3Client client,
S3FileIOProperties s3FileIOProperties,
MetricsContext metrics) |
protected software.amazon.awssdk.services.s3.model.HeadObjectResponse |
getObjectMetadata() |
java.lang.String |
location() |
protected MetricsContext |
metrics() |
NativeFileCryptoParameters |
nativeCryptoParameters() |
S3FileIOProperties |
s3FileIOProperties() |
void |
setNativeCryptoParameters(NativeFileCryptoParameters nativeCryptoParameters) |
InputFile |
toInputFile()
Return an
InputFile for the location of this output file. |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitlocationpublic static S3OutputFile fromLocation(java.lang.String location, software.amazon.awssdk.services.s3.S3Client client, S3FileIOProperties s3FileIOProperties, MetricsContext metrics)
public PositionOutputStream create()
create in interface OutputFilepublic PositionOutputStream createOrOverwrite()
OutputFilePositionOutputStream to it.
If the file already exists, this will not throw an exception and will replace the file.
createOrOverwrite in interface OutputFilepublic InputFile toInputFile()
OutputFileInputFile for the location of this output file.toInputFile in interface OutputFilepublic NativeFileCryptoParameters nativeCryptoParameters()
nativeCryptoParameters in interface NativelyEncryptedFilepublic void setNativeCryptoParameters(NativeFileCryptoParameters nativeCryptoParameters)
setNativeCryptoParameters in interface NativelyEncryptedFilepublic java.lang.String location()
public S3FileIOProperties s3FileIOProperties()
protected MetricsContext metrics()
public boolean exists()
protected software.amazon.awssdk.services.s3.model.HeadObjectResponse getObjectMetadata()
throws software.amazon.awssdk.services.s3.model.S3Exception
software.amazon.awssdk.services.s3.model.S3Exceptionpublic java.lang.String toString()
toString in class java.lang.Object