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:ch.sentric.QueryFactoryTest.java

@Test
public void buildShouldReturnNothingWhenJessionIsTheOnlyParameter() {
    final Query query = new QueryFactory().build("jsessionid=9ADD207E33B1E66CE6121BC73AADB986");
    assertEquals(StringUtils.EMPTY, query.getAsSortedString());
}

From source file:ch.cyberduck.ui.cocoa.PromptLimitedListProgressListener.java

@Override
public void chunk(final Path parent, final AttributedList<Path> list) throws ListCanceledException {
    if (suppressed) {
        return;//from w w  w .  j av a  2  s.c om
    }
    try {
        super.chunk(parent, list);
    } catch (ListCanceledException e) {
        if (controller.isVisible()) {
            final AtomicBoolean c = new AtomicBoolean(true);
            final NSAlert alert = NSAlert.alert(
                    MessageFormat.format(LocaleFactory.localizedString("Listing directory {0}", "Status"),
                            StringUtils.EMPTY),
                    MessageFormat.format(
                            LocaleFactory.localizedString(
                                    "Continue listing directory with more than {0} files.", "Alert"),
                            e.getChunk().size()),
                    LocaleFactory.localizedString("Continue", "Credentials"), null,
                    LocaleFactory.localizedString("Cancel"));
            alert.setShowsSuppressionButton(true);
            alert.suppressionButton().setTitle(LocaleFactory.localizedString("Always"));
            final AlertController sheet = new AlertController(controller, alert) {
                @Override
                public void callback(final int returncode) {
                    if (returncode == SheetCallback.DEFAULT_OPTION) {
                        suppressed = true;
                    }
                    if (returncode == SheetCallback.CANCEL_OPTION) {
                        c.set(false);
                    }
                    if (alert.suppressionButton().state() == NSCell.NSOnState) {
                        disable();
                    }
                }
            };
            sheet.beginSheet();
            if (!c.get()) {
                throw e;
            }
        }
    }
}

From source file:com.vrem.wifianalyzer.wifi.model.WiFiAdditionalTest.java

@Test
public void testWiFiAdditionalEmpty() throws Exception {
    // validate/*from w  w  w .  j a v  a2  s. c  om*/
    assertEquals(StringUtils.EMPTY, WiFiAdditional.EMPTY.getVendorName());
    assertFalse(WiFiAdditional.EMPTY.isConfiguredNetwork());
}

From source file:gobblin.data.management.conversion.hive.source.BackfillHiveSource.java

@VisibleForTesting
public void initBackfillHiveSource(SourceState state) {
    this.partitionsWhitelist = Sets.newHashSet(Splitter.on(",").omitEmptyStrings().trimResults()
            .split(state.getProp(BACKFILL_SOURCE_PARTITION_WHITELIST_KEY, StringUtils.EMPTY)));
}

From source file:com.neatresults.mgnltweaks.ui.field.TemplatePathConverter.java

@Override
public String convertToPresentation(String path, Class<? extends String> targetType, Locale locale)
        throws ConversionException {
    String res = StringUtils.EMPTY;
    if (StringUtils.isBlank(path)) {
        return res;
    }/*from   w  w w  .j av a  2s . c  om*/
    path = StringUtils.substringBeforeLast(path, ".ftl");
    res = path;
    return res;
}

From source file:de.micromata.genome.logging.LogRequestDumpAttribute.java

/**
 * Gen http request dump./*from w w  w.  ja v  a 2  s  .c  o m*/
 *
 * @param req the req
 * @return the string
 */
@SuppressWarnings("unchecked")
public static String genHttpRequestDump(HttpServletRequest req) {
    StringBuilder sb = new StringBuilder();

    sb.append("method: ").append(req.getMethod()).append('\n')//
            .append("requestURL: ").append(req.getRequestURL()).append('\n')//
            .append("servletPath: ").append(req.getServletPath()).append('\n')//
            .append("requestURI: ").append(req.getRequestURI()).append('\n') //
            .append("queryString: ").append(req.getQueryString()).append('\n') //
            .append("pathInfo: ").append(req.getPathInfo()).append('\n')//
            .append("contextPath: ").append(req.getContextPath()).append('\n') //
            .append("characterEncoding: ").append(req.getCharacterEncoding()).append('\n') //
            .append("localName: ").append(req.getLocalName()).append('\n') //
            .append("contentLength: ").append(req.getContentLength()).append('\n') //
    ;
    sb.append("Header:\n");
    for (Enumeration<String> en = req.getHeaderNames(); en.hasMoreElements();) {
        String hn = en.nextElement();
        sb.append("  ").append(hn).append(": ").append(req.getHeader(hn)).append("\n");
    }
    sb.append("Attr: \n");
    Enumeration en = req.getAttributeNames();
    for (; en.hasMoreElements();) {
        String k = (String) en.nextElement();
        Object v = req.getAttribute(k);
        sb.append("  ").append(k).append(": ").append(Objects.toString(v, StringUtils.EMPTY)).append('\n');
    }

    return sb.toString();
}

From source file:eu.operando.operandoapp.wifi.model.WiFiAdditional.java

public WiFiAdditional(@NonNull String vendorName, boolean configuredNetwork,
        WifiConfiguration wifiConfiguration) {
    this(vendorName, StringUtils.EMPTY, WiFiConnection.LINK_SPEED_INVALID, configuredNetwork);
    this.wiFiApConfig = APL.getWiFiAPConfiguration(wifiConfiguration);
}

From source file:com.qualys.jserf.SerfClientIT.java

@Test(timeout = 10000)
public void testHandShake() throws Exception {
    while (!client.isConnected()) {
        Thread.sleep(500);/*from w w  w  .jav  a2s  .  c  om*/
    }
    final boolean[] callbackInvoked = { false };
    final CountDownLatch latch = new CountDownLatch(1);

    SerfResponseCallBack<EmptyResponseBody> callBack = new SerfResponseCallBack<EmptyResponseBody>() {
        @Override
        public void call(SerfResponse<EmptyResponseBody> response) {
            log.debug("Received call back with sequence {}", response.getHeader().getSeq());
            callbackInvoked[0] = true;

            assertNotNull(response.getHeader());
            assertEquals(StringUtils.EMPTY, response.getHeader().getError());
            assertNotNull(response.getBody());
            assertEquals(EmptyResponseBody.class, response.getBody().getClass());

            //don't count down unless all the asserts pass
            latch.countDown();
        }
    };
    SerfRequest request = SerfRequests.handshake(callBack);

    client.makeRpc(request);
    latch.await();

    assertTrue(callbackInvoked[0]);
}

From source file:com.gammalabs.wifianalyzer.wifi.band.WiFiChannelCountry.java

@NonNull
public String getCountryName() {
    String countryName = country.getDisplayCountry();
    if (countryName == null) {
        countryName = StringUtils.EMPTY;
    }// ww w  . j av  a 2 s  . c o  m
    return country.getCountry().equals(countryName) ? countryName + UNKNOWN : countryName;
}

From source file:com.btmatthews.selenium.junit4.runner.ServerFactory.java

/**
 * Return a string to identify the browser by trimming the leading * from
 * the {@code browserStartCommand}.//from w w w. j  a  va  2s.c  o m
 *
 * @return The derived browser identification string.
 */
public String getBrowser() {
    String browser;
    if (StringUtils.startsWith(browserStartCommand, "*")) {
        browser = browserStartCommand.substring(1);
    } else {
        browser = StringUtils.EMPTY;
    }
    return browser;
}