
Untitled
By: a guest on
Mar 5th, 2012 | syntax:
Scala | size: 0.57 KB | hits: 62 | expires: Never
import java.nio.file.DirectoryStream // this is Iterable[Path]
import scala.collection.JavaConversions._
// there's a file entry in directory on which following loops should return
// this works
val dirs = Files.newDirectoryStream(appDir)
val it = dirs.iterator
while (it.hasNext) { // do something and return
}
throw new ArchiveNotFoundException(this, name, suffix)
// this doesn't work
val dirs = Files.newDirectoryStream(appDir)
for (path <- dirs) { // do something and return
}
throw new ArchiveNotFoundException(this, name, suffix)