You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BoxDownload#getOutputFile() is documented as returning
the output file for the download.
But it has a return value of null hard coded.
Consider the following snippet. The assertion at the bottom will fail, though it seems semantically reasonable and the documentation does not suggest it to be incorrect.
BoxApiFileboxApiFile;
FiledownloadTarget;
StringfileId;
// Some setup...FilesameAsDownloadTarget = boxApiFile.getDownloadRequest(downloadTarget, fileId).send().getOutputFile();
assertdownloadTarget.equals(sameAsDownloadTarget);
That's odd, the method in BoxDownload is overridden in BoxRequestDownload to return the file provided or a newly created file inside the directory provided. I'll test to see if this is indeed a bug, but BoxDownload is supposed to return null by default with its values changed through overriding.
I tried a test similar to yours and getOutputFile does return a File for me. If you're getting something different can you post your full source? Might be a particular file.
I gave you the wrong example code. We were using the variant of BoxApiFile#getDownloadRequest() that takes a OutputStream. I figured I should still be able to get the output file but there's not really way to do so.
I would prefer to see an IllegalStateException instead of returning null if calling getOutputFile() on an object of the stream variant, but this issue is definitely closed.
BoxDownload#getOutputFile()
is documented as returningBut it has a return value of
null
hard coded.Consider the following snippet. The assertion at the bottom will fail, though it seems semantically reasonable and the documentation does not suggest it to be incorrect.
https://github.com/box/box-android-content-sdk/blob/master/box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxDownload.java#L94
The text was updated successfully, but these errors were encountered: