Below is my groovy code snippet
def filePath = '/logs/result.txt'
def file = new File(filePath)
echo "${file.exists()}"
Output :
result file.exists() = false
But the file /logs/result.txt is actually present.
Also, In IntelliJ editor, file.exists() is shown with dotted underline.
When I hover mouse over the exists() method it says "No candidates Found for method call file.exists()".