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

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

Introduction

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

Prototype

String EMPTY

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

Click Source Link

Document

The empty String "" .

Usage

From source file:io.sugo.grok.api.Grok.java

/**
 * Create a new <i>empty</i>{@code Grok} object.
 *//*from www . j  ava 2s.  co m*/
public Grok() {
    originalGrokPattern = StringUtils.EMPTY;
    disco = null;
    namedRegex = StringUtils.EMPTY;
    compiledNamedRegex = null;
    grokPatternDefinition = new TreeMap<String, String>();
    namedRegexCollection = new TreeMap<String, String>();
    savedPattern = StringUtils.EMPTY;
}

From source file:com.qwazr.library.cassandra.CassandraSession.java

private Session checkSession() {

    Session s = rwl.read(() -> {//from w  ww .  j a  v  a2 s .  c o  m
        lastUse = System.currentTimeMillis();
        return session != null && !session.isClosed() ? session : null;
    });
    if (s != null)
        return s;

    try {
        return rwl.writeEx(() -> {
            if (session != null && !session.isClosed())
                return session;
            if (cluster == null || cluster.isClosed())
                throw new DriverException("The cluster is closed");
            logger.finest(() -> "Create session " + keySpace == null ? StringUtils.EMPTY : keySpace);
            session = keySpace == null ? cluster.connect() : cluster.connect(keySpace);
            return session;
        });
    } catch (ReadWriteLock.InsideLockException e) {
        if (e.exception instanceof RuntimeException)
            throw (RuntimeException) e.exception;
        throw e;
    }
}

From source file:de.blizzy.documentr.markdown.macro.MessageSourceMacroDescriptor.java

@Override
public String getDescription(Locale locale) {
    try {//from ww w  .ja  v  a 2s. c  om
        return messageSource.getMessage("macro." + macroName + ".description", null, locale); //$NON-NLS-1$ //$NON-NLS-2$
    } catch (NoSuchMessageException e) {
        return StringUtils.EMPTY;
    }
}

From source file:com.aqnote.app.wifianalyzer.wifi.AccessPointsDetailTest.java

@Test
public void testSetViewWithConfiguredImageVisible() throws Exception {
    // setup//from  ww  w .j  av a2  s .c o m
    WiFiAdditional wiFiAdditional = new WiFiAdditional(StringUtils.EMPTY, "IPAddress", 22);
    WiFiDetail wiFiDetail = withWiFiDetail("SSID", wiFiAdditional);
    // execute
    fixture.setView(mainActivity.getResources(), view, wiFiDetail, false);
    // validate
    assertEquals(View.VISIBLE, view.findViewById(R.id.configuredImage).getVisibility());
}

From source file:com.qwazr.store.store.StoreService.java

@HEAD
@Path("/")
public Response head(@Context UriInfo uriInfo) throws IOException {
    return head(uriInfo, StringUtils.EMPTY);
}

From source file:com.omnigon.aem.handlebars.helpers.UniqueIdHelper.java

private String generateUniqueId() {
    byte[] bytesDirectoryPath;
    MessageDigest md;/*from   w w w . j  a v a  2  s.  c om*/
    try {
        bytesDirectoryPath = UUID.randomUUID().toString().getBytes(CharEncoding.UTF_8);
        md = MessageDigest.getInstance(MESSAGE_DIGEST_TYPE);
    } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
        LOG.error(e.getMessage(), e);
        return StringUtils.EMPTY;
    }
    md.reset();
    md.update(bytesDirectoryPath);

    String uniqueId = DatatypeConverter.printHexBinary(md.digest());
    String formattedUniqueId = formatUniqueId(uniqueId);

    return formattedUniqueId;
}

From source file:com.threewks.thundr.user.oauth.google.GoogleOAuthProviderHttpService.java

/**
 * /*from www. j a va  2 s .c o  m*/
 * @param requestToken
 * @param verifier
 */
@SuppressWarnings("unchecked")
@Override
public Token getAccessToken(Token requestToken, Verifier verifier) {
    OAuthRequest request = new OAuthRequest(goolgleApi.getAccessTokenVerb(),
            goolgleApi.getAccessTokenEndpoint());
    request.addBodyParameter(OAuthConstants.CODE, verifier.getValue());
    request.addBodyParameter(OAuthConstants.CLIENT_ID, config.getApiKey());
    request.addBodyParameter(OAuthConstants.CLIENT_SECRET, config.getApiSecret());
    request.addBodyParameter(OAuthConstants.REDIRECT_URI, config.getCallback());
    request.addBodyParameter(REQUEST_KEY_GRANT_TYPE, REQUEST_VALUE_AUTHORIZATION_CODE);
    String response = sendRequest(request);
    Map<String, String> values = gson.fromJson(response, Map.class);
    String accessToken = values.get(RESPONSE_ACCESS_TOKEN_KEY);
    return new Token(accessToken, StringUtils.EMPTY, response);
}

From source file:com.nridge.core.base.std.XMLUtl.java

public static String escapeElemStrValue(String aValue) {
    if (StringUtils.isEmpty(aValue))
        return StringUtils.EMPTY;
    else {//from   www  .ja  v a2 s.co  m
        int offset = aValue.indexOf("<![CDATA[");
        while (offset != -1) {
            aValue = aValue.substring(0, offset) + aValue.substring(offset + 9);
            offset = aValue.indexOf("]]>");
            if (offset != -1)
                aValue = aValue.substring(0, offset) + aValue.substring(offset + 3);
            offset = aValue.indexOf("<![CDATA[");
        }
        return String.format("<![CDATA[%s]]>", aValue);
    }
}

From source file:de.knightsoftnet.navigation.client.event.ChangePlaceEvent.java

/**
 * get/create token out of placeRequest.
 *
 * @return token string//from w w  w .  j  av  a  2  s .  c  o m
 */
public final String getToken() {
    if (this.placeRequest == null) {
        return null;
    }
    if (this.placeRequest.getParameterNames() == null || this.placeRequest.getParameterNames().size() == 0) {
        return this.placeRequest.getNameToken();
    }
    final StringBuilder token = new StringBuilder();
    token.append(this.placeRequest.getNameToken());
    for (final String param : this.placeRequest.getParameterNames()) {
        token.append(';');
        token.append(param);
        token.append('=');
        token.append(this.placeRequest.getParameter(param, StringUtils.EMPTY));
    }
    return token.toString();
}

From source file:com.msg.wmTestHelper.codeModel.part.WaitStepPart.java

private String evaluateTypeOfWaitStep(ProcessStep processStep) {
    String documentName = processStep.message().documentName();

    if (StringUtils.isNotEmpty(documentName)) {
        if (ProprietaryHelper.getConfig("wait.1.startmessage").equals(documentName)) {
            return ProprietaryHelper.getConfig("wait.1.name");
        } else if (ProprietaryHelper.getConfig("wait.2.startmessage").equals(documentName)) {
            return ProprietaryHelper.getConfig("wait.2.name");
        } else if (ProprietaryHelper.getConfig("wait.3.startmessage").equals(documentName)) {
            return ProprietaryHelper.getConfig("wait.3.name");
        }//from  ww  w  .  j a  va  2 s . c  om
    }

    log.warn("Could not evaluate type of wait step");

    return StringUtils.EMPTY;
}