82

Scala 获取指定目录所有文件-12201918-51CTO博客

 6 years ago
source link: http://blog.51cto.com/12211918/2068929
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
//获取任意多个目录下所有文件defgetFiles(inputs:File*):Seq[File]={inputs.filter(_.isFile)++inputs.filter(_.isDirectory).flatMap(dir=>getFiles(dir.listFiles:_*))}//获取指定单个目录下所有文件defgetFiles1(dir:File):Array[File]=

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK