I cannot download the empty file txt using Java SDK
CompletedBoxFile file = new BoxFile(boxAPIConnection, "Some-id");
try (FileOutputStream stream = new FileOutputStream(fi)) {
file.download(stream);
// Do Sth
}
At the line file.download(stream) I got an error
java.lang.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[])" because "input" is nullat com.box.sdk.BinaryBodyUtils.writeStreamTo(BinaryBodyUtils.java:55)
at com.box.sdk.BinaryBodyUtils.writeStream(BinaryBodyUtils.java:41)
at com.box.sdk.BoxFile.download(BoxFile.java:311)
at com.box.sdk.BoxFile.download(BoxFile.java:298)
I look at the lib of box sdk and see that this line got nullpointer exception beacause the input is null. This only happens when I try to upload an empty txt file then download it.
Please sign in to leave a comment.
Comments
1 comment