poly.util.io.DirectoryIO.scala Maven / Gradle / Ivy
The newest version!
package poly.util.io
import java.io._
/**
* @author Tongfei Chen ([email protected]).
*/
object DirectoryIO {
def listFiles(dir: String) = new File(dir).listFiles()
def recursivelyListFiles(dir: String): Seq[File] = {
val files = new File(dir).listFiles()
files.view.filter(!_.isDirectory) ++ files.view.filter(_.isDirectory).flatMap(f => recursivelyListFiles(f.getAbsolutePath))
}
}