public static ValidatorException validationError(String message) {
        return new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "File Error", message));
    }
Check the file path to ensure its valid and prevent directory traversal security issues.

@param filePath the file path to test
@param mustExist true if the directory must exist on disk, false if not
@return the updated file path
primefaces/src/main/java/org/primefaces/util/FileUploadUtils.java