@Override
    public int insertDataToTable(ResultSet resultSet, int taskId) throws Exception {

        URI s3Uri = new URI(options.getSinkConnect());
        // Get Service Endpoint
        // Secure by default
        String serviceEndpoint = "https://";
        if (!isSecuereConnection()) {
            serviceEndpoint = "http://";
        }

        // Get Service Port
        String servicePort = "";
        if (s3Uri.getPort() != -1) {
            servicePort = ":" + s3Uri.getPort();
        }

        serviceEndpoint = serviceEndpoint + s3Uri.getHost() + servicePort;
        LOG.debug("Using serviceEndpoint: " + serviceEndpoint);

        // Get Bucket name
        String bucketName = s3Uri.getPath().replaceAll("/$", "");
        if (keyFileName == null) {
            this.keyFileName = bucketName.substring(bucketName.lastIndexOf("/") + 1);
            bucketName = bucketName.replace(keyFileName,"").replaceAll("/$", "");
        }
        LOG.info("Bucket Name: {}, File Name: {}", bucketName, keyFileName);

        // S3 Client
        System.setProperty(SDKGlobalConfiguration.DISABLE_CERT_CHECKING_SYSTEM_PROPERTY, "true");
        AWSCredentials credentials = new BasicAWSCredentials(accessKey, secretKey);
        AmazonS3 s3Client = AmazonS3ClientBuilder
                .standard()
                .withRegion("")
                .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(serviceEndpoint, null))
                .withPathStyleAccessEnabled(true)
                .withCredentials(new AWSStaticCredentialsProvider(credentials))
                .build();

        if (!isObjectPerRow()) {
            // All rows are only one File object in s3
            return putFileToS3(resultSet, taskId, s3Client, bucketName);
        } else {
            // Each row is a different object in s3
            return putObjectToS3(resultSet, taskId, s3Client, bucketName);
        }

    }
Load ReplicaDB custom options for Amazon S3
src/main/java/org/replicadb/manager/S3Manager.java