While uploading a file, I use BoxFolder#uploadFile(fileContents, fileName) method. It throws an error if a file with the same name exists. In the catch block, I use File#uploadVersion(stream) to upload the new version. This method does not throw any error but the file size of the new version is zero.
If I use BoxFolder#canUpload(fileName, 98734576), this also throws the same error. The new version uploaded in the catch block gets uploaded correctly with the correct size.
I am not sure what gets enabled on backend after this preflight check.
If I am uploading 20 files out of which just 2 files already exist on Box, I would prefer to make 22 API requests instead of 40 API requests.
Versions Used
Java SDK: JDK 8u101
Box sdk - box-java-sdk:2.15.0
While uploading a file, I use BoxFolder#uploadFile(fileContents, fileName) method. It throws an error if a file with the same name exists. In the catch block, I use File#uploadVersion(stream) to upload the new version. This method does not throw any error but the file size of the new version is zero.
If I use BoxFolder#canUpload(fileName, 98734576), this also throws the same error. The new version uploaded in the catch block gets uploaded correctly with the correct size.
I am not sure what gets enabled on backend after this preflight check.
If I am uploading 20 files out of which just 2 files already exist on Box, I would prefer to make 22 API requests instead of 40 API requests.
Versions Used
Java SDK: JDK 8u101
Box sdk - box-java-sdk:2.15.0