Welcome to the new Box Support website. Check out all the details here on what’s changed.

Java Box SDK - How get downloaded file

New post

Comments

2 comments

  • cbetta

     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();
    0
    Comment actions Permalink
  • cbetta

    My bad, that's the same code. Are you actually piping the stream to a file?

    0
    Comment actions Permalink

Please sign in to leave a comment.