Java Box SDK - How get downloaded file
I am trying to get the file content downloaded with the Box SDK in Java using the example code:
BoxFile file = new BoxFile(api, "id");
BoxFile.Info info = file.getInfo();
FileOutputStream stream = new FileOutputStream(info.getName());
file.download(stream);
stream.close();
But when I debug it, I can't find a way to get the contents of the file. How could I get it?
-
to download the file use the following code:
BoxFile file = new BoxFile(api, "id"); List versions = file.getVersions(); BoxFileVersion firstVersion = versions.get(0); FileOutputStream stream = new FileOutputStream(firstVersion.getName()); firstVersion.download(stream); stream.close();
Please sign in to leave a comment.
Comments
2 comments