Java Code Examples for org.apache.commons.lang.StringUtils#isNotEmpty()

The following examples show how to use org.apache.commons.lang.StringUtils#isNotEmpty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Neo4JOutput.java    From knowbi-pentaho-pdi-neo4j-output with Apache License 2.0 6 votes vote down vote up
/**
 * Update the usagemap.  Add all the labels to the node usage.
 *
 * @param labels
 * @param usage
 */
protected void updateUsageMap( List<String> labels, GraphUsage usage ) throws KettleValueException {

  if ( labels == null ) {
    return;
  }

  Map<String, Set<String>> stepsMap = data.usageMap.get( usage.name() );
  if ( stepsMap == null ) {
    stepsMap = new HashMap<>();
    data.usageMap.put( usage.name(), stepsMap );
  }

  Set<String> labelSet = stepsMap.get( getStepname() );
  if ( labelSet == null ) {
    labelSet = new HashSet<>();
    stepsMap.put( getStepname(), labelSet );
  }

  for ( String label : labels ) {
    if ( StringUtils.isNotEmpty( label ) ) {
      labelSet.add( label );
    }
  }
}
 
Example 2
Source File: CSVSegmentLoader.java    From indexr with Apache License 2.0 6 votes vote down vote up
private void loadFile(String path) throws IOException {
    SimpleRow.Builder rowBuilder = SimpleRow.Builder.createByColumnSchemas(Arrays.asList(columnSchemas));
    try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF-8"))) {
        String line;
        while (StringUtils.isNotEmpty(line = reader.readLine()) && !interrupted) {
            String[] vals = line.split(spliter);
            try {
                for (int colId = 0; colId < schema.schema.columns.size(); colId++) {
                    int valIndex = valIndexes[colId];
                    rowBuilder.appendStringFormVal(getValue(vals, valIndex));
                }
            } catch (NumberFormatException e) {
                System.out.printf("error csv line: [%s]", line);
                e.printStackTrace();
            }
            segmentGen.add(rowBuilder.buildAndReset());
            rowCount++;
        }
    }
}
 
Example 3
Source File: Fido2DeviceService.java    From oxTrust with MIT License 6 votes vote down vote up
public GluuFido2Device getFido2DeviceById(String userId, String id) {
	GluuFido2Device f2d = null;
	try {
		String dn = getDnForFido2Device(id, userId);
		if (StringUtils.isNotEmpty(userId)) {
			f2d = ldapEntryManager.find(GluuFido2Device.class, dn);
		} else {
			Filter filter = Filter.createEqualityFilter("oxId", id);
			f2d = ldapEntryManager.findEntries(dn, GluuFido2Device.class, filter).get(0);
		}
	} catch (Exception e) {
		log.error("Failed to find Fido 2 device with id " + id, e);
	}
	return f2d;

}
 
Example 4
Source File: EntitlementMediatorMigrator.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 * Iterate and change the password by new algorithm
 *
 * @param it
 * @throws MigrationClientException
 */
private void loopAndEncrypt(Iterator it) throws MigrationClientException {
    while (it.hasNext()) {
        OMElement element = (OMElement) it.next();
        if (element.getAttributeValue(Constant.REMOTE_SERVICE_PASSWORD_Q) != null
                && element.getAttributeValue(Constant.REMOTE_SERVICE_PASSWORD_Q)
                .startsWith(Constant.EM_ENCRYPTED_PASSWORD_PREFIX)) {
            String remoteServicePassword = element.getAttributeValue(Constant.REMOTE_SERVICE_PASSWORD_Q);
            String newEncryptedPassword;
            try {
                newEncryptedPassword = Utility.getNewEncryptedValue(
                        remoteServicePassword.replace(Constant.EM_ENCRYPTED_PASSWORD_PREFIX, ""));
                if (StringUtils.isNotEmpty(newEncryptedPassword)) {
                    element.getAttribute(Constant.REMOTE_SERVICE_PASSWORD_Q)
                            .setAttributeValue(Constant.EM_ENCRYPTED_PASSWORD_PREFIX + newEncryptedPassword);
                    isModified = true;
                }
            } catch (CryptoException e) {
                throw new MigrationClientException(e.getMessage());
            }
        } else if (element.getChildElements().hasNext()) {
            loopAndEncrypt(element.getChildElements());
        }
    }
}
 
Example 5
Source File: RegistryDataManager.java    From product-ei with Apache License 2.0 6 votes vote down vote up
/**
 *  Obtain the STS policy paths from registry
 *
 * @param registry
 * @return
 * @throws RegistryException
 */
private List<String> getSTSPolicyPaths(Registry registry) throws RegistryException {
    List<String> policyPaths = new ArrayList<>();
    if (registry.resourceExists(Constant.SERVICE_GROUPS_PATH)) {
        Collection serviceGroups = (Collection) registry.get(Constant.SERVICE_GROUPS_PATH);
        if (serviceGroups != null) {
            for (String serviceGroupPath : serviceGroups.getChildren()) {
                if (StringUtils.isNotEmpty(serviceGroupPath) &&
                        serviceGroupPath.contains(Constant.STS_SERVICE_GROUP)) {
                    String policyCollectionPath = new StringBuilder().append(serviceGroupPath)
                            .append(Constant.SECURITY_POLICY_RESOURCE_PATH).toString();
                    Collection policies = (Collection) registry.get(policyCollectionPath);
                    if (policies != null) {
                        policyPaths.addAll(Arrays.asList(policies.getChildren()));
                    }
                }
            }
        }
    }
    return policyPaths;
}
 
Example 6
Source File: XUserREST.java    From ranger with Apache License 2.0 6 votes vote down vote up
@DELETE
@Path("/secure/groups/delete")
@Produces({ "application/xml", "application/json" })
@PreAuthorize("hasRole('ROLE_SYS_ADMIN')")
public void deleteGroupsByGroupName(
		@Context HttpServletRequest request,VXStringList groupList) {
	String forceDeleteStr = request.getParameter("forceDelete");
	boolean forceDelete = false;
	if(StringUtils.isNotEmpty(forceDeleteStr) && "true".equalsIgnoreCase(forceDeleteStr)) {
		forceDelete = true;
	}
	if(groupList!=null && groupList.getList()!=null){
		for(VXString groupName:groupList.getList()){
			if(StringUtils.isNotEmpty(groupName.getValue())){
				VXGroup vxGroup = xGroupService.getGroupByGroupName(groupName.getValue());
				xUserMgr.deleteXGroup(vxGroup.getId(), forceDelete);
			}
		}
	}
}
 
Example 7
Source File: WSSecHeaderGeneratorWss4jImpl.java    From freehealth-connector with GNU Affero General Public License v3.0 6 votes vote down vote up
public void sign(AbstractWsSecurityHandler.SignedParts... parts) throws TechnicalConnectorException {
   try {
      if (StringUtils.isNotEmpty(this.assertionId)) {
         this.sign.setSignatureAlgorithm("http://www.w3.org/2000/09/xmldsig#rsa-sha1");
         this.sign.setKeyIdentifierType(12);
         this.sign.setCustomTokenValueType("http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID");
         this.sign.setCustomTokenId(this.assertionId);
      } else {
         this.sign.setKeyIdentifierType(1);
      }

      Crypto crypto = new WSSecurityCrypto(this.cred.getPrivateKey(), this.cred.getCertificate());
      this.sign.prepare(this.soapPart, crypto, this.wsSecHeader);
      if (StringUtils.isEmpty(this.assertionId)) {
         this.sign.appendBSTElementToHeader(this.wsSecHeader);
      }

      List<Reference> referenceList = this.sign.addReferencesToSign(this.generateReferencesToSign(parts), this.wsSecHeader);
      if (!referenceList.isEmpty()) {
         this.sign.computeSignature(referenceList, false, (Element)null);
      }

   } catch (WSSecurityException var4) {
      throw new TechnicalConnectorException(TechnicalConnectorExceptionValues.HANDLER_ERROR, new Object[]{"unable to insert security header.", var4});
   }
}
 
Example 8
Source File: CriterionUtils.java    From bdf3 with Apache License 2.0 5 votes vote down vote up
private static Criterion parseCriterion(ObjectNode rudeCriterion) throws Exception {
	String junction = JsonUtils.getString(rudeCriterion, "junction");
	if (StringUtils.isNotEmpty(junction)) {
		Junction junctionCrition;
		if ("or".equals(junction)) {
			junctionCrition = new Or();
		} else {
			junctionCrition = new And();
		}
		ArrayNode criterions = (ArrayNode) rudeCriterion.get("criterions");
		if (criterions != null) {
			for (Iterator<JsonNode> it = criterions.iterator(); it.hasNext();) {
				junctionCrition.addCriterion(parseCriterion((ObjectNode) it.next()));
			}
		}
		return junctionCrition;
	} else {
		String property = JsonUtils.getString(rudeCriterion, "property");
		String expression = JsonUtils.getString(rudeCriterion, "expression");
		String dataTypeName = JsonUtils.getString(rudeCriterion, "dataType");
		DataType dataType = null;
		ViewManager viewManager = ViewManager.getInstance();
		if (StringUtils.isNotEmpty(dataTypeName)) {
			dataType = viewManager.getDataType(dataTypeName);
		}
		return viewManager.getFilterCriterionParser().createFilterCriterion(property, dataType, expression);
	}
}
 
Example 9
Source File: CdRomBootOrderAllocator.java    From zstack with Apache License 2.0 5 votes vote down vote up
private int setCdRomBootOrder(List<KVMAgentCommands.CdRomTO> cdRoms, int bootOrderNum) {
    for (KVMAgentCommands.CdRomTO cdRom : cdRoms) {
        if (!cdRom.isEmpty() && StringUtils.isNotEmpty(cdRom.getPath())) {
            cdRom.setBootOrder(++bootOrderNum);
        }
    }
    return bootOrderNum;
}
 
Example 10
Source File: SystemUtils.java    From Raigad with Apache License 2.0 5 votes vote down vote up
public static String runHttpPostCommand(String url, String jsonBody) throws IOException {
    String return_;
    DefaultHttpClient client = new DefaultHttpClient();
    InputStream isStream = null;
    try {
        HttpParams httpParameters = new BasicHttpParams();
        int timeoutConnection = 1000;
        int timeoutSocket = 1000;
        HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
        HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
        client.setParams(httpParameters);

        HttpPost postRequest = new HttpPost(url);
        if (StringUtils.isNotEmpty(jsonBody))
            postRequest.setEntity(new StringEntity(jsonBody, StandardCharsets.UTF_8));
        postRequest.setHeader("Content-type", "application/json");

        HttpResponse resp = client.execute(postRequest);

        if (resp == null || resp.getEntity() == null) {
            throw new ElasticsearchHttpException("Unable to execute POST URL (" + url + ") Exception Message: < Null Response or Null HttpEntity >");
        }

        isStream = resp.getEntity().getContent();

        if (resp.getStatusLine().getStatusCode() != 200) {

            throw new ElasticsearchHttpException("Unable to execute POST URL (" + url + ") Exception Message: (" + IOUtils.toString(isStream, StandardCharsets.UTF_8.toString()) + ")");
        }

        return_ = IOUtils.toString(isStream, StandardCharsets.UTF_8.toString());
        logger.debug("POST URL API: {} with JSONBody {} returns: {}", url, jsonBody, return_);
    } catch (Exception e) {
        throw new ElasticsearchHttpException("Caught an exception during execution of URL (" + url + ")Exception Message: (" + e + ")");
    } finally {
        if (isStream != null)
            isStream.close();
    }
    return return_;
}
 
Example 11
Source File: Json2XmlValidator.java    From iaf with Apache License 2.0 5 votes vote down vote up
public String getOutputFormat(IPipeLineSession session, boolean responseMode) {
	String format=null;
	if (StringUtils.isNotEmpty(getOutputFormatSessionKey())) {
		format=(String)session.get(getOutputFormatSessionKey());
	}
	if (StringUtils.isEmpty(format) && isAutoFormat() && responseMode) {
		format=(String)session.get(getInputFormatSessionKey());
	}	
	if (StringUtils.isEmpty(format)) {
		format=getOutputFormat();
	}	
	return format;
}
 
Example 12
Source File: CustomerServiceImpl.java    From e with Apache License 2.0 5 votes vote down vote up
@ControllerLogExeTime(description="删除客户")
@RequestMapping({"/del"})
public void del(String id) {
	if (StringUtils.isNotEmpty(id)) {
		String[] idsArr = id.split(",");
		if (idsArr != null) {
			for (String idd : idsArr) {
				CustomerEntity customerEntity = (CustomerEntity)this.customerRepository.get(idd);
				if (customerEntity != null) {
					this.customerRepository.delete(customerEntity);
				}
			}
		}
	}
}
 
Example 13
Source File: WinLoadBalancerAdd.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
public void show(List<ComponentDto> components) {
    removeAllItems();

    if (components == null) {
        return;
    }

    for (int i = 0; i < components.size(); i++) {
        ComponentDto componentDto = components.get(i);

        // サービス名
        String serviceName = componentDto.getComponent().getComponentName();
        if (StringUtils.isNotEmpty(componentDto.getComponent().getComment())) {
            serviceName = componentDto.getComponent().getComment() + "\n[" + serviceName + "]";
        }
        Label nameLabel = new Label(serviceName, Label.CONTENT_PREFORMATTED);

        // サービス種類
        ComponentType componentType = componentDto.getComponentType();
        String typeName = componentType.getComponentTypeNameDisp();
        Icons typeIcon = Icons.fromName(componentType.getComponentTypeName());
        Label typeLabel = new Label(IconUtils.createImageTag(getApplication(), typeIcon, typeName),
                Label.CONTENT_XHTML);
        typeLabel.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { nameLabel, typeLabel }, componentDto.getComponent().getComponentNo());
    }
}
 
Example 14
Source File: PatchForUpdatingPolicyJson_J10019.java    From ranger with Apache License 2.0 5 votes vote down vote up
private void updateRangerPolicyTableWithPolicyJson() throws Exception {
	logger.info("==> updateRangerPolicyTableWithPolicyJson() ");

	List<RangerService> allServices = svcStore.getServices(new SearchFilter());

	if (CollectionUtils.isNotEmpty(allServices)) {
		for (RangerService service : allServices) {
			XXService dbService = daoMgr.getXXService().getById(service.getId());

			logger.info("==> Port Policies of service(name=" + dbService.getName() + ")");

			RangerPolicyRetriever policyRetriever = new RangerPolicyRetriever(daoMgr, txManager);

			List<RangerPolicy> policies = policyRetriever.getServicePolicies(dbService);

			if (CollectionUtils.isNotEmpty(policies)) {
				TransactionTemplate txTemplate = new TransactionTemplate(txManager);

				for (RangerPolicy policy : policies) {
					XXPolicy xPolicy = daoMgr.getXXPolicy().getById(policy.getId());
					if (xPolicy != null && StringUtil.isEmpty(xPolicy.getPolicyText())) {

						PolicyUpdaterThread updaterThread = new PolicyUpdaterThread(txTemplate, service, policy);
						updaterThread.setDaemon(true);
						updaterThread.start();
						updaterThread.join();

						String errorMsg = updaterThread.getErrorMsg();
						if (StringUtils.isNotEmpty(errorMsg)) {
							throw new Exception(errorMsg);
						}
					}
				}
			}
		}
	}

	logger.info("<== updateRangerPolicyTableWithPolicyJson() ");
}
 
Example 15
Source File: TestingGuiPlugin.java    From hop with Apache License 2.0 5 votes vote down vote up
public void openUnitTestPipeline() {
  try {
    HopGui hopGui = HopGui.getInstance();
    IHopMetadataProvider metadataProvider = hopGui.getMetadataProvider();
    RowMetaAndData selection = selectUnitTestFromAllTests();
    if ( selection != null ) {
      String filename = selection.getString( 2, null );
      if ( StringUtils.isNotEmpty( filename ) ) {
        // Load the unit test...
        //
        String unitTestName = selection.getString( 0, null );
        PipelineUnitTest targetTest = metadataProvider.getSerializer( PipelineUnitTest.class ).load( unitTestName );

        if ( targetTest != null ) {

          targetTest.initializeVariablesFrom( hopGui.getVariables() );

          String completeFilename = targetTest.calculateCompleteFilename();
          hopGui.fileDelegate.fileOpen( completeFilename );

          PipelineMeta pipelineMeta = getActivePipelineMeta();
          if ( pipelineMeta != null ) {
            switchUnitTest( targetTest, pipelineMeta );
          }
        }
      } else {
        throw new HopException( "No filename found in the selected test" );
      }
    }
  } catch ( Exception e ) {
    new ErrorDialog( HopGui.getInstance().getShell(), "Error", "Error opening unit test pipeline", e );
  }
}
 
Example 16
Source File: AjaxConfirmLink.java    From nextreports-server with Apache License 2.0 5 votes vote down vote up
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
	super.updateAjaxAttributes(attributes);
	
	if (StringUtils.isNotEmpty(getMessage()) && showDialog()) {
		String message = getMessage().replaceAll("'", "\"");
		StringBuilder precondition = new StringBuilder("if(!confirm('").append(message).append("')) { hideBusy(); return false; };");
		
		AjaxCallListener listener = new AjaxCallListener();
		listener.onPrecondition(precondition);
		
		attributes.getAjaxCallListeners().add(listener);
	}
}
 
Example 17
Source File: ReadOnlyLDAPUserStoreManager.java    From micro-integrator with Apache License 2.0 4 votes vote down vote up
@Override
protected String[] doGetDisplayNamesForInternalRole(String[] userNames)
        throws UserStoreException {
    // search the user with UserNameAttribute, retrieve their
    // DisplayNameAttribute combine and return
    String displayNameAttribute =
            this.realmConfig.getUserStoreProperty(LDAPConstants.DISPLAY_NAME_ATTRIBUTE);
    if (StringUtils.isNotEmpty(displayNameAttribute)) {
        String userNameAttribute =
                this.realmConfig.getUserStoreProperty(LDAPConstants.USER_NAME_ATTRIBUTE);
        String userSearchBase =
                this.realmConfig.getUserStoreProperty(LDAPConstants.USER_SEARCH_BASE);
        String userNameListFilter =
                this.realmConfig.getUserStoreProperty(LDAPConstants.USER_NAME_LIST_FILTER);

        String[] returningAttributes = {displayNameAttribute};
        SearchControls searchControls = new SearchControls();
        searchControls.setReturningAttributes(returningAttributes);

        List<String> combinedNames = new ArrayList<String>();
        if (userNames != null && userNames.length > 0) {
            for (String userName : userNames) {
                String searchFilter =
                        "(&" + userNameListFilter + "(" + userNameAttribute +
                                "=" + escapeSpecialCharactersForFilter(userName) + "))";
                List<String> displayNames =
                        this.getListOfNames(userSearchBase, searchFilter,
                                searchControls,
                                displayNameAttribute, false);
                // we expect only one display name
                if (displayNames != null && !displayNames.isEmpty()) {
                    String name = UserCoreUtil.getCombinedName(this.realmConfig.getUserStoreProperty(
                            UserCoreConstants.RealmConfig.PROPERTY_DOMAIN_NAME), userName, displayNames.get(0));
                    combinedNames.add(name);
                }
            }
            return combinedNames.toArray(new String[combinedNames.size()]);
        } else {
            return userNames;
        }
    } else {
        return userNames;
    }
}
 
Example 18
Source File: SubAccountRule.java    From kfs with GNU Affero General Public License v3.0 4 votes vote down vote up
/**
 * This checks that if the cost share information is filled out that it is valid and exists, or if fields are missing (such as
 * the chart of accounts code and account number) an error is recorded
 * 
 * @return true if all cost share fields filled out correctly, false if the chart of accounts code and account number for cost
 *         share are missing
 */
protected boolean checkCgCostSharingRules() {

    boolean success = true;
    boolean allFieldsSet = false;

    A21SubAccount a21 = newSubAccount.getA21SubAccount();

    // check to see if all required fields are set
    if (StringUtils.isNotEmpty(a21.getCostShareChartOfAccountCode()) && StringUtils.isNotEmpty(a21.getCostShareSourceAccountNumber())) {
        allFieldsSet = true;
    }

    // Cost Sharing COA Code and Cost Sharing Account Number are required
    success &= checkEmptyBOField("a21SubAccount.costShareChartOfAccountCode", a21.getCostShareChartOfAccountCode(), "Cost Share Chart of Accounts Code");
    success &= checkEmptyBOField("a21SubAccount.costShareSourceAccountNumber", a21.getCostShareSourceAccountNumber(), "Cost Share AccountNumber");

    // existence test on Cost Share Account
    if (allFieldsSet) {
        if (ObjectUtils.isNull(a21.getCostShareAccount())) {
            putFieldError("a21SubAccount.costShareSourceAccountNumber", KFSKeyConstants.ERROR_EXISTENCE, getDisplayName("a21SubAccount.costShareSourceAccountNumber"));
            success &= false;
        }
    }

    // existence test on Cost Share SubAccount
    if (allFieldsSet && StringUtils.isNotBlank(a21.getCostShareSourceSubAccountNumber())) {
        if (ObjectUtils.isNull(a21.getCostShareSourceSubAccount())) {
            putFieldError("a21SubAccount.costShareSourceSubAccountNumber", KFSKeyConstants.ERROR_EXISTENCE, getDisplayName("a21SubAccount.costShareSourceSubAccountNumber"));
            success &= false;
        }
    }

    // Cost Sharing Account may not be for contracts and grants
    if (ObjectUtils.isNotNull(a21.getCostShareAccount())) {
        if (ObjectUtils.isNotNull(a21.getCostShareAccount().getSubFundGroup())) {
            if (a21.getCostShareAccount().isForContractsAndGrants()) {
                putFieldError("a21SubAccount.costShareSourceAccountNumber", KFSKeyConstants.ERROR_DOCUMENT_SUBACCTMAINT_COST_SHARE_ACCOUNT_MAY_NOT_BE_CG_FUNDGROUP, new String[] { SpringContext.getBean(SubFundGroupService.class).getContractsAndGrantsDenotingAttributeLabel(), SpringContext.getBean(SubFundGroupService.class).getContractsAndGrantsDenotingValueForMessage() });
                success &= false;
            }
        }
    }

    // The ICR fields must be empty if the sub-account type code is for cost sharing
    if (checkCgIcrIsEmpty() == false) {
        putFieldError("a21SubAccount.indirectCostRecoveryTypeCode", KFSKeyConstants.ERROR_DOCUMENT_SUBACCTMAINT_ICR_SECTION_INVALID, a21.getSubAccountTypeCode());
        success &= false;
    }

    return success;
}
 
Example 19
Source File: StatisticsParser.java    From iaf with Apache License 2.0 4 votes vote down vote up
public void setName(String name) {
	if (StringUtils.isNotEmpty(getName()) && !getName().equals(name)) {
		log.warn("name in file ["+name+"] does not match current name ["+getName()+"]");
	}
	this.name = name;
}
 
Example 20
Source File: TemplateEr.java    From govpay with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates custom component which is possible to add to any report band component
 */
public static ComponentBuilder<?, ?> createTitleComponent(String pathLoghi, ER er,Dominio dominio, Anagrafica anagraficaDominio, List<String> errList,Logger log) {
	try{
		StringBuilder errMsg = new StringBuilder();
		List<ComponentBuilder<?, ?>> lst = new ArrayList<>();
		InputStream resourceLogoPagoPa = new ByteArrayInputStream(Base64.decodeBase64(Costanti.logoPagoPa));
		String denominazioneDominio = dominio.getRagioneSociale();
		
		String logoDominio = dominio.getCodDominio() + ".png";
		File fEnte = new File(pathLoghi+"/"+logoDominio);
		
		
		if(fEnte.exists()){
			InputStream resourceLogoEnte = new FileInputStream(fEnte);
			lst.add(cmp.image(resourceLogoEnte).setFixedDimension(90, 90));
		}else {
			if(errMsg.length() >0)
				errMsg.append(", ");

			errMsg.append(" l'estratto conto non contiene il logo del dominio poiche' il file ["+logoDominio+"] non e' stato trovato nella directory dei loghi");
		}

		if(errMsg.length() >0){
			errList.add(errMsg.toString());
		}
		
		String pIvaDominio = MessageFormat.format(Costanti.PATTERN_NOME_DUE_PUNTI_VALORE, Costanti.LABEL_P_IVA, dominio.getCodDominio());
		
		 
		String indirizzo = StringUtils.isNotEmpty(anagraficaDominio.getIndirizzo()) ? anagraficaDominio.getIndirizzo() : "";
		String civico = StringUtils.isNotEmpty(anagraficaDominio.getCivico()) ? anagraficaDominio.getCivico() : "";
		String cap = StringUtils.isNotEmpty(anagraficaDominio.getCap()) ? anagraficaDominio.getCap() : "";
		String localita = StringUtils.isNotEmpty(anagraficaDominio.getLocalita()) ? anagraficaDominio.getLocalita() : "";
		String provincia = StringUtils.isNotEmpty(anagraficaDominio.getProvincia()) ? (" (" +anagraficaDominio.getProvincia() +")" ) : "";


		String indirizzoCivico = indirizzo + " " + civico;
		String capCitta = cap + " " + localita + provincia;
		
		lst.add(cmp.verticalList(
				cmp.text(denominazioneDominio).setStyle(TemplateBase.bold18LeftStyle).setHorizontalTextAlignment(HorizontalTextAlignment.CENTER),
				cmp.text(pIvaDominio).setHorizontalTextAlignment(HorizontalTextAlignment.CENTER),
				cmp.text(indirizzoCivico).setHorizontalTextAlignment(HorizontalTextAlignment.CENTER),
				cmp.text(capCitta).setHorizontalTextAlignment(HorizontalTextAlignment.CENTER)
				));
		
		return cmp.horizontalList()
				.add(cmp.horizontalList(lst.toArray(new ComponentBuilder[lst.size()])),
						cmp.image(resourceLogoPagoPa).setFixedDimension(90, 90),
							cmp.verticalGap(20))
				.newRow()
				.add(cmp.line())
				.newRow()
						;
	}catch(Exception e){
		log.error(e.getMessage(),e);
		
	}
	return null;
}