actionMessages.add("firstDeclarationAuthorizationFileName", new ActionMessage( "error.fileName.extension"));
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"));
    private boolean areFileNamesValid(ParkingRequestFactory parkingRequestFactory,            HttpServletRequest request) {        ActionMessages actionMessages = getActionMessages(request);        boolean result = true;        if (parkingRequestFactory.getDriverLicenseFileName() != null) {            if (!validateFileName(parkingRequestFactory.getDriverLicenseFileName())) {                actionMessages.add("driverLicenseFileName",                        new ActionMessage("error.fileName.extension"));                result = false;            }        }        if (parkingRequestFactory.getFirstCarOwnerIdFileName() != null) {            if (!validateFileName(parkingRequestFactory.getFirstCarOwnerIdFileName())) {                actionMessages.add("firstCarOwnerIdFileName", new ActionMessage(                        "error.fileName.extension"));                result = false;            }        }        if (parkingRequestFactory.getFirstCarPropertyRegistryFileName() != null) {            if (!validateFileName(parkingRequestFactory.getFirstCarPropertyRegistryFileName())) {                actionMessages.add("firstCarPropertyRegistryFileName", new ActionMessage(                        "error.fileName.extension"));                result = false;            }        }        if (parkingRequestFactory.getFirstDeclarationAuthorizationFileName() != null) {            if (!validateFileName(parkingRequestFactory.getFirstDeclarationAuthorizationFileName())) {                actionMessages.add("firstDeclarationAuthorizationFileName", new ActionMessage(                        "error.fileName.extension"));                result = false;            }        }        if (parkingRequestFactory.getFirstInsuranceFileName() != null) {            if (!validateFileName(parkingRequestFactory.getFirstInsuranceFileName())) {                actionMessages.add("firstInsuranceFileName", new ActionMessage(                        "error.fileName.extension"));                result = false;            }        }        if (parkingRequestFactory.getSecondCarOwnerIdFileName() != null) {            if (!validateFileName(parkingRequestFactory.getSecondCarOwnerIdFileName())) {                actionMessages.add("secondCarOwnerIdFileName", new ActionMessage(                        "error.fileName.extension"));                result = false;            }        }        if (parkingRequestFactory.getSecondCarPropertyRegistryFileName() != null) {            if (!validateFileName(parkingRequestFactory.getSecondCarPropertyRegistryFileName())) {                actionMessages.add("secondCarPropertyRegistryFileName", new ActionMessage(                        "error.fileName.extension"));                result = false;            }        }        if (parkingRequestFactory.getSecondDeclarationAuthorizationFileName() != null) {            if (!validateFileName(parkingRequestFactory.getSecondDeclarationAuthorizationFileName())) {                actionMessages.add("secondDeclarationAuthorizationFileName", new ActionMessage(                        "error.fileName.extension"));                result = false;            }        }        if (parkingRequestFactory.getSecondInsuranceFileName() != null) {            if (!validateFileName(parkingRequestFactory.getSecondInsuranceFileName())) {                actionMessages.add("secondInsuranceFileName", new ActionMessage(                        "error.fileName.extension"));                result = false;            }        }        return result;    }