Update to Amazon Web Services SDK for Java v2, Amazon Web Services SDK for .NET v3, and Amazon Web Services Tools for PowerShell when using S3 GetObjectAttributes API

by John Viegas | on

This blog post is intended to notify customers using the Amazon Web Services SDK for Java v2.x, Amazon Web Services SDK for .NET v3.x, or Amazon Web Services Tools for PowerShell v4.x, of a change in parameter type for the S3 GetObjectAttributes API. This change may require a type definition change in your code.

On September 20, 2023, we released a fix for an issue that can cause a NumberFormatException (Java) or FormatException (.Net, Powershell) when calling the GetObjectAttributes API. The following SDK versions contain this fix:

  • Amazon Web Services SDK for Java v2.20.152
  • Amazon Web Services SDK for .NET v3.7.649.0
  • Amazon Web Services Tools for PowerShell v4.1.419

The specific changes for each SDK are described below and may require you to update a type definition in your code.

Java v2.x:

The objectParts() method on the GetObjectAttributeResponse class returns a collection of ObjectPart instances associated with a multipart upload. After this change, calling ObjectPart.size() on one of the parts in this collection will return a Long, while it currently returns an Integer. Please update your code to handle this type change.

Net v3.x:

The ObjectParts property on the GetObjectAttributesResponse class contains a collection of ObjectPart instances associated with a multipart upload. After this change, calling ObjectPart.Size on one of the parts in this collection will return a long, while it currently returns an int. Please update your code to handle this type change.

Amazon Web Services Tools For PowerShell v4.x:

The ObjectParts property on the output from Get-S3ObjectAttribute contains a collection of ObjectPart instances associated with a multipart upload. After this change, calling ObjectPart.Size on one of the parts in this collection will return a long, while it currently returns an int. Please update your code to handle this type change.

Conclusion

We value your feedback so if you have any questions, comments, concerns, or ideas, please open a GitHub issue on the respective GitHub page for the tool. Repository links are below.

https://github.com/aws/aws-sdk-java-v2
https://github.com/aws/aws-sdk-net
https://github.com/aws/aws-tools-for-powershell

Hayden Baker

John Viegas

John Viegas serves as a Software Development Engineer on the Java SDK team at Amazon Web Services (Amazon Web Services). With a passion for enhancing the developer experience, he actively engages in projects and tools designed to elevate software development. For further insights into his contributions, feel free to explore his GitHub profile under the handle @joviegas.