I have following Groovy script where I'm trying to fetch the directory name and the file name:
File dir = new File("C://Users//avidCoder//Project")
log.info dir //Fetching the directory path
String fileName = "Demo_Data" + ".json"
log.info fileName //Fetching the file name
String fullpath = dir + "\\" + fileName
log.info fullpath //Fetching the full path gives error
However when I run it, I get the following exception:
"java.io.File.plus() is applicable for arguments type"
Why does creating fullpath
variable throws this exception?