Example usage for com.amazonaws.services.s3.model GeneratePresignedUrlRequest putCustomRequestHeader

List of usage examples for com.amazonaws.services.s3.model GeneratePresignedUrlRequest putCustomRequestHeader

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.model GeneratePresignedUrlRequest putCustomRequestHeader.

Prototype

public String putCustomRequestHeader(String name, String value) 

Source Link

Document

Put a new custom header to the map of custom header names to custom header values, and return the previous value if the header has already been set in this map.

Usage

From source file:org.icgc.dcc.storage.server.repository.s3.S3URLGenerator.java

License:Open Source License

@Override
public String getDownloadPartUrl(String bucketName, ObjectKey objectKey, Part part, Date expiration) {
    GeneratePresignedUrlRequest req = new GeneratePresignedUrlRequest(bucketName, objectKey.getKey(),
            HttpMethod.GET);/*from  ww  w.j a  v a 2s. co m*/
    req.setExpiration(expiration);

    req.putCustomRequestHeader(HttpHeaders.RANGE, Parts.getHttpRangeValue(part));
    return s3Client.generatePresignedUrl(req).toString();
}