Package net.snowflake.client.api.connection

## Class UploadStreamConfig.Builder

- java.lang.Object
- - net.snowflake.client.api.connection.UploadStreamConfig.Builder

Enclosing class:
  UploadStreamConfig

    public static class UploadStreamConfig.Builder
    extends Object

Builder for creating `UploadStreamConfig` instances.

This builder provides a fluent API for configuring optional upload stream settings. All setter methods return the builder instance for method chaining.

Example:

     UploadStreamConfig config = UploadStreamConfig.builder()
         .setDestPrefix("data/2024")
         .setCompressData(true)
         .build();

### Method Summary

All Methods Instance Methods Concrete Methods
`UploadStreamConfig` `build()` Builds the `UploadStreamConfig` instance.
`UploadStreamConfig.Builder` `setCompressData​(boolean compressData)` Sets whether to automatically compress the data during upload.
`UploadStreamConfig.Builder` `setDestPrefix​(String destPrefix)` Sets the destination prefix (directory path) within the stage.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### setDestPrefix

    public UploadStreamConfig.Builder setDestPrefix​(String destPrefix)

Sets the destination prefix (directory path) within the stage.

This is optional. If not set, files will be uploaded to the root of the stage. Use forward slashes to separate directory levels.

Examples:

- `"data"` - upload to data directory
- `"data/2024/01"` - upload to nested directories
- `null` or empty - upload to stage root (default)

Parameters:
  `destPrefix` - the destination prefix/directory path (can be null or empty for stage root)
Returns:
  this builder instance

#### setCompressData

    public UploadStreamConfig.Builder setCompressData​(boolean compressData)

Sets whether to automatically compress the data during upload.

If set to `true` (default), the driver will compress the data using gzip compression before uploading. This reduces upload time and storage costs. The file will be stored with a .gz extension appended to the destination file name.

If set to `false`, the data is uploaded as-is without compression.

Parameters:
  `compressData` - true to compress the data (default), false to upload uncompressed
Returns:
  this builder instance

#### build

    public UploadStreamConfig build()

Builds the `UploadStreamConfig` instance.

Returns:
  a new `UploadStreamConfig` instance