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

コメント

2件のコメント

  • Murtza

     You can search for a folder by name using the Search endpoint. You can limit the search results to just folders by setting the type parameter to folder. 

     

    Once you have the folder id, you can use the Delete Folder endpoint.

    0
    コメントアクション Permalink
  • kendomen

    Using 's example, I tested this out and it seems to work...

     

            BoxSearchParameters boxSearchParameters = new BoxSearchParameters("ken");  // search by name
            boxSearchParameters.setType("folder");                                     // only return folders
    
            BoxSearch boxSearch = new BoxSearch(userAPI);
    
            List parentFolderId = new ArrayList<>();
            parentFolderId.add("0"); 
            boxSearchParameters.setAncestorFolderIds(parentFolderId);
    
            PartialCollection results = boxSearch.searchRange(0, 10, boxSearchParameters);
            for (Iterator iterator = results.iterator(); iterator.hasNext(); ) {
                BoxItem.Info info = iterator.next();
                System.out.println(info.getName() + " [" + info.getID() + "]");
                BoxFolder boxFolder = (BoxFolder)info.getResource();
                boxFolder.delete(true);
            }
    0
    コメントアクション Permalink

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