Skip to content

S3Object.size() return type is Integer, not Long #917

Closed
@trawicjc

Description

@trawicjc

In AWS Java SDK v1, S3ObjectSummary objects returned by AmazonS3.listObjectsV2 return object sizes as long. In v2, S3Object objects returned by S3Client.listObjectsv2 return object sizes as Integer. How do I get correct object sizes in v2 when objects are larger than 2GB?

Expected Behavior

S3Object.size() returns Long

Current Behavior

S3Object.size() returns Integer

Possible Solution

Modify S3Object.size() to return Long such that it accommodates objects larger than 2GB.

Steps to Reproduce (for bugs)

Call S3Client.listObjectsV2(request) and observe the type of the size property in the result contents array.

Context

Attempting to port object size analysis code from SDKv1 to SDKv2 to exploit the simpler API.

Your Environment

  • AWS Java SDK version used: 2.1.3
  • JDK version used: Oracle 1.8.0_161-b12
  • Operating System and version: macOS Mojave 10.14.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions