Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
Hi Groovy Geeks
Please help me to get rectify the following code..
String srcDir = "C:/MyTest"
String destDir = "C:/MyTestDest"
File rootDir = new File("$srcDir")
rootDir.each {
println it
File musicDir = new File(it)
if(musicDir.exists() && musicDir.isDirectory()) {
println "1:" + it
musicDir.eachFile { artistDir ->
if (artistDir.isDirectory()) {
println "2:" + artistDir
artistDir.eachFileMatch('.')
}
}
}
}
I'm getting the following error..
Caught: java.io.FileNotFoundException: C:\MyTest (Access is denied)
at FileTest.run(FileTest.groovy:33)
at FileTest.main(FileTest.groovy)
--I want to iterate through the os directories and want to move the directories and files to other destination folder.