BoxItem.Info returns null for various properties
回答済みHello,
I am quite new to Box API and I am just trying to write my first integration with Box Java SDK. I have followed the tutorial and managed to get a list of root folder files:
BoxFolder folder = BoxFolder.getRootFolder(api); for (BoxItem.Info itemInfo : folder) {
if (itemInfo instanceof BoxFile.Info) {
BoxFile.Info fileInto = (BoxFile.Info) itemInfo;
// do something with the fileInfo
}
}
When I call fileInfo.getID() or fileInfo.getName(), I get the correct values. However, fileInfo.getSize() or fileInfo.getModifiedAt() always returns null. Am I doing something wrong?
Thanks for any help.
Filip
-
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()); } }
サインインしてコメントを残してください。
コメント
4件のコメント