I am using the latest Box SDK for interacting with the Box API. I am able to successfully upload, download, delete and upload new version of a file.
However, I am unable to to delete one file version out of many, as suggested on the SDK page :
BoxDefaultRequestObject requestObj = new BoxDefaultRequestObject();
requestObject.getRequestExtras.setIfMatch(etag); //etag is file version starting from 0
boxClient.getFilesManager().deleteFile(fileId, requestObj);
This fails to delete the version and instead deletes the entire file.
Similarly, I am unable to download a specific file version either. Code for download :
BoxDefaultRequestObject downloadReq = new BoxDefaultRequestObject();
downloadReq.getRequestExtras().setIfMatch(versionId);
InputStream is = boxClient.getFilesManager().downloadFile(fileId, downloadReq);
This downloads the latest version only. Can anyone suggest how to make it work?