Class FolderIterator
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
FolderIterator
यह एक ऐसा ऑब्जेक्ट है जिसकी मदद से स्क्रिप्ट, फ़ोल्डर के बड़े कलेक्शन पर बार-बार कार्रवाई कर सकती हैं. फ़ोल्डर
इटरेटर को DriveApp, File या Folder से ऐक्सेस किया जा सकता है.
// Log the name of every folder in the user's Drive.constfolders=DriveApp.getFolders();while(folders.hasNext()){constfolder=folders.next();Logger.log(folder.getName());}
यह फ़ाइलों या फ़ोल्डर के कलेक्शन में मौजूद अगले आइटम को दिखाता है.
ज़्यादा जानकारी वाला दस्तावेज़
getContinuationToken()
यह एक ऐसा टोकन देता है जिसका इस्तेमाल, इस इटरेशन को बाद में फिर से शुरू करने के लिए किया जा सकता है. यह तरीका तब काम आता है, जब एक बार में किसी इटरेटर को प्रोसेस करने में, तय की गई समयसीमा से ज़्यादा समय लगता है. आम तौर पर, जारी रखने वाले टोकन एक हफ़्ते तक मान्य होते हैं.
वापसी का टिकट
String — यह एक ऐसा टोकन है जिसका इस्तेमाल, इस इटरेशन को उन आइटम के साथ फिर से शुरू करने के लिए किया जा सकता है जो टोकन जनरेट होने के समय, इटरेटर में मौजूद थे.
hasNext()
इससे यह तय होता है कि next() को कॉल करने पर कोई आइटम दिखता है या नहीं.
वापसी का टिकट
Boolean — अगर next() कोई आइटम दिखाता है, तो true; अगर नहीं, तो false.
next()
यह फ़ाइलों या फ़ोल्डर के कलेक्शन में मौजूद अगले आइटम को दिखाता है. अगर कोई आइटम नहीं बचता है, तो यह एक अपवाद दिखाता है.
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 2026-03-06 (UTC) को अपडेट किया गया."],[],["FolderIterator allows iterating over a large collection of folders. Key actions include using `hasNext()` to check for the next item and `next()` to retrieve it. `getContinuationToken()` provides a token to resume iteration later, helpful for large collections. The example shows how to log every folder's name in a user's Drive, demonstrating iteration through the folder collection. The iterator returns folder objects and can throw an exception if no items remain.\n"]]