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:de.blizzy.documentr.web.util.FacadeHostRequestWrapper.java

public static String buildFacadeUrl(String url, String contextPath, String documentrHost) {
    contextPath = StringUtils.defaultIfBlank(contextPath, StringUtils.EMPTY);
    if (contextPath.equals("/")) { //$NON-NLS-1$
        contextPath = StringUtils.EMPTY;
    }/*from ww  w  . ja v a2  s.c om*/

    String newUrl;
    if (StringUtils.isNotBlank(contextPath)) {
        int pos = url.indexOf(contextPath);
        newUrl = documentrHost + url.substring(pos + contextPath.length());
    } else {
        UriComponentsBuilder builder;
        try {
            builder = UriComponentsBuilder.fromHttpUrl(url);
        } catch (IllegalArgumentException e) {
            builder = UriComponentsBuilder.fromUriString(url);
        }
        String path = StringUtils.defaultIfBlank(builder.build().getPath(), StringUtils.EMPTY);
        if (StringUtils.isNotBlank(path)) {
            int pos = StringUtils.lastIndexOf(url, path);
            newUrl = documentrHost + url.substring(pos);
        } else {
            newUrl = documentrHost;
        }
    }
    return newUrl;
}

From source file:com.beginner.core.utils.SmsUtil.java

/**
 * ????//from w  w w  .  ja va  2  s.c  o m
 * @param mobile ?
 * @param code  
 */
public static void sendSms1(String mobile, String code) {
    String account = StringUtils.EMPTY, password = StringUtils.EMPTY, strSMS1 = StringUtils.EMPTY;
    if (null != strSMS1 && !"".equals(strSMS1)) {
        String strS1[] = strSMS1.split(",beginner,");
        if (strS1.length == 2) {
            account = strS1[0];
            password = strS1[1];
        }
    }
    String PostData = "";
    try {
        PostData = "account=" + account + "&password=" + password + "&mobile=" + mobile + "&content="
                + URLEncoder.encode(code, "utf-8");
    } catch (UnsupportedEncodingException e) {
        System.out.println("??");
    }
    //System.out.println(PostData);
    String ret = SMS(PostData, "http://sms.106jiekou.com/utf8/sms.aspx");
    System.out.println(ret);
    /*  
    100         ???
    101         ?
    102         ????
    103         ?
    104         
    105         
    106         ??
    107         Ip??
    108         ?????????
    109         ???
    110         ????
    111         ????
    120         ?
    */

}

From source file:com.cognifide.qa.bb.email.SubjectSearchTermTest.java

@Parameters
public static Collection<Object[]> parameters() {
    return Arrays.asList(new Object[][] { { VALID_SUBJECT, true }, { INVALID_SUBJECT, false },
            { StringUtils.EMPTY, false }, { null, false } });
}

From source file:com.navercorp.pinpoint.collector.cluster.zookeeper.job.ZookeeperJob.java

public ZookeeperJob(Type type) {
    this(type, StringUtils.EMPTY);
}

From source file:com.ormanli.duplicatefinder.util.FileUtil.java

private static List<File> getFileList(String directory) {
    try {//from w w  w  . java 2 s.  c  o  m
        return Files.fileTreeTraverser().breadthFirstTraversal(new File(directory)).filter(isEven).toList();
    } catch (Exception e) {
        logger.error(StringUtils.EMPTY, e);
    }

    return new ArrayList<File>();
}

From source file:com.amazon.alexa.avs.message.request.Event.java

public Event(Header header, Payload payload) {
    super(header, payload, StringUtils.EMPTY);
}

From source file:de.lgblaumeiser.ptm.cli.engine.handler.AddActivitiyTest.java

@Test(expected = IllegalStateException.class)
public void testAddActivityTwoParamFirstEmpty() {
    testee.handleCommand(asList(StringUtils.EMPTY, ACTIVITY1NUMBER));
}

From source file:com.cognifide.aet.communication.api.execution.SuiteStatusResult.java

public SuiteStatusResult(ProcessingStatus status) {
    this(status, StringUtils.EMPTY);
}

From source file:net.codestory.http.templating.helpers.EachValueHelperSource.java

public CharSequence each_value(Object context, Options options) throws IOException {
    if (context == null) {
        return StringUtils.EMPTY;
    }//from ww  w. j a  v a 2  s  . c o m

    Object param = options.param(0);

    return (param instanceof Iterable<?>) ? iterableContext(context, (Iterable<?>) param, options)
            : hashContext(context, param, options);
}

From source file:net.codestory.http.templating.helpers.EachReverseHelperSource.java

public CharSequence each_reverse(Object context, Options options) throws IOException {
    if (context == null) {
        return StringUtils.EMPTY;
    }/*from   w w w  .j  av a 2s  .  com*/

    return (context instanceof Iterable<?>) ? iterableContext((Iterable<?>) context, options)
            : hashContext(context, options);
}