List of usage examples for org.apache.commons.lang StringUtils isNotBlank
public static boolean isNotBlank(String str)
Checks if a String is not empty (""), not null and not whitespace only.
From source file:de.hybris.platform.accountsummaryaddon.document.criteria.validator.impl.DateCriteriaValidator.java
@Override public boolean isValid(final String startRange, final String endRange, final Model model) { Optional<Date> parsedStartRange = Optional.empty(); Optional<Date> parsedEndRange = Optional.empty(); if (LOG.isDebugEnabled()) { LOG.debug("validating date ranges"); }//from w w w . j a va 2 s. c o m if (StringUtils.isNotBlank(startRange)) { parsedStartRange = AccountSummaryAddonUtils.parseDate(startRange, AccountsummaryaddonConstants.DATE_FORMAT_MM_DD_YYYY); if (!parsedStartRange.isPresent()) { GlobalMessages.addErrorMessage(model, "text.company.accountsummary.criteria.date.format.from.invalid"); return false; } } if (StringUtils.isNotBlank(endRange)) { parsedEndRange = AccountSummaryAddonUtils.parseDate(endRange, AccountsummaryaddonConstants.DATE_FORMAT_MM_DD_YYYY); if (!parsedEndRange.isPresent()) { GlobalMessages.addErrorMessage(model, "text.company.accountsummary.criteria.date.format.to.invalid"); return false; } } if (parsedStartRange.isPresent() && parsedEndRange.isPresent() && parsedStartRange.get().after(parsedEndRange.get())) { GlobalMessages.addErrorMessage(model, "text.company.accountsummary.criteria.date.invalid"); return false; } return true; }
From source file:net.kamhon.ieagle.struts2.BaseUnsecureFlowAction.java
public void prepare() throws Exception { if (StringUtils.isNotBlank(ServletActionContext.getActionMapping().getName())) { String actionName = ServletActionContext.getActionMapping().getName(); if (actionName.endsWith(RELOAD_ADD)) { prepareReloadAdd();//from w ww . j a v a 2 s . c o m } else if (actionName.endsWith(RELOAD_EDIT)) { prepareReloadEdit(); } else if (actionName.endsWith(ADD)) { prepareAdd(); } else if (actionName.endsWith(ADD_DETAIL)) { prepareAddDetail(); } else if (actionName.endsWith(DESTROY)) { prepareDestroy(); } else if (actionName.endsWith(EDIT)) { prepareEdit(); } else if (actionName.endsWith(JSON)) { prepareJson(); } else if (actionName.endsWith(LIST)) { prepareList(); } else if (actionName.endsWith(MOVE_DOWN)) { prepareMoveDown(); } else if (actionName.endsWith(MOVE_UP)) { prepareMoveUp(); } else if (actionName.endsWith(SEARCH)) { prepareSearch(); } else if (actionName.endsWith(PRINT)) { preparePrint(); } else if (actionName.endsWith(REMOVE)) { prepareRemove(); } else if (actionName.endsWith(REMOVE_DETAIL)) { prepareRemoveDetail(); } else if (actionName.endsWith(RETRIEVE_DETAIL)) { prepareRetrieveDetail(); } else if (actionName.endsWith(SAVE)) { prepareSave(); } else if (actionName.endsWith(SHOW)) { prepareShow(); } else if (actionName.endsWith(UPDATE)) { prepareUpdate(); } else if (actionName.endsWith(EDIT_DETAIL)) { prepareEditDetail(); } else { prepareOtherMethod(actionName); } } }
From source file:fi.vm.kapa.identification.shibboleth.extauthn.util.CertificateUtil.java
public static X509Certificate getCertificate(String pemCertificate) { X509Certificate newCert = null; try {/*from ww w. j ava2 s . c om*/ // Add \r after cert header field, Cert API needs this (Legacy method, Apache2-provided cert) pemCertificate = pemCertificate.replaceFirst(X509_PEM_HEADER, X509_PEM_HEADER + "\r"); // Add X509 header and footer, Cert API needs this (SCS method, SCS-provided certificate) if (!pemCertificate.contains(X509_PEM_HEADER)) { pemCertificate = X509_PEM_HEADER + "\r" + pemCertificate + "\r" + X509_PEM_FOOTER; } if (StringUtils.isNotBlank(pemCertificate)) { InputStream in = new ByteArrayInputStream(pemCertificate.getBytes()); CertificateFactory cf = CertificateFactory.getInstance("X.509"); newCert = (X509Certificate) cf.generateCertificate(in); } } catch (final CertificateException | NullPointerException e) { logger.warn("Error getting client certificate from request", e); } return newCert; }
From source file:com.enonic.cms.business.core.content.mail.AbstractAssignmentMailTemplate.java
protected String createAssignmentMailInfoElement() { String contentPath = content.getPathAsString(); StringBuffer body = new StringBuffer(); Map<String, String> keyValues = Maps.newLinkedHashMap(); if (StringUtils.isNotBlank(contentPath)) { addKeyValue(keyValues, "%fldStatus%", getTranslatedStatus(contentVersion.getStatus())); if (assignmentDueDate != null) { addKeyValue(keyValues, "%contentAssignmentDuedate%", dateFormat.format(assignmentDueDate)); }//w w w. j ava 2 s .com addKeyValue(keyValues, "%fldDisplayName%", contentVersion.getTitle()); addKeyValue(keyValues, "%fldContentType%", content.getContentType().getName()); addKeyValue(keyValues, "%contentAssignedBy%", createUserName(assigner)); addKeyValue(keyValues, "%contentAssignmentPath%", contentPath); } String adminUrl = getAdminUrl(content.getKey()); if (StringUtils.isNotBlank(adminUrl)) { addKeyValue(keyValues, "%blockURL%", adminUrl); } appendKeyValuesWithPadding(body, keyValues); return body.toString(); }
From source file:ips1ap101.web.commons.assistants.ext.AsistentePaginaActualizacionTareaUsuarioX.java
/** * campoFuncion1Boton2.onClick// w ww . ja v a 2s . c o m */ @Override public String getScriptCampoFuncion1Boton2() { RowKey rowKey = bean.getGestor().getCurrentRowKey(); if (bean.getTareaUsuarioDataProvider().isRowAvailable(rowKey)) { String pagina = bean.getTareaUsuarioDataProvider().getPaginaFuncion(rowKey); String urx = BaseBundle.getPage(pagina); if (StringUtils.isNotBlank(urx)) { Long funcion = bean.getTareaUsuarioDataProvider().getFuncion(rowKey); Long recurso = bean.getTareaUsuarioDataProvider().getRecursoValor(rowKey); ListaParametros rpl = new ListaParametros(); rpl.addParametro(CPP.ID_FUNCION_REFERENCIA, funcion); if (recurso != null) { rpl.addParametro(CPP.ID_RECURSO, recurso); } String script = JSF.getOpenWindowJavaScript(urx, rpl.toString()); return script; } } return null; }
From source file:com.townsfolkdesigns.jfugue.JFuguePlugin.java
public static void playMusicString(String musicString) { if (StringUtils.isNotBlank(musicString)) { // run in Thread, so jEdit won't freeze up. threadPool.execute(new MusicPlayer(musicString)); }/*from w ww . j av a 2 s. c o m*/ }
From source file:azkaban.project.FlowTriggerDependency.java
/** * @throws IllegalArgumentException if name or type is null or blank * @throws IllegalArgumentException if depProps is null *///from w w w. j ava 2 s . com public FlowTriggerDependency(final String name, final String type, final Map<String, String> depProps) { Preconditions.checkArgument(StringUtils.isNotBlank(name)); Preconditions.checkArgument(StringUtils.isNotBlank(type)); Preconditions.checkArgument(depProps != null); this.name = name; this.type = type; this.props = Collections.unmodifiableMap(depProps); //todo chengren311: validate per dependencyType: some dependency type might need extra special //check, also check if it's a valid dependency type }
From source file:com.ah.util.notificationmsg.message.HmLicenceWarningMsg.java
@Override public boolean isNeedBuild(HmUser userContext) { if (null == userContext) { return false; }//from w ww . ja va 2 s . co m this.contents = (String) MgrUtil.getSessionAttribute(SessionKeys.LICENSE_INFO_IN_TITLE_AREA); return StringUtils.isNotBlank(contents); }
From source file:net.di2e.ecdr.endpoint.sort.SortTypeConfigurationImpl.java
public void setSortAttribute(String attribute) { if (StringUtils.isNotBlank(attribute)) { LOGGER.debug("ConfigUpdate: Updating the sortAttribute to [{}] from [{}]", attribute, sortAttribute); this.sortAttribute = attribute; } else {//w w w. j ava 2s. c o m LOGGER.debug( "ConfigUpdateError: Configuration update for SortAttribute in sortMapper for key=[{}] was empty or null so leaving at existing value for [{}]", sortKey, sortAttribute); } }
From source file:com.axiomine.largecollections.utilities.KryoUtils.java
public static void registerKryoClasses(Kryo kryo) { try {//from ww w .j a va 2s . c o m registerDefaultKryoClasses(kryo); Map<String, String> m = new HashMap<String, String>(); String propFile = System.getProperty(KRYO_REGISTRATION_PROP_FILE); if (StringUtils.isNotBlank(propFile)) registerKryoClasses(kryo, propFile); } catch (Exception ex) { Throwables.propagate(ex); } }