Example usage for org.apache.commons.lang StringUtils isNotEmpty

List of usage examples for org.apache.commons.lang StringUtils isNotEmpty

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils isNotEmpty.

Prototype

public static boolean isNotEmpty(String str) 

Source Link

Document

Checks if a String is not empty ("") and not null.

Usage

From source file:com.bstek.dorado.view.type.property.CommonPropertyDefOutputter.java

@Override
protected void outputObjectProperties(Object object, OutputContext context) throws Exception {
    if (StringUtils.isNotEmpty(type)) {
        context.getJsonBuilder().key("$type").value(type);
    }//from  w w  w  .ja v a 2 s.  c  o  m
    super.outputObjectProperties(object, context);
}

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

/**
 * @param value     Existing attributes//from w  w w.ja v  a2 s . c  o  m
 * @param hyperlink URL
 * @return Clickable and underlined string to put into textfield.
 */
public static NSAttributedString create(final NSMutableAttributedString value, final String hyperlink) {
    if (StringUtils.isNotEmpty(hyperlink)) {
        final NSRange range = NSRange.NSMakeRange(new NSUInteger(0), value.length());
        value.beginEditing();
        value.addAttributeInRange(NSMutableAttributedString.LinkAttributeName, hyperlink, range);
        // make the text appear in blue
        value.addAttributeInRange(NSMutableAttributedString.ForegroundColorAttributeName, NSColor.blueColor(),
                range);
        // system font
        value.addAttributeInRange(NSMutableAttributedString.FontAttributeName,
                NSFont.systemFontOfSize(NSFont.smallSystemFontSize()), range);
        // next make the text appear with an underline
        value.addAttributeInRange(NSMutableAttributedString.UnderlineStyleAttributeName,
                NSNumber.numberWithInt(NSMutableAttributedString.SingleUnderlineStyle), range);
        value.endEditing();
    }
    return value;
}

From source file:com.nec.harvest.userdetails.AuthenticatedUserDetails.java

/**
 * Find all the information of logged-in user
 * //ww w .  ja  v  a 2s. c  o  m
 * @return
 */
public static com.nec.harvest.model.User getUserPrincipal() {
    com.nec.harvest.model.User userDetail = null;

    // UserPrincipal's name
    String username = getUsername();
    if (StringUtils.isNotEmpty(username)) {
        userDetail = cacheService.get(username);
        if (userDetail == null) {
            userDetail = ContextAwareContainer.getInstance().getComponent(UserService.class)
                    .findByUsrCode(username);

            //
            cacheService.put(username, userDetail);
        }
    }
    return userDetail;
}

From source file:com.enonic.cms.business.resolver.ForceResolverValueServiceImpl.java

public String getForcedResolverValue(ResolverContext context, String forcedValueKey) {

    String forcedDeviceClass = getForcedResolverValueFromCookie(context.getRequest(), forcedValueKey);

    if (StringUtils.isNotEmpty(forcedDeviceClass)) {
        return forcedDeviceClass;
    }/*from  ww w  .j  a v a2 s.  com*/

    return getForcedDeviceClassFromSession(context.getRequest(), forcedValueKey);
}

From source file:com.lyh.licenseworkflow.web.filter.LoginFilter.java

public void init(FilterConfig filterConfig) throws ServletException {
    String ignoreStr = filterConfig.getInitParameter("ignoreUrl");
    if (StringUtils.isNotEmpty(ignoreStr)) {
        String igs[] = ignoreStr.split(",");
        for (String ig : igs) {
            ingoreUrls.add(ig.trim());/*from w  ww  .j  a  v a  2s  .  co  m*/
        }
    }
}

From source file:com.haulmont.cuba.core.entity.LocaleHelper.java

public static Map<String, String> getLocalizedValuesMap(String localeBundle) {
    if (StringUtils.isNotEmpty(localeBundle)) {
        Properties localeProperties = loadProperties(localeBundle);
        if (localeProperties != null) {
            Map<String, String> map = new HashMap<>();
            for (Map.Entry<Object, Object> entry : localeProperties.entrySet()) {
                map.put((String) entry.getKey(), (String) entry.getValue());
            }/*from  ww  w. j  a  v  a 2 s. c  o m*/
            return map;
        }
    }
    return Collections.emptyMap();
}

From source file:de.erdesignerng.util.JasperUtils.java

private static void findReports(Map<File, String> aReportMap, File aDirectory) throws JRException {
    Thread.currentThread().setContextClassLoader(JasperUtils.class.getClassLoader());
    if (aDirectory != null && aDirectory.exists() && aDirectory.canRead()) {
        for (File theFile : aDirectory.listFiles()) {
            String theName = theFile.getName();
            if (theName.endsWith(".jrxml") && (!theName.contains("_"))) {
                try {
                    JasperDesign theDesign = JRXmlLoader.load(new FileInputStream(theFile));
                    String theReportName = theDesign.getName();
                    if (StringUtils.isNotEmpty(theReportName)) {
                        aReportMap.put(theFile, theReportName);
                    }//w ww .  j a va  2  s . c  om
                } catch (FileNotFoundException e) {
                    // This cannot happen
                }

            } else {
                if ((theFile.isDirectory()) && (!".".equals(theName)) && (!"..".equals(theName))) {
                    findReports(aReportMap, theFile);
                }
            }
        }
    }
}

From source file:fr.hoteia.qalingo.core.web.cache.util.impl.WebCacheHelperImpl.java

/**
 * @return the TTL value for an element.
 *//* www . j  a  va  2s  .  com*/
@Override
public int getElementTimeToLive(final WebElementType elementType) {
    String elementTimeToLiveSetting = engineSettingService
            .getEngineSettingByCode(EngineSettingService.WEB_CACHE_ELEMENT_TIME_TO_LIVE).getDefaultValue();
    if (StringUtils.isNotEmpty(elementTimeToLiveSetting)) {
        return Integer.parseInt(elementTimeToLiveSetting);
    }
    return 3600;
}

From source file:com.microsoft.alm.plugin.external.commands.GetLocalPathCommand.java

@Override
public ToolRunner.ArgumentBuilder getArgumentBuilder() {
    final ToolRunner.ArgumentBuilder builder = super.getArgumentBuilder().add(serverPath);
    if (StringUtils.isNotEmpty(workspace)) {
        builder.addSwitch("workspace", workspace);
    }//from   ww w .j a v a2  s .  co  m
    return builder;
}

From source file:fr.exanpe.t5.lib.services.ExanpeComponentService.java

public void reorderCSSClassDeclaration(Element e, String componentRootCssClass) {
    String customCSSClass = e.getAttribute(CSS_CLASS_ATTRIBUTE);

    if (StringUtils.isNotEmpty(customCSSClass)) {
        String cssclasses = componentRootCssClass + " " + customCSSClass;
        e.forceAttributes(CSS_CLASS_ATTRIBUTE, cssclasses);
    } else {//from www  . j  a va  2  s  .  c om
        e.attribute(CSS_CLASS_ATTRIBUTE, componentRootCssClass);
    }
}