if (getSecondDeclarationAuthorizationInputStream() != null) { String extension = getExtension(getSecondDeclarationAuthorizationFileName()); String filename = "secondCarDeclarationAuthorization" + extension; writeParkingFile(parkingRequest, filePath, filename,
if (getSecondDeclarationAuthorizationInputStream() != null) { writeParkingFile(parkingRequest, filePath, getSecondDeclarationAuthorizationFileName(),
        protected void writeParkingFiles(ParkingRequest parkingRequest, FilePath filePath) {            if (getDriverLicenseInputStream() != null) {                String extension = getExtension(getDriverLicenseFileName());                String filename = "driverLicense" + extension;                writeParkingFile(parkingRequest, filePath, filename, ParkingDocumentType.DRIVER_LICENSE,                        getDriverLicenseInputStream());            }            if (getFirstCarOwnerIdInputStream() != null) {                String extension = getExtension(getFirstCarOwnerIdFileName());                String filename = "firstCarOwnerId" + extension;                writeParkingFile(parkingRequest, filePath, filename,                        ParkingDocumentType.FIRST_CAR_OWNER_ID, getFirstCarOwnerIdInputStream());            }            if (getFirstCarPropertyRegistryInputStream() != null) {                String extension = getExtension(getFirstCarPropertyRegistryFileName());                String filename = "firstCarPropertyRegistry" + extension;                                writeParkingFile(parkingRequest, filePath, filename,                        ParkingDocumentType.FIRST_CAR_PROPERTY_REGISTER,                        getFirstCarPropertyRegistryInputStream());            }            if (getFirstDeclarationAuthorizationInputStream() != null) {                String extension = getExtension(getFirstDeclarationAuthorizationFileName());                String filename = "firstCarDeclarationAuthorization" + extension;                                writeParkingFile(parkingRequest, filePath, filename,                        ParkingDocumentType.FIRST_DECLARATION_OF_AUTHORIZATION,                        getFirstDeclarationAuthorizationInputStream());            }            if (getFirstInsuranceInputStream() != null) {                String extension = getExtension(getFirstInsuranceFileName());                String filename = "firstCarInsurance" + extension;                                writeParkingFile(parkingRequest, filePath, filename,                        ParkingDocumentType.FIRST_CAR_INSURANCE, getFirstInsuranceInputStream());            }            if (getSecondCarOwnerIdInputStream() != null) {                String extension = getExtension(getSecondCarOwnerIdFileName());                String filename = "secondCarOwnerId" + extension;                                  writeParkingFile(parkingRequest, filePath, filename,                        ParkingDocumentType.SECOND_CAR_OWNER_ID, getSecondCarOwnerIdInputStream());            }            if (getSecondCarPropertyRegistryInputStream() != null) {                String extension = getExtension(getSecondCarPropertyRegistryFileName());                String filename = "secondCarPropertyRegistry" + extension;                                 writeParkingFile(parkingRequest, filePath, filename,                        ParkingDocumentType.SECOND_CAR_PROPERTY_REGISTER,                        getSecondCarPropertyRegistryInputStream());            }            if (getSecondDeclarationAuthorizationInputStream() != null) {                String extension = getExtension(getSecondDeclarationAuthorizationFileName());                String filename = "secondCarDeclarationAuthorization" + extension;                                 writeParkingFile(parkingRequest, filePath, filename,                        ParkingDocumentType.SECOND_DECLARATION_OF_AUTHORIZATION,                        getSecondDeclarationAuthorizationInputStream());            }            if (getSecondInsuranceInputStream() != null) {                String extension = getExtension(getSecondInsuranceFileName());                String filename = "secondCarInsurance" + extension;                                  writeParkingFile(parkingRequest, filePath, filename,                        ParkingDocumentType.SECOND_CAR_INSURANCE, getSecondInsuranceInputStream());            }        }