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
6 stars 13 forks source link

Updated result field on CopyFileData to be a String. #10

Closed joeyvmason closed 4 years ago

joeyvmason commented 8 years ago

The ObjectMapper is unable to process CopyFileData response because data field is of type String and not of FileData:

Caused by: com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class com.uploadcare.data.FileData] from String value ('s3://foobar/uploadcare/80a58309-d300-4ecd-a54d-a95fb50054f4.wav'); no single-String constructor/factory method at [Source: {"type":"url","result":"s3://foobar/uploadcare/80a58309-d300-4ecd-a54d-a95fb50054f4.wav"}; line: 1, column: 24](through reference chain: com.uploadcare.data.CopyFileData["result"])

raphaelnew commented 4 years ago

@joeyvmason Thanks for the PR, we improved Copy functionality in v3.3.0, changed the result of the copy that returned to client, now you can directly use file or url from the result no need to process data yourself. Look at Client.copyFileLocalStorage() and Client.copyFileRemoteStorage() methods.