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

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

Introduction

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

Prototype

public static boolean isEmpty(String str) 

Source Link

Document

Checks if a String is empty ("") or null.

Usage

From source file:com.haulmont.cuba.client.testsupport.TestViewRepositoryClient.java

@Override
protected void init() {
    initialized = true;
    if (!StringUtils.isEmpty(viewsConfig))
        deployViews(viewsConfig);
}

From source file:com.sammyun.controller.console.TemplateController.java

/**
 * /* w w  w  .  j  a  v  a  2  s .com*/
 */
@RequestMapping(value = "/edit", method = RequestMethod.GET)
public String edit(String id, ModelMap model) {
    if (StringUtils.isEmpty(id)) {
        return ERROR_VIEW;
    }
    model.addAttribute("template", templateService.get(id));
    model.addAttribute("content", templateService.read(id));
    return "/console/template/edit";
}

From source file:com.alibaba.otter.manager.web.home.module.screen.monitor.MonitorTrigger.java

public void execute(@Param(name = "token") String token, Context context) throws Exception {

    if (StringUtils.isEmpty(token)) {
        context.put("result", "empty token");
        return;/*  ww  w. j a  v a  2  s. com*/
    }

    if (!verify(token)) {
        context.put("result", "invalided token");
        return;
    }

    try {
        globalMonitor.explore();
    } catch (Throwable e) {
        log.error("monitor trigger happens error", e);
        context.put("result", e);
        return;
    }
    context.put("result", true);
}

From source file:com.shin1ogawa.appengine.marketplace.controller.ConfigureForAdminController.java

@Override
protected Navigation setUp() {
    domain = asString("domain");
    if (StringUtils.isEmpty(domain)) {
        return redirect(Configuration.get().getMarketplaceListingUrl());
    }//from  ww w .j a va 2 s. c  om
    UserService us = UserServiceFactory.getUserService();
    if (us.isUserLoggedIn() == false) {
        // if user had not been authenticated then send redirect to login url.
        String callbackURL = request.getRequestURL() + "?domain=" + domain;
        logger.log(Level.INFO, "had not been authenticated: callback=" + callbackURL);
        return redirect(us.createLoginURL(callbackURL, domain,
                "https://www.google.com/accounts/o8/site-xrds?hd=" + domain, null));
    }
    if (StringUtils.contains(us.getCurrentUser().getFederatedIdentity(), domain) == false) {
        // if user had been authenticated but invalid domain then send redirect to logout url.
        String callbackURL = request.getRequestURL() + "?domain=" + domain;
        logger.log(Level.INFO, "invalid domain: callback=" + callbackURL);
        return redirect(us.createLogoutURL(callbackURL, domain));
    }
    delegate = IncreaseURLFetchDeadlineDelegate.install();
    NamespaceManager.set(domain);
    return super.setUp();
}

From source file:com.wso2telco.services.dep.sandbox.util.CommonUtil.java

public static void validatePositiveNumber(String number, String parameterName) throws SandboxException {
    if (!StringUtils.isEmpty(number) && !NumberUtils.isDigits(number)) {
        throw new SandboxException(SandboxErrorType.INVALID_INPUT_VALUE);
    }/*from w  w  w .j ava 2 s .co m*/
}

From source file:fr.exanpe.tapestry.tldgen.utils.JavadocBeanMerger.java

/**
 * Merge the information collected through annotations and Javadoc into the final structure
 * /*from w w w. j  a  v a  2s . c o m*/
 * @param taglib the taglib structure
 * @param infos the Javadoc structure
 */
public static void mergeToTaglib(Taglib taglib, ComponentsInfoBean infos) {

    for (Tag t : taglib.getTags()) {
        ComponentBean comp = infos.getComponentByClassName(t.getTagClass());

        // infos have been collected through Javadoc
        if (comp != null) {
            t.setDescription(comp.getDescription());

            for (Attribute a : t.getAttributes()) {

                ParameterBean param = comp.getParameterByName(a.getName());

                String description = null;

                if (param != null) {
                    description = param.getDescription();
                } else {
                    description = getParentAttributeDescription(comp, a, infos);
                }

                if (StringUtils.isEmpty(description))
                    description = TapestryTldGenConstants.NO_DESCRIPTION;

                a.setDescription(description + TapestryTldGenConstants.DEFAULT_TLD_SEPARATOR
                        + a.getParameterDescription());
            }
        }
    }
}

From source file:com.intel.cosbench.config.Stage.java

public void setName(String name) {
    if (StringUtils.isEmpty(name))
        throw new ConfigException("stage name cannot be empty");
    this.name = name;
}

From source file:be.fedict.eid.pkira.blm.model.usermgmt.validation.ValidNationalRegisterNumberValidator.java

@Override
public boolean isValid(Object value) {
    String nationalRegisterNumber = (String) value;
    if (StringUtils.isEmpty(nationalRegisterNumber)) {
        return true;
    }//w ww . j  a  va  2  s . com

    return isValidNumberPattern(nationalRegisterNumber);
}

From source file:com.ancientprogramming.fixedformat4j.format.impl.BooleanFormatter.java

public Boolean asObject(String string, FormatInstructions instructions) throws FixedFormatException {
    Boolean result = false;/*  www.  j  a v a 2 s . c  o m*/
    if (!StringUtils.isEmpty(string)) {
        if (instructions.getFixedFormatBooleanData().getTrueValue().equals(string)) {
            result = true;
        } else if (instructions.getFixedFormatBooleanData().getFalseValue().equals(string)) {
            result = false;
        } else {
            throw new FixedFormatException(
                    "Could not convert string[" + string + "] to boolean value according to booleanData["
                            + instructions.getFixedFormatBooleanData() + "]");
        }
    }
    return result;
}

From source file:com.ge.predix.test.utils.ZacTestUtil.java

public void assumeZacServerAvailable() {
    // Not all tests use Spring so try to get the URL from the environment.
    if (StringUtils.isEmpty(this.zacUrl)) {
        this.zacUrl = System.getenv("ZAC_URL");
    }// ww  w .  j a v a 2s  . c  o  m
    if (!isServerListening(URI.create(this.zacUrl))) {
        throw new SkipException("Skipping tests because ZAC is not available.");
    }
}