新しいBoxサポートサイトへようこそ。 変更点の詳細はこちらをご確認ください .

BoxItem.Info returns null for various properties

回答済み
新規投稿

コメント

4件のコメント

  • smartsachin

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

    0
    コメントアクション パーマリンク
  • FilipRachunek

    That was a typo. This is the correct line:

     

    BoxFile.Info fileInfo = (BoxFile.Info) itemInfo;
    0
    コメントアクション パーマリンク
  • 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
    コメントアクション パーマリンク
  • 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
    コメントアクション パーマリンク

サインインしてコメントを残してください。