if (parkingRequestFactory.getFirstCarOwnerIdFileName() != null) {
if (parkingRequestFactory.getFirstCarOwnerIdInputStream() != null) {
    private boolean areFileNamesValid(ParkingRequestFactory parkingRequestFactory,            HttpServletRequest request) {        ActionMessages actionMessages = getActionMessages(request);        boolean result = true;        if (parkingRequestFactory.getDriverLicenseFileName() != null) {            if (!validateFileName(parkingRequestFactory.getDriverLicenseFileName())) {                actionMessages.add("driverLicenseMessage",                        new ActionMessage("error.file.extension"));                result = false;            }            if(parkingRequestFactory.getDriverLicenseFileSize() > ParkingFile.MAX_FILE_SIZE){                actionMessages.add("driverLicenseMessage", new ActionMessage(                "error.file.size"));                result = false;            }        }        if (parkingRequestFactory.getFirstCarOwnerIdFileName() != null) {            if (!validateFileName(parkingRequestFactory.getFirstCarOwnerIdFileName())) {                actionMessages.add("firstCarOwnerIdMessage", new ActionMessage(                        "error.file.extension"));                result = false;            }            if(parkingRequestFactory.getFirstCarOwnerIdFileSize() > ParkingFile.MAX_FILE_SIZE){                actionMessages.add("firstCarOwnerIdMessage", new ActionMessage(                "error.file.size"));                result = false;            }        }        if (parkingRequestFactory.getFirstCarPropertyRegistryFileName() != null) {            if (!validateFileName(parkingRequestFactory.getFirstCarPropertyRegistryFileName())) {                actionMessages.add("firstCarPropertyRegistryMessage", new ActionMessage(                        "error.file.extension"));                result = false;            }            if(parkingRequestFactory.getFirstCarPropertyRegistryFileSize() > ParkingFile.MAX_FILE_SIZE){                actionMessages.add("firstCarPropertyRegistryMessage", new ActionMessage(                "error.file.size"));                result = false;            }        }        if (parkingRequestFactory.getFirstDeclarationAuthorizationFileName() != null) {            if (!validateFileName(parkingRequestFactory.getFirstDeclarationAuthorizationFileName())) {                actionMessages.add("firstDeclarationAuthorizationMessage", new ActionMessage(                        "error.file.extension"));                result = false;            }            if(parkingRequestFactory.getFirstDeclarationAuthorizationFileSize() > ParkingFile.MAX_FILE_SIZE){                actionMessages.add("firstDeclarationAuthorizationMessage", new ActionMessage(                "error.file.size"));                result = false;            }        }        if (parkingRequestFactory.getFirstInsuranceFileName() != null) {            if (!validateFileName(parkingRequestFactory.getFirstInsuranceFileName())) {                actionMessages.add("firstInsuranceMessage", new ActionMessage(                        "error.file.extension"));                result = false;            }            if(parkingRequestFactory.getFirstInsuranceFileSize() > ParkingFile.MAX_FILE_SIZE){                actionMessages.add("firstInsuranceMessage", new ActionMessage(                "error.file.size"));                result = false;            }        }        if (parkingRequestFactory.getSecondCarOwnerIdFileName() != null) {            if (!validateFileName(parkingRequestFactory.getSecondCarOwnerIdFileName())) {                actionMessages.add("secondCarOwnerIdMessage", new ActionMessage(                        "error.file.extension"));                result = false;            }            if(parkingRequestFactory.getSecondCarOwnerIdFileSize() > ParkingFile.MAX_FILE_SIZE){                actionMessages.add("secondCarOwnerIdMessage", new ActionMessage(                "error.file.size"));                result = false;            }        }        if (parkingRequestFactory.getSecondCarPropertyRegistryFileName() != null) {            if (!validateFileName(parkingRequestFactory.getSecondCarPropertyRegistryFileName())) {                actionMessages.add("secondCarPropertyRegistryMessage", new ActionMessage(                        "error.file.extension"));                result = false;            }            if(parkingRequestFactory.getSecondCarPropertyRegistryFileSize() > ParkingFile.MAX_FILE_SIZE){                actionMessages.add("secondCarPropertyRegistryMessage", new ActionMessage(                "error.file.size"));                result = false;            }        }        if (parkingRequestFactory.getSecondDeclarationAuthorizationFileName() != null) {            if (!validateFileName(parkingRequestFactory.getSecondDeclarationAuthorizationFileName())) {                actionMessages.add("secondDeclarationAuthorizationMessage", new ActionMessage(                        "error.file.extension"));                result = false;            }            if(parkingRequestFactory.getSecondDeclarationAuthorizationFileSize() > ParkingFile.MAX_FILE_SIZE){                actionMessages.add("secondDeclarationAuthorizationMessage", new ActionMessage(                "error.file.size"));                result = false;            }        }        if (parkingRequestFactory.getSecondInsuranceFileName() != null) {            if (!validateFileName(parkingRequestFactory.getSecondInsuranceFileName())) {                actionMessages.add("secondInsuranceMessage", new ActionMessage(                        "error.file.extension"));                result = false;            }            if(parkingRequestFactory.getSecondInsuranceFileSize() > ParkingFile.MAX_FILE_SIZE){                actionMessages.add("secondInsuranceMessage", new ActionMessage(                "error.file.size"));                result = false;            }        }        return result;    }