如何解决如何从grails中的控制器操作中搜索驱动器中的文件夹?
| 我需要从控制器action.d中搜索D驱动器中的命名文件夹。 在此先感谢 拉克西米解决方法
class MyController {
def findDir = {
String dirName = \'nameOfDirectoryToMatch\'
new File(\'D:/\').eachDirMatch(dirName) {File dir ->
// put the code to handle the matching dir(s) here.
// In this example we just print out the full path
println dir.absolutePath
}
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。