发送反馈
  
   
 
  
    
      Class FileIterator
    
    
      
      
      使用集合让一切井井有条
     
    
      
      根据您的偏好保存内容并对其进行分类。
     
   
     
  
  
  
   
  
  
    
    
    
File 
一个迭代器,可让脚本迭代可能非常大的文件集合。您可以通过 Drive Folder 
// Log the name of every file in the user's Drive. 
const   files   =   DriveApp . getFiles (); 
while   ( files . hasNext ())   { 
   const   file   =   files . next (); 
   Logger . log ( file . getName ()); 
}  
详细文档 
get
 
获取一个令牌,以便稍后恢复此迭代。如果在一次执行中处理迭代器会超出最长执行时间,此方法非常有用。接续令牌通常有效期为一周。
返回 
String - 一个接续令牌,可用于使用令牌生成时迭代器中保留的项来继续此迭代
 
 
has
 
确定调用 next() 
返回 
Boolean - 如果 next() true;否则为 false
 
 
next()
 
获取文件或文件夹集合中的下一个项。如果没有剩余项,则会抛出异常。
返回 
File 
 
 
 
  
  
  
     
  
    
    
      
    
     
  
       
         
  
  
    
    发送反馈
  
   
 
       
    
    
  
  
 
  如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
  最后更新时间 (UTC):2025-07-26。
 
 
  
  
    
    
    
      
  
  
    需要向我们提供更多信息?
  
   
 
     
  
  
    
      [[["易于理解","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"]],["最后更新时间 (UTC):2025-07-26。"],[],[]]