AWS Developer Tools Blog

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

This blog post is intended to notify customers using the AWS SDK for Java v2.x, AWS SDK for .NET v3.x, or AWS 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:

  • AWS SDK for Java v2.20.152
  • AWS SDK for .NET v3.7.649.0
  • AWS 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.

AWS 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 (AWS). 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.