I love groovy. It is very powerful script, and we use it everywhere. Recently on Jenkins server where we are trying to get some files that resides on the virtual drive, created by subst command. The problem is that it seems that groovy does not supports virtual drives, but I did not find any confirmation on this. Is this true, is there any workaround for this?
Here is the sample code we use:
import groovy.io.FileType
def list = []
//the original file path for T: is C:\Users\MyUser\workspace\MyProject\src\test\data
def dir = new File("T:" + "\\")
dir.eachFile (FileType.FILES) { file ->
list << file
}
list.each{
println "${it}"
}
The results we got is:
[EnvInject] - Evaluating the Groovy script content [EnvInject] - [ERROR] - Problems occurs on injecting env vars defined in the build wrapper: org.jenkinsci.lib.envinject.EnvInjectException: Failed to evaluate the script. java.io.FileNotFoundException: T:. See system log for more info
Any help is appreciated.