Package software.amazon.awssdk.core
Class FileTransformerConfiguration
- java.lang.Object
-
- software.amazon.awssdk.core.FileTransformerConfiguration
-
- All Implemented Interfaces:
ToCopyableBuilder<FileTransformerConfiguration.Builder,FileTransformerConfiguration>
public final class FileTransformerConfiguration extends Object implements ToCopyableBuilder<FileTransformerConfiguration.Builder,FileTransformerConfiguration>
Configuration options forAsyncResponseTransformer.toFile(Path, FileTransformerConfiguration)
to configure how the SDK should write the file and if the SDK should delete the file when an exception occurs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FileTransformerConfiguration.Builder
static class
FileTransformerConfiguration.FailureBehavior
Defines how the SDK should handle the file if there is an exceptionstatic class
FileTransformerConfiguration.FileWriteOption
Defines how the SDK should write the file
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
fileWriteOption
public FileTransformerConfiguration.FileWriteOption fileWriteOption()
The configuredFileTransformerConfiguration.FileWriteOption
-
failureBehavior
public FileTransformerConfiguration.FailureBehavior failureBehavior()
The configuredFileTransformerConfiguration.FailureBehavior
-
executorService
public Optional<ExecutorService> executorService()
The configuredExecutorService
the writes should be executed on.If not set, the default thread pool defined by the underlying
FileSystemProvider
will be used. This will typically be the thread pool defined by theAsynchronousChannelGroup
.
-
position
public Long position()
Exclusively used withFileTransformerConfiguration.FileWriteOption.WRITE_TO_POSITION
. Configures the position, where to start writing to the existing file. The location correspond to the first byte where new data will be written. For example, if128
is configured, bytes 0-127 of the existing file will remain untouched and data will be written starting at byte 128. If not specified, defaults to 0.- Returns:
- The offset at which to start overwriting data in the file.
-
builder
public static FileTransformerConfiguration.Builder builder()
Create aFileTransformerConfiguration.Builder
, used to create aFileTransformerConfiguration
.
-
defaultCreateNew
public static FileTransformerConfiguration defaultCreateNew()
Returns the defaultFileTransformerConfiguration
forFileTransformerConfiguration.FileWriteOption.CREATE_NEW
Always create a new file. If the file already exists,
FileAlreadyExistsException
will be thrown. In the event of an error, the SDK will attempt to delete the file (whatever has been written to it so far).
-
defaultCreateOrReplaceExisting
public static FileTransformerConfiguration defaultCreateOrReplaceExisting()
Returns the defaultFileTransformerConfiguration
forFileTransformerConfiguration.FileWriteOption.CREATE_OR_REPLACE_EXISTING
Create a new file if it doesn't exist, otherwise replace the existing file. In the event of an error, the SDK will NOT attempt to delete the file, leaving it as-is
-
defaultCreateOrAppend
public static FileTransformerConfiguration defaultCreateOrAppend()
Returns the defaultFileTransformerConfiguration
forFileTransformerConfiguration.FileWriteOption.CREATE_OR_APPEND_TO_EXISTING
Create a new file if it doesn't exist, otherwise append to the existing file. In the event of an error, the SDK will NOT attempt to delete the file, leaving it as-is
-
toBuilder
public FileTransformerConfiguration.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<FileTransformerConfiguration.Builder,FileTransformerConfiguration>
-
-