Example usage for com.amazonaws.services.s3.transfer TransferManager getConfiguration

List of usage examples for com.amazonaws.services.s3.transfer TransferManager getConfiguration

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.transfer TransferManager getConfiguration.

Prototype

public TransferManagerConfiguration getConfiguration() 

Source Link

Document

Returns the configuration which specifies how this TransferManager processes requests.

Usage

From source file:jenkins.plugins.itemstorage.s3.Uploads.java

License:Open Source License

public void startUploading(TransferManager manager, File file, InputStream inputStream, Destination dest,
        ObjectMetadata metadata) throws AmazonServiceException {
    final PutObjectRequest request = new PutObjectRequest(dest.bucketName, dest.objectName, inputStream,
            metadata);//from   w  w  w.j av a 2 s  .  co  m

    // Set the buffer size (ReadLimit) equal to the multipart upload size,
    // allowing us to resend data if the connection breaks.
    request.getRequestClientOptions().setReadLimit(MULTIPART_UPLOAD_THRESHOLD);
    manager.getConfiguration().setMultipartUploadThreshold((long) MULTIPART_UPLOAD_THRESHOLD);

    final Upload upload = manager.upload(request);
    startedUploads.put(file, upload);
    openedStreams.put(file, inputStream);
}