Let's put this check inside Files.containsInvalidCharacters because this function shows the notification to the user.
Maybe the function deserves a new name then.