Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

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.