Use double quotes

dir ("RELEASE/abc/${abc_version}")

in groovy Single quotes are a standard Java String while Double quotes are a templatable String

e.g

a = 10
b = "RELEASE/abc/${a}"
c = 'RELEASE/abc/${a}'
print(b)
print('\n')
print(c)

output will be

RELEASE/abc/10
RELEASE/abc/${a}

You can try it here

Answer from Talha Junaid on Stack Overflow
🌐
Groovy
docs.groovy-lang.org › 2.4.9 › html › gapi › groovy › util › FileTreeBuilder.html
FileTreeBuilder (groovy 2.4.9 API)
def tree = new FileTreeBuilder() tree.dir('src') { dir('main') { dir('groovy') { file('Foo.groovy', 'println "Hello"') } } dir('test') { dir('groovy') { file('FooTest.groovy', 'class FooTest extends GroovyTestCase {}') } } }
Discussions

groovy - Get a list of all the files in a directory (recursive) - Stack Overflow
For using FileType, make sure you use the right groovy version: "the class groovy.io.FileType was introduced in Groovy version 1.7.1." see: stackoverflow.com/questions/6317373/… 2014-09-29T12:36:55.653Z+00:00 ... This was displaying the folder names along with its path. Eg: /tmp/directory1 How ... More on stackoverflow.com
🌐 stackoverflow.com
cwd - How to change the current working directory in Groovy - Stack Overflow
This is used as a base for the ... (and therefore not the child directories). Here are three "Work-Arounds" that may work for different scenarios: 1) I KIND OF overcame this for a very specific task... I wanted to implement "cd" as a groovy script.... More on stackoverflow.com
🌐 stackoverflow.com
How to find current base execution directory in groovy (or java)? - Stack Overflow
As an example, when calling c:\scripts\MyScript.groovy from c:\users\Scott\ I wanted to know c:\scripts\. ... Yes, your question isn't worded well. You needed to ask "how to get the location of the class". Glad you found the answer though. 2011-06-27T13:53:45.123Z+00:00 ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... How is the electric field from a positive charge always positive when it has vectors that point in opposite directions... More on stackoverflow.com
🌐 stackoverflow.com
What's the Groovy equivalent to Python's dir()? - Stack Overflow
In Python I can see what methods and fields an object has with: print dir(my_object) What's the equivalent of that in Groovy (assuming it has one)? More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
gist.github.com › yangkun › 5312119
[groovy] list dirs/files (dir first and sort as name) · GitHub
Below is my code, Hopefully, it will useful for someone, I am running this code as a groovy script in Jenkins Pipeline · **@NonCPS def fetFilenamesFromDir(def dir, def list){ dir.eachFileRecurse (FileType.FILES) { file -> file = file.toString() if (file.endsWith("json")){ list << file } } } node('master'){ def list = [] def dir = new File("dirPathToBeDefined") fetFilenamesFromDir(dir,list) for (i in list){ print i print("\n") }** Sign up for free to join this conversation on GitHub.
🌐
Mrhaki
blog.mrhaki.com › 2016 › 05 › groovy-goodness-creating-files-and.html
Groovy Goodness: Creating Files And Directories With Nice DSL Using FileTreeBuilder - Messages from mrhaki
May 17, 2016 - We can use an explicit way of referring ... to play. In the first example we use the explicit method names. We can use the method dir to create directories and the method file to create a file....
🌐
TutorialsPoint
tutorialspoint.com › groovy › groovy_directories.htm
Groovy - Directory Operations
The mkdirs() method creates both a directory and all the parents of the directory. Following example creates "/tmp/user/groovy/bin" directory −
🌐
Programming Idioms
programming-idioms.org › idiom › 106 › get-program-working-directory › 4266 › groovy
Get program working directory, in Groovy
Groovy · def dir = new File('.').absolutePath · Demo · Doc · Ada · C · C++ C# D · Fortran · Go · Haskell · JS · Java · Java · Java · Lua · PHP · Pascal · Perl · Python · Ruby · Rust · with Ada.Directories; use Ada.Directories; Dir : String := Current_Directory; #include <unistd.h> char *dir = getcwd(NULL, 0); Doc ·
🌐
GitHub
gist.github.com › kdabir › 7181617
A groovy directory traverse that excludes given dirs. Change the last closure to do something interesting instead of printing the dir name · GitHub
A groovy directory traverse that excludes given dirs. Change the last closure to do something interesting instead of printing the dir name - dir_traverse.groovy
Find elsewhere
🌐
InfoWorld
infoworld.com › home › software development › programming languages › java
Standard Java/Groovy Directory Properties | InfoWorld
July 4, 2011 - These include user.dir (user directory AKA working directory or current directory), user.home (user’s home directory), java.io.tmpdir (directory for temporary files), and java.home (base directory of applicable JRE installation, often corresponding to $JAVA_HOME or %JAVA_HOME% environment ...
🌐
Mrhaki
blog.mrhaki.com › 2010 › 04 › groovy-goodness-working-on-files-or.html
Groovy Goodness: Working on Files or Directories (or Both) with FileType - Messages from mrhaki
November 26, 2010 - (1..3).each { new File("dir$it").mkdir() } (1..3).each { def file = new File("file$it") file << "Sample content for ${file.absolutePath}" } def currentDir = new File('.') def dirs = [] currentDir.eachFile FileType.DIRECTORIES, { dirs << it.name } assert 'dir1,dir2,dir3' == dirs.join(',') def files = [] currentDir.eachFile(FileType.FILES) { files << it.name } assert 'file1,file2,file3' == files.join(',') def found = [] currentDir.eachFileMatch(FileType.ANY, ~/.*2/) { found << it.name } assert 'dir2,file2' == found.join(',') Tags: Groovy Groovy programming Groovy:Goodness GroovyGoodness:Beginner GroovyGoodness:Files GroovyGoodness:GDK
🌐
Groovy
docs.groovy-lang.org › latest › html › gapi › groovy › util › FileTreeBuilder.html
FileTreeBuilder (Groovy 4.0.26)
def tree = new FileTreeBuilder() tree.dir('src') { dir('main') { dir('groovy') { file('Foo.groovy', 'println "Hello"') } } dir('test') { dir('groovy') { file('FooTest.groovy', 'class FooTest extends GroovyTestCase {}') } } }
🌐
DZone
dzone.com › coding › languages › groovy goodness: creating files and directories with a nice dsl using filetreebuilder
Groovy Goodness: Creating Files and Directories With a Nice DSL Using FileTreeBuilder
June 7, 2016 - In the first example we use the explicit method names. We can use the method dir to create directories and the method file to create a file.
🌐
TutorialsPoint
tutorialspoint.com › groovy › groovy_listing_directories.htm
Groovy - Listing Directories
Groovy provides File class which represents a directory object and provides couple of options to list contents of a directory using File object. File.list() method returns an array of String objects where each string represent the name of the file
🌐
Baeldung
baeldung.com › home › groovy › guide to i/o in groovy
Guide to I/O in Groovy | Baeldung
February 13, 2024 - The eachFile methods throw an IllegalArgumentException if we provide them with a path to a file instead of a directory. Groovy also provides the eachDir methods for working with only directories.
🌐
Apache Software Foundation
archive.apache.org › dist › groovy
groovy - Apache Archive Distribution Directory
Parent Directory - 2.4.10/ 2017-10-04 11:09 - 2.4.11/ 2017-10-04 11:09 - 2.4.12/ 2017-10-04 11:09 - 2.4.13/ 2017-11-22 23:47 - 2.4.14/ 2018-03-02 00:03 - 2.4.15/ 2018-05-04 15:48 - 2.4.16/ 2018-12-13 07:37 - 2.4.17/ 2019-05-10 11:56 - 2.4.18/ 2020-01-14 05:08 - 2.4.19/ 2020-03-03 15:22 - 2.4.20/ 2020-11-05 18:48 - 2.4.21/ 2022-06-17 11:28 - 2.4.5-incubating/ 2015-12-01 19:37 - 2.4.6/ 2016-02-22 08:39 - 2.4.7/ 2017-10-04 11:09 - 2.4.8/ 2017-10-04 11:09 - 2.4.9/ 2017-10-04 11:09 - 2.5.0-alpha-1/ 2017-10-04 11:09 - 2.5.0-beta-1/ 2017-10-04 11:09 - 2.5.0-beta-2/ 2017-10-05 18:16 - 2.5.0-beta-3/ 20