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

コメント

2件のコメント

  • Peter Christensen

    hi Ritika

    You can use the BoxItem.Info.getType() to work out the type of items in the folder. Either File,Folder or Weblink

    https://github.com/box/box-java-sdk/blob/main/doc/folders.md#get-a-folders-items

    For root folder you could do something like this:

    BoxFolder folder = new BoxFolder(api, "0");
    for (BoxItem.Info itemInfo : folder) {
    if (itemInfo.getType().equals("web_link") {
    BoxWeblink.Info weblinkInfo = (BoxWeblink.Info) itemInfo;
    // Do something with the weblink.
    } else if (itemInfo.getType().equals("file") { BoxFile.Info fileInfo = (BoxFile.Info) itemInfo; // Do something with the file. } else if (itemInfo.getType().equals("folder") { BoxFolder.Info folderInfo = (BoxFolder.Info) itemInfo; // Do something with the folder. } }

    Best regards
    Peter Christensen, Platform Solutions Engineer, Box

    0
    コメントアクション Permalink
  • Ritika raina

    Thanks Peter Christensen

    0
    コメントアクション Permalink

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