private ObjectMetadata getObjectMetadataUsingRange(final PresignedUrlDownloadRequest request) {
        PresignedUrlDownloadRequest copy = request.clone();
        S3Object s3Object = null;
        try {
            s3Object = s3.download(copy.withRange(0, 0))
                     .getS3Object();

            return s3Object.getObjectMetadata();
        } catch (AmazonS3Exception exception) {
            // This handles error case when trying a range GET on object with zero size
            if (exception.getStatusCode() == 416 && "InvalidRange".equals(exception.getErrorCode())) {
                return null;
            }
            throw exception;
        } finally {
            if (s3Object != null) {
                S3ObjectInputStream objectContent = s3Object.getObjectContent();
                IOUtils.drainInputStream(objectContent);
                IOUtils.closeQuietly(objectContent, log);
            }
        }
    }
Returns the object metadata using the {@link PresignedUrlDownloadRequest}.
Returns null if object size is zero.
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/transfer/TransferManager.java