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

BoxItem.Info returns null for various properties

Answered
New post

Comments

4 comments

  • smartsachin

    Could you please check you need to use "fileInto" or "fileInfo" ?

    0
    Comment actions Permalink
  • FilipRachunek

    That was a typo. This is the correct line:

     

    BoxFile.Info fileInfo = (BoxFile.Info) itemInfo;
    0
    Comment actions Permalink
  • kendomen

    It's one more call.

     

           for (BoxItem.Info item : items) {
              if (item instanceof BoxFile.Info) {
                  BoxFile.Info fileInto = (BoxFile.Info) item;
                  System.out.println(item.getName());
    
                  BoxFile boxFile = new BoxFile(userApi, fileInto.getID());
                  System.out.println(boxFile.getInfo().getSize());
                  System.out.println(boxFile.getInfo().getModifiedAt());
              }
          }
    0
    Comment actions Permalink
  • FilipRachunek

    Yes, it works now. Thanks, you saved me. 🙂 I just hope the extra line does not do another call to the Box API server, which could create a performance issue if a folder contains too many files.

    0
    Comment actions Permalink

Please sign in to leave a comment.