Move isValidFilePath to the only class that needs it.