List of usage examples for org.apache.commons.lang3 StringUtils EMPTY
String EMPTY
To view the source code for org.apache.commons.lang3 StringUtils EMPTY.
Click Source Link
From source file:lineage2.gameserver.utils.XMLUtil.java
/** * Method getAttributeValue./*from w w w .j a v a 2s.co m*/ * @param n Node * @param item String * @return String */ public static String getAttributeValue(Node n, String item) { final Node d = n.getAttributes().getNamedItem(item); if (d == null) { return StringUtils.EMPTY; } final String val = d.getNodeValue(); if (val == null) { return StringUtils.EMPTY; } return val; }
From source file:com.nridge.core.base.std.WebUtl.java
public static String encodeValue(String aValue) { if (StringUtils.isEmpty(aValue)) return StringUtils.EMPTY; int offset = aValue.indexOf('%'); if (offset != -1) aValue = aValue.replace("%", "%25"); offset = aValue.indexOf('|'); if (offset != -1) aValue = aValue.replace("|", "%7C"); offset = aValue.indexOf('~'); if (offset != -1) aValue = aValue.replace("~", "%7E"); offset = aValue.indexOf(';'); if (offset != -1) aValue = aValue.replace(";", "%3B"); offset = aValue.indexOf('/'); if (offset != -1) aValue = aValue.replace("/", "%2F"); offset = aValue.indexOf('?'); if (offset != -1) aValue = aValue.replace("?", "%3F"); offset = aValue.indexOf(':'); if (offset != -1) aValue = aValue.replace(":", "%3A"); offset = aValue.indexOf('&'); if (offset != -1) aValue = aValue.replace("&", "%26"); offset = aValue.indexOf('='); if (offset != -1) aValue = aValue.replace("=", "%3D"); offset = aValue.indexOf('+'); if (offset != -1) aValue = aValue.replace("+", "%2B"); offset = aValue.indexOf('$'); if (offset != -1) aValue = aValue.replace("$", "%24"); offset = aValue.indexOf(','); if (offset != -1) aValue = aValue.replace(",", "%2C"); offset = aValue.indexOf('#'); if (offset != -1) aValue = aValue.replace("#", "%23"); offset = aValue.indexOf('^'); if (offset != -1) aValue = aValue.replace("^", "%5E"); offset = aValue.indexOf('['); if (offset != -1) aValue = aValue.replace("[", "%5B"); offset = aValue.indexOf(']'); if (offset != -1) aValue = aValue.replace("]", "%5D"); offset = aValue.indexOf('\"'); if (offset != -1) aValue = aValue.replace("\"", "%22"); offset = aValue.indexOf('\\'); if (offset != -1) aValue = aValue.replace("\\", "%5C"); offset = aValue.indexOf(' '); if (offset != -1) aValue = aValue.replace(" ", "+"); return aValue; }
From source file:io.github.swagger2markup.internal.utils.MarkupDocBuilderUtils.java
public static String boldText(MarkupDocBuilder markupDocBuilder, String text) { if (StringUtils.isBlank(text)) { return StringUtils.EMPTY; }//from ww w. j a v a 2 s.com return copyMarkupDocBuilder(markupDocBuilder).boldText(text).toString(); }
From source file:io.knotx.adapter.common.post.UrlEncodedBodyBuilder.java
public static String encodeBody(final MultiMap formAttributes, Charset charset) { if (formAttributes == null || formAttributes.isEmpty()) { return StringUtils.EMPTY; } else {/*from ww w . ja va 2s . com*/ Iterator<Entry<String, String>> entryIt = formAttributes.getDelegate().iterator(); StringBuilder sb = new StringBuilder(128); while (entryIt.hasNext()) { Entry<String, String> entry = entryIt.next(); sb.append(encodeComponent(entry.getKey(), charset)); if (entry.getValue() != null) { sb.append('='); sb.append(encodeComponent(entry.getValue(), charset)); } if (entryIt.hasNext()) { sb.append('&'); } } return sb.toString(); } }
From source file:ch.cyberduck.core.BookmarkNameProvider.java
public static String toString(final Host bookmark, final boolean username) { if (StringUtils.isEmpty(bookmark.getNickname())) { final String prefix; // Return default bookmark name if (username && !bookmark.getCredentials().isAnonymousLogin() && StringUtils.isNotBlank(bookmark.getCredentials().getUsername())) { prefix = String.format("%s@", bookmark.getCredentials().getUsername()); } else {//from ww w .ja v a 2s . co m prefix = StringUtils.EMPTY; } if (StringUtils.isNotBlank(bookmark.getHostname())) { return String.format("%s%s \u2013 %s", prefix, StringUtils.strip(bookmark.getHostname()), bookmark.getProtocol().getName()); } if (StringUtils.isNotBlank(bookmark.getProtocol().getDefaultHostname())) { return String.format("%s%s \u2013 %s", prefix, StringUtils.strip(bookmark.getProtocol().getDefaultHostname()), bookmark.getProtocol().getName()); } return String.format("%s%s", prefix, bookmark.getProtocol().getName()); } // Return custom bookmark name set return bookmark.getNickname(); }
From source file:ch.cyberduck.binding.HyperlinkAttributedStringFactory.java
public static NSAttributedString create(final DescriptiveUrl url) { if (url.equals(DescriptiveUrl.EMPTY)) { return NSAttributedString.attributedString(StringUtils.EMPTY); }/*from w w w .ja v a 2 s.c o m*/ return create(url.getUrl()); }
From source file:de.blizzy.documentr.system.Version.java
static Version fromString(String s) { Assert.isTrue(s.matches("^[0-9]+\\.[0-9]+\\.[0-9]+(-.+)?$")); //$NON-NLS-1$ s = s.replaceFirst("-.*$", StringUtils.EMPTY); //$NON-NLS-1$ String[] parts = s.split("\\."); //$NON-NLS-1$ return new Version(Integer.parseInt(parts[0]), Integer.parseInt(parts[1]), Integer.parseInt(parts[2])); }
From source file:br.com.rtisistemas.tableModel.AbstractComboModel.java
public AbstractComboModel(T[] items) { if (items != null) { lista.add((T) StringUtils.EMPTY); lista.addAll(Arrays.asList(items)); } }
From source file:com.ts.db.connector.PlainTextPassword.java
@Override public String getRowString() { return (hasPassword()) ? rowString : StringUtils.EMPTY; }
From source file:io.github.swagger2markup.internal.utils.MarkupDocBuilderUtils.java
public static String italicText(MarkupDocBuilder markupDocBuilder, String text) { if (StringUtils.isBlank(text)) { return StringUtils.EMPTY; }/*from ww w .j a v a 2 s . c om*/ return copyMarkupDocBuilder(markupDocBuilder).italicText(text).toString(); }