uploadcare / uploadcare-java

Java API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
https://uploadcare.com
Apache License 2.0
5 stars 13 forks source link

Expand file size property from int to long #45

Closed baileyatwork closed 2 years ago

baileyatwork commented 2 years ago

Expand file size property from int to long to fix issue with reading files that are larger than 2.1 GB.

Description

Currently, when reading files greater than 2147483647 bytes (~2.1 GB) via Client.getFiles(), I get the following error: com.fasterxml.jackson.core.exc.InputCoercionException: Numeric value (2163264498) out of range of int (-2147483648 - 2147483647) ... ! Causing: com.fasterxml.jackson.databind.JsonMappingException: Numeric value (2163264498) out of range of int (-2147483648 - 2147483647) ! at [Source: (StringReader); line: 1, column: 67438] (through reference chain: com.uploadcare.data.FilePageData["results"]->java.util.ArrayList[98]->com.uploadcare.data.FileData["size"])

This change changes the size property from type int to long to fix this issue. NOTE: this is a breaking change, because it is changing the interface of the output.