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.envision.envservice.common.util.SAPUtil.java

/**
 * To Field Code//from   w w  w  .j a  v  a 2  s .co m
 */
public static String toFieldCode(String sapInfo) {
    if (StringUtils.isEmpty(sapInfo)) {
        return StringUtils.EMPTY;
    }

    int codeStart = sapInfo.lastIndexOf(FIELD_PREFIX_CODE) + FIELD_PREFIX_CODE.length();
    int codeEnd = sapInfo.lastIndexOf(FIELD_SUFFIX_CODE);
    //      int codeEnd = sapInfo.indexOf(FIELD_SUFFIX_CODE);

    if (codeStart == -1 || codeEnd == -1) {
        return sapInfo;
    }

    return sapInfo.substring(codeStart, codeEnd);
}

From source file:com.amalto.core.save.context.Delete.java

public void save(SaverSession session, DocumentSaverContext context) {
    String typeName = context.getUserDocument().getType().getName();
    savedId = context.getId();//from  www  . j  a  v a2 s  .  c o  m
    if (savedId.length == 0) {
        throw new IllegalStateException("No ID information to save instance of '" + typeName + "'");
    }
    MutableDocument databaseDocument = context.getDatabaseDocument();
    if (!StringUtils.EMPTY.equals(context.getTaskId())) {
        databaseDocument.setTaskId(context.getTaskId());
    }
    session.delete(context.getDataCluster(), databaseDocument, databaseDocument.getDeleteType());
    // Save update report (if any)
    MutableDocument updateReportDocument = context.getUpdateReportDocument();
    if (updateReportDocument != null) {
        saveUpdateReport(updateReportDocument, session.getSaverSource(), session);
    }
}

From source file:com.amalto.core.save.DOMDocumentTest.java

public void testExportToString() throws Exception {
    BufferedReader in = new BufferedReader(
            new InputStreamReader(DOMDocumentTest.class.getResourceAsStream("test1.xml")));
    String line;// w  w w .j  ava2 s . c  o m
    String xml = "";
    while ((line = in.readLine()) != null) {
        xml += line;
    }
    DOMDocument doc = new DOMDocument(Util.parse(xml), null, StringUtils.EMPTY, StringUtils.EMPTY);
    assertNotNull(doc);
    assertNotNull(doc.exportToString());
    assertFalse(doc.exportToString().contains("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
}

From source file:com.weibo.api.Messages.java

/**
 * http://open.weibo.com/wiki/2/messages/invite
 * @param uid/*from  w  ww.  j  ava  2 s.  co  m*/
 * @param data
 * @param accessToken
 * @return
 */
public InviteResult invite(String uid, InviteData data, String accessToken) {
    String jsonData = StringUtils.EMPTY;
    try {
        ObjectMapper objectMapper = new ObjectMapper();
        jsonData = objectMapper.writeValueAsString(data);
    } catch (JsonGenerationException e) {
        log.error(ExceptionUtils.getFullStackTrace(e));
    } catch (JsonMappingException e) {
        log.error(ExceptionUtils.getFullStackTrace(e));
    } catch (IOException e) {
        log.error(ExceptionUtils.getFullStackTrace(e));
    }
    MultiValueMap<String, Object> map = new LinkedMultiValueMap<String, Object>();
    map.add("uid", uid);
    map.add("data", jsonData);
    map.add("access_token", accessToken);
    return weiboHttpClient.postForm(MESSAGES_INVITE_URL, map, InviteResult.class);
}

From source file:com.careerly.utils.PatternUtils.java

public static String getMatchString(String perl5RegExp, String content, int groupIndex) {
    List<String> matchGroups = PatternUtils.listMatchGroups(perl5RegExp, content);
    if (groupIndex > 0 && groupIndex < matchGroups.size()) {
        return matchGroups.get(groupIndex);
    }//from  w w  w .  j a v  a 2s.  co  m
    return StringUtils.EMPTY;
}

From source file:io.hops.hopsworks.api.zeppelin.rest.message.NotebookRepoSettingsRequest.java

public NotebookRepoSettingsRequest() {
    name = StringUtils.EMPTY;
    settings = Collections.emptyMap();
}

From source file:com.mmj.app.web.tools.EnumViewTools.java

public static String subjectEnumName(Integer v) {
    if (v == null) {
        return StringUtils.EMPTY;
    }/*  w  w w  .  j  a  v  a  2s .c  o m*/
    return SubjectEnum.getEnum(v).getName();
}

From source file:ips1ap101.lib.core.app.OrdenConjuntoResultados.java

@Override
public String toString() {
    String order = StringUtils.EMPTY;
    String token;//from w  w  w.j  a v  a 2s .co  m
    for (CriterioOrden criterio : criterios) {
        token = criterio.toString();
        order += StringUtils.isBlank(token) ? "" : COMA + token;
    }
    order = StringUtils.removeStart(order, COMA);
    return StringUtils.trimToNull(order);
}

From source file:ch.cyberduck.ui.action.DeleteWorker.java

@Override
public String getActivity() {
    return MessageFormat.format(Locale.localizedString("Deleting {0}", "Status"), StringUtils.EMPTY);
}

From source file:com.microsoft.alm.plugin.idea.git.starters.SimpleCheckoutStarterTest.java

@Test(expected = RuntimeException.class)
public void testCreateWithGitUrlBadUrl() {
    SimpleCheckoutStarter.createWithGitUrl(VALID_GIT_URL.replace("_git/", ""), StringUtils.EMPTY);
}