Example usage for org.apache.commons.lang StringUtils EMPTY

List of usage examples for org.apache.commons.lang StringUtils EMPTY

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils EMPTY.

Prototype

String EMPTY

To view the source code for org.apache.commons.lang StringUtils EMPTY.

Click Source Link

Document

The empty String "".

Usage

From source file:com.daimler.spm.b2bacceleratoraddon.forms.AdvancedSearchForm.java

public AdvancedSearchForm() {
    keywords = StringUtils.EMPTY;
    searchResultType = "catalog";
}

From source file:ips1ap101.lib.core.CoreBundle.java

private static String getString(String key, TrimmedTo trimmedTo) {
    String string = key;//from   ww  w .  ja v  a 2 s.  c o m
    if (StringUtils.isNotBlank(key)) {
        try {
            string = resourceBundle.getString(key);
        } catch (MissingResourceException e) {
            string = null;
        }
    }
    if (StringUtils.isNotBlank(string)) {
        return string.trim();
    }
    switch (trimmedTo) {
    case EMPTY:
        return StringUtils.EMPTY;
    case NULL:
        return null;
    default:
        return key;
    }
}

From source file:com.codenjoy.dojo.kata.model.levels.NullAlgorithm.java

@Override
public String get(String input) {
    return StringUtils.EMPTY;
}

From source file:com.alibaba.otter.manager.biz.utils.RegexUtils.java

public static String findFirst(String originalStr, String regex) {
    if (StringUtils.isBlank(originalStr) || StringUtils.isBlank(regex)) {
        return StringUtils.EMPTY;
    }//  w  w  w . ja v  a2s  .  com

    PatternMatcher matcher = new Perl5Matcher();
    if (matcher.contains(originalStr, patterns.get(regex))) {
        return StringUtils.trimToEmpty(matcher.getMatch().group(0));
    }
    return StringUtils.EMPTY;
}

From source file:com.t163.handler.T163ErrorCodeHandler.java

public T163ErrorCode handle(HttpStatusCodeException error) {
    ObjectMapper objectMapper = new ObjectMapper();
    T163ErrorCode errorCode = new T163ErrorCode();
    errorCode.setRequest(StringUtils.EMPTY);
    errorCode.setErrorCode(error.getStatusCode().toString());
    errorCode.setError(error.getStatusText());
    try {/*w w  w .j  a  v  a  2  s . co  m*/
        errorCode = objectMapper.readValue(error.getResponseBodyAsByteArray(), T163ErrorCode.class);
    } catch (JsonParseException e) {
        log.error(ExceptionUtils.getFullStackTrace(e));
    } catch (JsonMappingException e) {
        log.error(ExceptionUtils.getFullStackTrace(e));
    } catch (IOException e) {
        log.error(ExceptionUtils.getFullStackTrace(e));
    }
    return errorCode;
}

From source file:com.googlecode.gmaps4jsf.jsfplugin.util.FacesMojoUtils.java

public static String getPrimitiveMethod(String type) {
    String toPrimitiveMethod = (String) toPrimitiveMap.get(type);

    if (StringUtils.isBlank(toPrimitiveMethod))
        return StringUtils.EMPTY; //if none found just return the same type
    else/* www  . j  av a2 s .  com*/
        return toPrimitiveMethod;
}

From source file:com.snaplogic.snaps.checkfree.SOAPExecuteTemplateEvaluatorImpl.java

@Override
protected Object findValue(String templateKey, Map<String, Object> allValues) throws InvalidPathException {
    Object value = super.findValue(templateKey, allValues);
    if (value == null) {
        allValues.put(templateKey, StringUtils.EMPTY);
        return StringUtils.EMPTY;
    }/*from   w  w w .j  a va2s.c om*/
    return value;
}

From source file:com.google.code.oauth.OAuth2Authenticator.java

/**
 * Connects and authenticates to an IMAP server with OAuth2. You must have called {@code initialize}.
 *
 * @param userEmail Email address of the user to authenticate, for example {@code oauth@gmail.com}.
 * @param oauthToken The user's OAuth token.
 *
 * @return An authenticated IMAPStore that can be used for IMAP operations.
 *//*w  ww. j ava  2s .c  o  m*/
public static IMAPStore connectToImap(String userEmail, String oauthToken) throws MessagingException {
    Properties props = new Properties();
    props.put("mail.imaps.sasl.enable", "true");
    props.put("mail.imaps.sasl.mechanisms", "XOAUTH2");
    props.put(OAuth2SaslClientFactory.OAUTH_TOKEN_PROP, oauthToken);
    Session session = Session.getInstance(props);

    IMAPSSLStore store = new IMAPSSLStore(session, null);
    store.connect("imap.gmail.com", 993, userEmail, StringUtils.EMPTY);
    return store;
}

From source file:com.microsoft.alm.plugin.external.models.ToolVersion.java

/**
 * constructor that takes a version string and creates a ToolVersion object by parsing the string.
 * Ex. 14.0.3.201603291047/*from w w  w. ja  v a  2s.c  om*/
 */
public ToolVersion(final String versionString) {
    final String[] parts = StringUtils.split(versionString, '.');
    major = getIntegerPart(parts, 0, 0);
    minor = getIntegerPart(parts, 1, 0);
    revision = getIntegerPart(parts, 2, 0);
    if (parts.length > 3) {
        build = parts[3];
    } else {
        build = StringUtils.EMPTY;
    }
}

From source file:com.amalto.core.storage.record.DataRecordDefaultWriterTest.java

public void testWrite() throws IOException {
    String xml = "<referenceField>[111][222][444]</referenceField>"; //$NON-NLS-1$

    FieldMetadata fieldMetadata = new ReferenceFieldMetadata(null, true, false, true, "referenceField", null, //$NON-NLS-1$
            null, Collections.<FieldMetadata>emptyList(), StringUtils.EMPTY, true, true, null, null, null, null,
            StringUtils.EMPTY, StringUtils.EMPTY);
    DataRecord record = new DataRecord(null, null);
    Object[] values = new Object[3];
    values[0] = "111"; //$NON-NLS-1$
    values[1] = "222"; //$NON-NLS-1$
    values[2] = "444"; //$NON-NLS-1$
    record.set(fieldMetadata, values);// www  .  ja v a 2s.  c  o  m

    ByteArrayOutputStream output = new ByteArrayOutputStream();
    DataRecordWriter dataRecordWriter = new DataRecordDefaultWriter();
    dataRecordWriter.write(record, output);
    String document = new String(output.toByteArray());
    assertEquals(true, document.contains(xml));
}