add class Path

format issue
it should be "public String getFileNameWithExtension()"

Also, it seems you are using "tab", set "tab" to be "2 spaces"