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:de.torstenwalter.maven.plugins.AbstractDatapumpMojo.java

protected void addCommonArguments(CommandLine commandLine) throws MojoFailureException {
    commandLine.addArgument("'" + getConnectionIdentifier() + "'", false);

    if (StringUtils.isNotEmpty(content)) {
        commandLine.addArgument("CONTENT=" + content);
    }/*from ww w.  jav a 2  s.c  o  m*/

    commandLine.addArgument("DIRECTORY=" + directory);

    if (StringUtils.isNotEmpty(dumpfile)) {
        commandLine.addArgument("DUMPFILE=" + dumpfile);
    }

    if (StringUtils.isNotEmpty(exclude)) {
        commandLine.addArgument("EXCLUDE=" + exclude);
    }

    if (StringUtils.isNotEmpty(include)) {
        commandLine.addArgument("INCLUDE=" + include);
    }

    if (StringUtils.isNotEmpty(logfile)) {
        commandLine.addArgument("LOGFILE=" + logfile);
    }

    if (StringUtils.isNotEmpty(network_link)) {
        commandLine.addArgument("NETWORK_LINK=" + network_link);
    }

    if (StringUtils.isNotEmpty(schemas)) {
        commandLine.addArgument("SCHEMAS=" + schemas);
    }

    if (StringUtils.isNotEmpty(tables)) {
        commandLine.addArgument("TABLES=" + tables);
    }
}

From source file:com.jaspersoft.jasperserver.war.cascade.handlers.converters.TimestampDataConverter.java

@Override
public Timestamp stringToValue(String rawData) throws ParseException {
    return StringUtils.isNotEmpty(rawData) ? new Timestamp(getDateTimeFormatter().parse(rawData).getTime())
            : null;//from ww  w  .  jav a  2 s .c  om
}

From source file:com.evolveum.midpoint.web.page.admin.users.component.SelectableFolderContent.java

@Override
protected IModel<?> newLabelModel(final IModel<OrgTreeDto> model) {
    return new AbstractReadOnlyModel<String>() {

        @Override//from www .j a v a2  s .  c  om
        public String getObject() {
            OrgTreeDto dto = model.getObject();
            if (StringUtils.isNotEmpty(dto.getDisplayName())) {
                return dto.getDisplayName();
            }
            return dto.getName();
        }
    };
}

From source file:eu.europa.esig.dss.pades.signature.visible.ImageFactory.java

/**
 * This method returns the image size with the original parameters (the generation uses DPI)
 * @param imageParameters the image parameters
 * @return a Dimension object/*  w  ww .  j  a  va2  s.  co m*/
 * @throws IOException
 */
public static Dimension getOptimalSize(SignatureImageParameters imageParameters) throws IOException {
    int width = 0;
    int height = 0;

    if (imageParameters.getImage() != null) {
        BufferedImage image = ImageIO.read(imageParameters.getImage());
        width = image.getWidth();
        height = image.getHeight();
    }

    SignatureImageTextParameters textParamaters = imageParameters.getTextParameters();
    if ((textParamaters != null) && StringUtils.isNotEmpty(textParamaters.getText())) {
        Dimension textDimension = ImageTextWriter.computeSize(textParamaters.getFont(),
                textParamaters.getText());
        switch (textParamaters.getSignerNamePosition()) {
        case LEFT:
        case RIGHT:
            width += textDimension.width;
            height = Math.max(height, textDimension.height);
            break;
        case TOP:
        case BOTTOM:
            width = Math.max(width, textDimension.width);
            height += textDimension.height;
            break;
        default:
            break;
        }

    }

    return new Dimension(width, height);
}

From source file:net.kamhon.ieagle.vo.Time.java

public int getMinute() {
    if (StringUtils.isNotEmpty(time)) {
        String[] splittedTime = time.split(":");
        if (splittedTime.length > 1)
            return Integer.parseInt(splittedTime[1].trim());
    }/*from  ww  w.j  a va 2 s.c om*/
    return 0;
}

From source file:de.hybris.platform.integration.cis.avs.populators.CisAvsAddressPopulator.java

protected String getRegionIsoCode(final AddressModel source) {
    if (source.getRegion() != null && StringUtils.isNotEmpty(source.getRegion().getIsocode())) {
        String regionIsocode = source.getRegion().getIsocode();
        if (regionIsocode.startsWith(source.getCountry().getIsocode())) //CIS needs only second part of region isocode
        {//ww w.jav a 2  s .c om
            regionIsocode = regionIsocode.substring(source.getCountry().getIsocode().length() + "-".length());
        }
        return regionIsocode;
    }
    return null;
}

From source file:com.jfaker.app.modules.web.BorrowController.java

/**
 * //w ww.j av a 2s . c o m
 */
public void apply() {
    //??
    keepPara();
    String orderId = getPara(PARA_ORDERID);
    String taskId = getPara(PARA_TASKID);
    if (StringUtils.isNotEmpty(orderId)) {
        //???orderId??
        setAttr("borrow", Borrow.dao.findByOrderId(orderId));
    }
    //?taskId??????
    if (StringUtils.isEmpty(orderId) || StringUtils.isNotEmpty(taskId)) {
        setAttr("operateTime", DateUtils.getCurrentDay());
        //idapply.jsp
        render("apply.jsp");
    } else {
        //?
        render("applyView.jsp");
    }
}

From source file:info.magnolia.cms.gui.control.File.java

public String getHtmlCssClassFileName() {
    if (StringUtils.isNotEmpty(this.cssClassFileName)) {
        return " class=\"" + this.cssClassFileName + "\""; //$NON-NLS-1$ //$NON-NLS-2$
    }//  w  w  w.  jav a 2  s.  c  o m

    return StringUtils.EMPTY;
}

From source file:de.torstenwalter.maven.plugins.ImpdpMojo.java

public void execute() throws MojoExecutionException, MojoFailureException {
    CommandLine commandLine = new CommandLine(impdp);
    addCommonArguments(commandLine);/*  w  ww .  j av  a 2s .  com*/

    if (StringUtils.isNotEmpty(remap_tablespace)) {
        commandLine.addArgument("REMAP_TABLESPACE=" + remap_tablespace);
    }

    if (StringUtils.isNotEmpty(remap_schema)) {
        commandLine.addArgument("REMAP_SCHEMA=" + remap_schema);
    }

    if (StringUtils.isNotEmpty(table_exists_action)) {
        commandLine.addArgument("TABLE_EXISTS_ACTION=" + table_exists_action);
    }

    getLog().info("Executing command line: " + obfuscateCredentials(commandLine.toString(), getCredentials()));

    Executor exec = new DefaultExecutor();
    exec.setStreamHandler(new PumpStreamHandler(System.out, System.err));
    try {
        exec.execute(commandLine);
    } catch (ExecuteException e) {
        throw new MojoExecutionException("Command execution failed.", e);
    } catch (IOException e) {
        throw new MojoExecutionException("Command execution failed.", e);
    }
}

From source file:com.bstek.dorado.view.resolver.FontAwesomeLocationTransformer.java

public String transform(String protocal, String location) {
    HttpServletRequest request = DoradoContext.getAttachedRequest();
    if (request != null) {
        String ua = request.getHeader("User-Agent");
        if (ua.indexOf(CHROME_FRAME) < 0) {
            boolean isMSIE = (ua != null && ua.indexOf(MSIE) != -1);
            if (isMSIE) {
                String version = MSIE_VERSION_PATTERN.matcher(ua).replaceAll("$1");
                if (StringUtils.isNotEmpty(version) && "8".compareTo(version) > 0) {
                    return PathUtils.concatPath(FAILSAFE_DIR, location.substring(protocal.length()));
                }// w  w w .j  a  v  a2s  .  c om
            }
        }
    }
    return PathUtils.concatPath(NORMAL_DIR, location.substring(protocal.length()));
}