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.cyberduck.core.sds.SDSQuotaFeature.java

@Override
public Space get() throws BackgroundException {
    try {/*from   www .  j  a v a  2 s . c  o  m*/
        final Path home = new DefaultHomeFinderService(session).find();
        if (!home.isRoot()) {
            final Node node = new NodesApi(session.getClient()).getFsNode(StringUtils.EMPTY,
                    Long.parseLong(
                            new SDSNodeIdProvider(session).getFileid(home, new DisabledListProgressListener())),
                    null);
            if (null == node.getQuota()) {
                log.warn(String.format("No quota set for node %s", home));
            } else {
                return new Space(node.getSize(), node.getQuota() - node.getSize());
            }
        }
        final CustomerData info = new UserApi(session.getClient()).getCustomerInfo(StringUtils.EMPTY, null);
        return new Space(info.getSpaceUsed(), info.getSpaceLimit() - info.getSpaceUsed());
    } catch (ApiException e) {
        throw new SDSExceptionMappingService().map("Failure to read attributes of {0}", e,
                new Path(String.valueOf(Path.DELIMITER), EnumSet.of(Path.Type.volume, Path.Type.directory)));
    }
}

From source file:com.norconex.jefmon.instance.tree.DateStartedColumn.java

private String getTimeString(Date date) {
    if (date == null) {
        return StringUtils.EMPTY;
    }//w ww .j  av a2 s  .  co  m
    Locale locale = JEFMonSession.getSession().getLocale();
    String pattern = "yyyy-MMM-dd - H:mm:ss";
    return DateTimeFormat.forPattern(pattern).withLocale(locale).print(date.getTime());
}

From source file:ch.cyberduck.core.sds.SDSAttributesFinderFeature.java

@Override
public PathAttributes find(final Path file) throws BackgroundException {
    try {//from  w  ww  .j  av a 2s  . co  m
        final Node node = new NodesApi(session.getClient()).getFsNode(StringUtils.EMPTY,
                Long.parseLong(
                        new SDSNodeIdProvider(session).getFileid(file, new DisabledListProgressListener())),
                null);
        return this.toAttributes(node);
    } catch (ApiException e) {
        throw new SDSExceptionMappingService().map("Failure to read attributes of {0}", e, file);
    }
}

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

/**
 * Format sql arg.//from   www.j  a  v a2  s  . c o m
 *
 * @param arg the arg
 * @return the string
 */
public static String formatSqlArg(Object arg) {
    if (arg == null) {
        return "NULL";
    }
    if (arg instanceof String) {
        // TODO replace with proper SQL escaping
        return '\'' + StringUtils.replace((String) arg, "'", "''") + '\'';
    }
    if (arg instanceof java.util.Date) {
        return formatSqlDate((java.util.Date) arg);
    }
    // TODO (Rx) rrk (low) format Date, Timestamp und BigDecimal fuer sql log anzeige
    return Objects.toString(arg, StringUtils.EMPTY);
}

From source file:info.magnolia.ui.vaadin.integration.contentconnector.DefaultContentConnector.java

@Override
public String getItemUrlFragment(Object itemId) {
    return StringUtils.EMPTY;
}

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

/**
 * Gets the request for logging.//from  www  .j av a2 s.c  o m
 *
 * @param request the request
 * @param excludingKeys the excluding keys
 * @return the request for logging
 */
public static String getRequestForLogging(Map<String, Object> request, String... excludingKeys) {
    if (request == null || request.isEmpty() == true) {
        return "<no params>";
    }
    StringBuilder sb = new StringBuilder();
    for (Map.Entry<String, Object> me : request.entrySet()) {
        final String key = me.getKey();
        String value = Objects.toString(me.getValue(), StringUtils.EMPTY);
        for (String exKey : excludingKeys) {
            if (StringUtils.equals(key, exKey) == true) {
                value = "****";
                break;
            }
        } // for

        sb.append(key).append('=').append(value).append('\n');
    }
    return sb.toString();
}

From source file:eu.smeny.jpapercut.smtp.SmtpSession.java

public void reset() {
    mailFrom = StringUtils.EMPTY;
    utf8Used = false;
    recipients.clear();
}

From source file:com.aqnote.app.wifianalyzer.wifi.graph.channel.ChannelAxisLabel.java

@Override
public String formatLabel(double value, boolean isValueX) {
    String result = StringUtils.EMPTY;

    int valueAsInt = (int) (value + (value < 0 ? -0.5 : 0.5));
    if (isValueX) {
        result += findChannel(valueAsInt);
    } else {//from   w w  w.ja v a2s .  c  om
        if (valueAsInt <= GraphViewBuilder.MAX_Y && valueAsInt > GraphViewBuilder.MIN_Y) {
            result += valueAsInt;
        }
    }
    return result;
}

From source file:com.github.haixing_hu.data.model.common.Country.java

/**
 * Constructs an empty {@link Country}.
 */
public Country() {
    code = StringUtils.EMPTY;
    name = StringUtils.EMPTY;
    abbreviation = null;
    description = null;
}

From source file:com.github.haixing_hu.data.model.common.Language.java

/**
 * Constructs an empty {@link Language}.
 */
public Language() {
    code = StringUtils.EMPTY;
    name = StringUtils.EMPTY;
    abbreviation = null;
    description = null;
}