yuin #853(2007/07/14 16:14 GMT) [ Scala ] Rating1/1=1.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14
import java.io._ object FileUtil { def removeFilesBySuffix(d:String, s:String):Unit = { removeFilesBySuffix(new File(d), s) } def removeFilesBySuffix(d:File, s:String):Unit = { d.list.foreach(f => { val c = new File(d, f) if(c.isDirectory) removeFilesBySuffix(c, s) else if(f.endsWith(s)) c.delete }) } }
Rating1/1=1.00-0+
[ reply ]
yuin
#853()
[
Scala
]
Rating1/1=1.00
import java.io._ object FileUtil { def removeFilesBySuffix(d:String, s:String):Unit = { removeFilesBySuffix(new File(d), s) } def removeFilesBySuffix(d:File, s:String):Unit = { d.list.foreach(f => { val c = new File(d, f) if(c.isDirectory) removeFilesBySuffix(c, s) else if(f.endsWith(s)) c.delete }) } }Rating1/1=1.00-0+
[ reply ]