Say I have something like this:
new File(\"test\").eachFile() { file-> println file.getName() }
This prints the full filename of eve
The cleanest way.
String fileWithoutExt = file.name.take(file.name.lastIndexOf('.'))