I am trying to read the files present at Sequence of Paths in scala. Below is the sample (pseudo) code:
Sequence
val paths = Seq[String] //Seq of paths v
How about filtering the paths firstly`:
paths
paths.filter(f => new java.io.File(f).exists)
For instance:
Seq("/tmp", "xx").filter(f => new java.io.File(f).exists) // res18: List[String] = List(/tmp)