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

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

Introduction

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

Prototype

public static boolean isNotEmpty(final CharSequence cs) 

Source Link

Document

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

 StringUtils.isNotEmpty(null)      = false StringUtils.isNotEmpty("")        = false StringUtils.isNotEmpty(" ")       = true StringUtils.isNotEmpty("bob")     = true StringUtils.isNotEmpty("  bob  ") = true 

Usage

From source file:com.glaf.dts.web.springmvc.MxDtsSchedulerController.java

@RequestMapping
public ModelAndView list(HttpServletRequest request, ModelMap modelMap) {
    String jx_view = request.getParameter("jx_view");
    RequestUtils.setRequestParameterToAttribute(request);
    if (StringUtils.isNotEmpty(jx_view)) {
        return new ModelAndView(jx_view, modelMap);
    }// ww  w  .j  a v a  2 s.  c  o  m

    String x_view = ViewProperties.getString("dts_scheduler.list");
    if (StringUtils.isNotEmpty(x_view)) {
        return new ModelAndView(x_view, modelMap);
    }
    return new ModelAndView("/bi/dts/scheduler/list", modelMap);
}

From source file:com.opensymphony.xwork2.validator.validators.ValidatorSupport.java

public void setDefaultMessage(String message) {
    if (StringUtils.isNotEmpty(message)) {
        this.defaultMessage = message;
    }
}

From source file:com.glaf.dts.web.rest.MxTransformTaskResource.java

@POST
@Path("/delete ")
public void delete(@Context HttpServletRequest request, @Context UriInfo uriInfo) {
    String queryId = request.getParameter("queryId");
    if (StringUtils.isNotEmpty(queryId)) {
        transformTaskService.deleteByQueryId(queryId);
    }//w w  w.j  a v a 2s .  c om
}

From source file:com.glaf.core.web.springmvc.MxBlobController.java

@ResponseBody
@RequestMapping("/delete")
public byte[] delete(HttpServletRequest request, ModelMap modelMap) {
    RequestUtils.setRequestParameterToAttribute(request);
    String fileId = request.getParameter("fileId");
    if (StringUtils.isNotEmpty(fileId)) {
        blobService.deleteBlobByFileId(fileId);
        return ResponseUtils.responseJsonResult(true);
    }//w  w  w .  j av a 2  s .c  om
    return ResponseUtils.responseJsonResult(false);
}

From source file:com.nridge.core.base.std.Platform.java

/**
 * Determines if the current platform that the JVM is executing within is
 * a Linux-based operating system./*from w  w w  .j av  a  2  s  . c  om*/
 * @return <i>true</i> if it is or <i>false</i> otherwise.
 */
public static boolean isLinux() {
    String osName;
    Properties osProperties;

    osProperties = System.getProperties();
    osName = (String) osProperties.get("os.name");
    return StringUtils.isNotEmpty(osName) && osName.startsWith(PLATFORM_LINUX);
}

From source file:de.micromata.genome.gwiki.page.impl.wiki.macros.GWikiPageGalleryMacro.java

@Override
public boolean renderImpl(GWikiContext ctx, MacroAttributes attrs) {
    GWikiElementInfo ci = ctx.getCurrentElement().getElementInfo();
    if (StringUtils.isNotEmpty(parentPage) == true) {
        ci = ctx.getWikiWeb().findElementInfo(parentPage);
        if (ci == null) {
            // TODO error
            return true;
        }//ww w  . j  av  a  2  s.c  om
    }
    List<GWikiElementInfo> childs = ctx.getElementFinder().getDirectChilds(ci);
    Collections.sort(childs, new GWikiElementByChildOrderComparator(
            new GWikiElementByOrderComparator(new GWikiElementByIntPropComparator("ORDER", 0))));

    ctx.append("<table border=\"1\" cellspacing=\"0\">");
    int i = 0;
    int colNo = 0;
    ctx.setRequestAttribute(GWikiFragmentImage.WIKI_MAX_IMAGE_WIDTH, columnWidth);

    for (GWikiElementInfo c : childs) {
        GWikiElement el = ctx.getWikiWeb().findElement(c.getId());
        if (el == null) {
            continue;
        }
        if (c.isViewable() == false) {
            continue;
        }

        GWikiArtefakt<?> art = null;
        if (StringUtils.isNotEmpty(part) == true) {
            art = el.getPart(part);
        } else {
            art = el.getMainPart();
        }
        if ((art instanceof GWikiExecutableArtefakt<?>) == false || art instanceof GWikiAttachment) {
            continue;
        }
        if (colNo == 0) {
            ctx.append("<tr>");
        }
        ctx.append("<td valign=\"top\">");
        GWikiExecutableArtefakt<?> exec = (GWikiExecutableArtefakt<?>) art;
        ctx.append("<table border=\"0\" cellspacing=\"0\" ><tr>");
        ctx.append("<th valign=\"top\" width=\"" + columnWidth + "\">")
                //
                .append("<div id=\"chid_" + el.getElementInfo().getId() + "\" class=\"gwikioresdraggable\">")
                .append(ctx.getTranslatedProp(el.getElementInfo().getTitle())).append("</div></th></tr>");
        ctx.append("<tr height=\"" + rowHeight + "\"><td valign=\"top\">");
        /* oncontextmenu=\"alert('clicked');\" */
        ctx.append("<div style=\"font-size:0.6em;size:0.6em;\"  ondblclick=\"document.location.href='"
                + ctx.localUrl(el.getElementInfo().getId()) + "';\">");
        // ctx.append("<iframe>");
        // rowHeight

        exec.render(ctx);
        GWikiContext.setCurrent(ctx);
        // ctx.append("</iframe>");
        ctx.append("</div>");
        ctx.append("</td></tr></table>");
        ctx.append("</td>");
        if (colNo + 1 >= columns) {
            ctx.append("</tr>");
            colNo = 0;
        } else {
            ++colNo;
        }
        ++i;
    }
    ctx.append("</tr></table>");
    if (ctx.getWikiWeb().getAuthorization().isAllowToEdit(ctx, ci) == true) {
        ctx.append("<script type=\"text/javascript\">")//
                .append("jQuery(document).ready(function(){\n")//
                .append("jQuery('.gwikioresdraggable').draggable( {\n") //
                .append(" zIndex:     1000,\n") //
                .append("ghosting:   true,\n") //
                .append("revert: 'invalid',\n") //
                .append("snap: true,\n") //
                .append("opacity:    0.7\n") //
                .append("});\n")//
                .append("jQuery('.gwikioresdraggable').droppable({\n")//
                // .append(" accept : 'dropaccept',\n")//
                .append("tolerance: 'touch',\n")//
                .append("drop: function(event, ui) { \n")//
                // .append("alert('dropped');\n")//
                .append("jQuery.ajax({\n" + "cache: false,\n" + "async: false,\n" + "url: '"
                        + ctx.localUrl("edit/EditPage") + "?method_onReorderChildsAsync=true',\n"
                        + "type: 'POST',\n" + "dataType: 'html',\n" + "data: { pageId: '" + ci.getId()
                        + "', p2: ui.draggable.attr('id'), p1: this.id },\n"
                        + " complete: function(res, status) {\n"
                        + " //jQuery('#backupInfo').html(res.responseText);\n" + " location.reload();\n"
                        + "}});\n" + "//alert('dropped' + this.id + ' on ' + ui.draggable.attr('id'));\n"
                        + "}\n")//
                .append("});\n")//
                .append("});\n") //
                .append("</script>\n");
    }
    return true;
}

From source file:io.fabric8.maven.enricher.standard.MavenIssueManagementEnricher.java

@Override
public Map<String, String> getAnnotations(Kind kind) {
    Map<String, String> annotations = new HashMap<>();
    if (kind.isController() || kind == Kind.SERVICE) {
        MavenProject rootProject = getProject();
        if (hasIssueManagement(rootProject)) {
            IssueManagement issueManagement = rootProject.getIssueManagement();
            String system = issueManagement.getSystem();
            String url = issueManagement.getUrl();
            if (StringUtils.isNotEmpty(system) && StringUtils.isNotEmpty(url)) {
                annotations.put(ISSUE_MANAGEMENT_SYSTEM, system);
                annotations.put(ISSUE_MANAGEMENT_URL, url);
                return annotations;
            }//from w  ww.j ava2 s .  c o  m
        }
    }
    return annotations;
}

From source file:io.wcm.handler.link.ui.Redirect.java

@PostConstruct
private void activate() throws IOException {
    // resolve link of redirect page
    String redirectUrl = linkHandler.get(resource).buildUrl();

    // in publish mode redirect to target
    if (wcmMode == WCMMode.DISABLED) {
        renderPage = false;/*w  w w. j  av a2 s.  c o m*/
        if (StringUtils.isNotEmpty(redirectUrl)) {
            if (StringUtils.equals(redirectStatus,
                    Integer.toString(HttpServletResponse.SC_MOVED_TEMPORARILY))) {
                response.sendRedirect(redirectUrl);
            } else {
                response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
                response.setHeader("Location", redirectUrl);
            }
        } else {
            response.sendError(HttpServletResponse.SC_NOT_FOUND);
        }
    }
}

From source file:com.quatico.base.aem.test.api.setup.Resources.java

@Override
public Resource aResource(Resource parent, String relativePath, Object... properties) throws Exception {
    if (relativePath == null) {
        relativePath = StringUtils.EMPTY;
    }//from   w w w  .j a va 2  s .c o  m
    if (StringUtils.isNotEmpty(relativePath) && !StringUtils.startsWith(relativePath, "/")) {
        relativePath += "/";
    }
    return aResource(parent.getPath() + relativePath, properties);
}

From source file:com.epam.dlab.billing.azure.AzureBillingDetailsService.java

public void updateBillingDetails() {
    final List<String> users = new ArrayList<>();
    FindIterable<Document> iterable = mongoDbBillingClient.getDatabase()
            .getCollection(MongoKeyWords.EDGE_COLLECTION).find()
            .projection(Projections.include(MongoKeyWords.MONGO_ID));

    for (Document document : iterable) {
        String user = document.getString(MongoKeyWords.MONGO_ID);
        if (StringUtils.isNotEmpty(user)) {
            users.add(user);//from w w  w  .  j  a  va 2  s .c o m
        } else {
            log.warn("Empty user is found");
        }
    }

    if (!users.isEmpty()) {
        users.forEach(this::updateBillingDetails);
    } else {
        log.warn("No users found");
    }
}