List of usage examples for org.apache.commons.lang StringUtils defaultString
public static String defaultString(String str)
Returns either the passed in String, or if the String is null
, an empty String ("").
From source file:gtu._work.ui.ObnfJetDeleteUI.java
private void executeBtnPerformed() { try {//from w ww . j a v a 2 s . c o m String excludePersonId = StringUtils.defaultString(excludeArea.getText()); File file = JCommonUtil.filePathCheck(srcDirText.getText(), "exceptionLog", false); ObnfRepairDBBatch_forJet1 test = new ObnfRepairDBBatch_forJet1(); test.execute(excludePersonId, file); JCommonUtil._jOptionPane_showMessageDialog_info( "?, xml outputXXX"); } catch (Exception ex) { JCommonUtil.handleException(ex); } }
From source file:de.iteratec.iteraplan.businesslogic.exchange.legacyExcel.importer.sheets.model.ReleaseBuildingBlockSheetImporter.java
/** * Return the release version/name for TCR / ISR BBTs. *//*from w ww . j a va 2 s .com*/ protected String getNameRelease(String nameCombined) { String version = GeneralHelper.getPartsOfReleaseName(nameCombined)[1]; return StringUtils.defaultString(version); }
From source file:info.magnolia.cms.license.LicenseFileExtractor.java
/** * Returns the current magnolia version, read from the jar Manifest. This will return null if classes are not inside * a jar.//from ww w .j av a2 s. co m * @return implementation version, read from the manifest file. */ public String getVersionFromManifest() { Package p = this.getClass().getPackage(); if (p != null) { return StringUtils.defaultString(p.getImplementationVersion()); } return StringUtils.EMPTY; }
From source file:com.opengamma.core.position.impl.SimplePortfolioNode.java
/** * Creates a portfolio with the specified identifier. * //from w ww .ja v a 2s . co m * @param uniqueId the unique identifier, not null * @param name the name to use, null treated as empty */ public SimplePortfolioNode(UniqueId uniqueId, String name) { ArgumentChecker.notNull(uniqueId, "uniqueId"); _uniqueId = uniqueId; _name = StringUtils.defaultString(name); }
From source file:com.cloudbees.plugins.credentials.CredentialsNameComparator.java
/** * {@inheritDoc}//from w ww .j ava 2 s . co m */ @Override public int compare(Credentials c1, Credentials c2) { final String n1 = StringUtils.defaultString(CredentialsNameProvider.name(c1)); final String n2 = StringUtils.defaultString(CredentialsNameProvider.name(c2)); if (collator == null) { // in the event of a race condition this will be effectively idempotent so no need for synchronization. collator = Collator.getInstance(locale); } return ignoreCase ? collator.compare(n1.toLowerCase(locale), n2.toLowerCase(locale)) : collator.compare(n1, n2); }
From source file:ca.uhn.hunit.msg.Hl7V2MessageImpl.java
@Override public void setSourceMessage(String theMessage) throws PropertyVetoException { theMessage = StringUtils.defaultString(theMessage); String original = mySourceMessage; String sourceMessage = theMessage.trim(); String text = sourceMessage.replaceAll("(\\r|\\n)+", "\r"); PipeParser parser = new PipeParser(); parser.setValidationContext(new ValidationContextImpl()); Message parsedMessage;//w w w . ja v a 2 s . co m try { // Parse and re-encode to strip out any inconsistancies in the message (extra blank fields at the end of segments, etc) parsedMessage = parser.parse(text); text = parser.encode(parsedMessage); } catch (EncodingNotSupportedException e) { throw new PropertyVetoException(e.getMessage(), null); } catch (HL7Exception e) { throw new PropertyVetoException(e.getMessage(), null); } sourceMessage = text.replaceAll("\\r", "\r\n"); myParsedMessage = parsedMessage; myText = text; mySourceMessage = sourceMessage; firePropertyChange(SOURCE_MESSAGE_PROPERTY, original, text); }
From source file:info.magnolia.cms.gui.controlx.list.ListControl.java
/** * @see info.magnolia.cms.gui.controlx.list.ListModel#getGroupBy() *///from ww w . ja v a 2s . c om public String getGroupBy() { return StringUtils.defaultString(this.model.getGroupBy()); }
From source file:com.opengamma.web.config.WebConfigVersionResource.java
/** * Builds a URI for this resource./*from ww w .j a v a2 s. co m*/ * @param data the data, not null * @param overrideVersionId the override version id, null uses information from data * @return the URI, not null */ public static URI uri(final WebConfigData data, final UniqueId overrideVersionId) { String configId = data.getBestConfigUriId(null); String versionId = StringUtils .defaultString(overrideVersionId != null ? overrideVersionId.getVersion() : data.getUriVersionId()); return data.getUriInfo().getBaseUriBuilder().path(WebConfigVersionResource.class).build(configId, versionId); }
From source file:cec.easyshop.storefront.security.AcceleratorRememberMeServices.java
protected String getUrlEncodingPattern(final HttpServletRequest request) { final String encodingAttributes = (String) request.getAttribute(WebConstants.URL_ENCODING_ATTRIBUTES); return StringUtils.defaultString(encodingAttributes); }
From source file:dk.dma.msinm.user.security.SecurityConf.java
/** * Returns the request specifies the JWT authentication endpoint * @return the request specifies the JWT authentication endpoint *//*from ww w. j a v a 2 s .co m*/ public boolean isJwtAuthEndpoint(HttpServletRequest request) { String uri = request.getServletPath() + StringUtils.defaultString(request.getPathInfo()); return supportsJwtAuth() && jwtAuthEndpoint != null && jwtAuthEndpoint.equals(uri); }