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

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

Introduction

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

Prototype

String EMPTY

To view the source code for org.apache.commons.lang StringUtils EMPTY.

Click Source Link

Document

The empty String "".

Usage

From source file:com.oneops.opamp.cache.WatchedByAttributeCacheLoader.java

private String getAttributeValue(Long manifestId, String source, String attributeName) {
    List<CmsCIRelation> manifestRelations = cmProcessor.getFromCIRelationsByClassAndCiName(manifestId,
            "manifest.WatchedBy", null, "manifest.Monitor", source);
    String attributeValue = null;
    if (manifestRelations.size() > 0) {
        CmsCIRelationAttribute attribute = manifestRelations.get(0).getAttribute(attributeName);

        attributeValue = (attribute != null) ? attribute.getDfValue() : StringUtils.EMPTY;
        if (attribute == null) {
            logger.warn("The relation attribute :" + attributeName + " could not be found for manifestId "
                    + manifestId + " source " + source);
        }//from   ww w.  j  av  a  2  s. com
    }
    return attributeValue;
}

From source file:info.magnolia.module.admininterface.trees.WebsiteTreeConfiguration.java

/**
 * @see info.magnolia.module.admininterface.AdminTreeConfiguration#prepareTree(info.magnolia.cms.gui.control.Tree, boolean, javax.servlet.http.HttpServletRequest)
 *///from  w  w w  .  ja  v  a  2 s  .c o  m
public void prepareTree(Tree tree, boolean browseMode, HttpServletRequest request) {
    Messages msgs = MessagesManager.getMessages();

    tree.setIconOndblclick("mgnlTreeMenuItemOpen(" + tree.getJavascriptTree() + ");"); //$NON-NLS-1$ //$NON-NLS-2$

    tree.addItemType(ItemType.CONTENT);

    TreeColumn column0 = new TreeColumn(tree.getJavascriptTree(), request);
    column0.setIsLabel(true);
    column0.setTitle(msgs.get("tree.web.page"));
    column0.setWidth(3);
    column0.setHtmlEdit();

    TreeColumn columnIcons = new TreeColumn(tree.getJavascriptTree(), request);
    columnIcons.setCssClass(StringUtils.EMPTY);
    columnIcons.setWidth(1);
    columnIcons.setIsIcons(true);
    columnIcons.setIconsActivation(true);
    columnIcons.setIconsPermission(true);

    TreeColumn column1 = new TreeColumn(tree.getJavascriptTree(), request);
    column1.setName("title"); //$NON-NLS-1$
    column1.setTitle(msgs.get("tree.web.title")); //$NON-NLS-1$
    column1.setWidth(2);
    column1.setHtmlEdit();

    TreeColumn column2 = new TreeColumn(tree.getJavascriptTree(), request);
    column2.setName(MetaData.TEMPLATE);
    column2.setIsMeta(true);
    column2.setWidth(2);
    column2.setTitle(msgs.get("tree.web.template")); //$NON-NLS-1$
    // must render this column specially
    column2.setHtmlRenderer(new TemplateTreeColumnHtmlRenderer());

    Select templateSelect = new Select();
    templateSelect.setName(tree.getJavascriptTree() + TreeColumn.EDIT_NAMEADDITION);
    templateSelect.setSaveInfo(false);
    templateSelect.setCssClass(TreeColumn.EDIT_CSSCLASS_SELECT);

    // we must pass the displayValue to this function
    // templateSelect.setEvent("onblur", tree.getJavascriptTree() + TreeColumn.EDIT_JSSAVE);
    // templateSelect.setEvent("onchange", tree.getJavascriptTree() + TreeColumn.EDIT_JSSAVE);
    templateSelect.setEvent("onblur", tree.getJavascriptTree() //$NON-NLS-1$
            + ".saveNodeData(this.value,this.options[this.selectedIndex].text)"); //$NON-NLS-1$
    templateSelect.setEvent("onchange", tree.getJavascriptTree() //$NON-NLS-1$
            + ".saveNodeData(this.value,this.options[this.selectedIndex].text)"); //$NON-NLS-1$

    Iterator templates = TemplateManager.getInstance()
            .getAvailableTemplates(MgnlContext.getAccessManager(ContentRepository.CONFIG));
    Messages templateMsgs = TemplateMessagesUtil.getMessages();
    while (templates.hasNext()) {
        Template template = (Template) templates.next();
        String title = template.getTitle();
        title = templateMsgs.getWithDefault(title, title);
        title = MessagesUtil.javaScriptString(title);
        templateSelect.setOptions(title, template.getName());
    }
    column2.setHtmlEdit(templateSelect.getHtml());

    // todo: key/value -> column2.addKeyValue("sampleBasic","Samples: Basic Template");
    // todo: preselection (set on createPage)
    TreeColumn column3 = new TreeColumn(tree.getJavascriptTree(), request);
    column3.setName(MetaData.LAST_MODIFIED);
    // column3.setName(MetaData.SEQUENCE_POS);
    column3.setIsMeta(true);
    column3.setDateFormat("yy-MM-dd, HH:mm"); //$NON-NLS-1$
    column3.setWidth(2);
    column3.setTitle(msgs.get("tree.web.date")); //$NON-NLS-1$

    tree.addColumn(column0);

    if (!browseMode) {
        tree.addColumn(column1);
        if (Server.isAdmin() || Subscriber.isSubscribersEnabled()) {
            tree.addColumn(columnIcons);
        }
        tree.addColumn(column2);
        tree.addColumn(column3);
    }

}

From source file:com.qrmedia.commons.multispi.provider.MetaInfServicesProvider.java

protected Set<String> processResource(List<String> lines, Class<?> serviceClass) {
    return ImmutableSet.copyOf(filter(transform(lines, compose(new StripChars(' ', '\t'), new StripComments())),
            not(equalTo(StringUtils.EMPTY))));
}

From source file:com.microsoft.alm.plugin.idea.tfvc.core.TFSDiffProvider.java

private String getModificationDate(final VcsRevisionNumber vcsRevisionNumber) {
    if (vcsRevisionNumber instanceof TfsRevisionNumber) {
        final TfsRevisionNumber revisionNumber = (TfsRevisionNumber) vcsRevisionNumber;
        return revisionNumber.getModificationDate();
    }/*from  w w  w.  j a  v  a2  s  .c o  m*/
    return StringUtils.EMPTY;
}

From source file:fr.paris.lutece.plugins.workflow.web.WorkflowAdminDashboardComponent.java

/**
 * {@inheritDoc}/*from   w w  w .  j a va 2  s  .c  o  m*/
 */
@Override
public String getDashboardData(AdminUser user, HttpServletRequest request) {
    if (RBACService.isAuthorized(Action.RESOURCE_TYPE, RBAC.WILDCARD_RESOURCES_ID,
            ActionResourceIdService.PERMISSION_MANAGE_ADVANCED_PARAMETERS, user)) {
        HtmlTemplate template = AppTemplateService.getTemplate(TEMPLATE_ADMIN_DASHBOARD, user.getLocale());

        return template.getHtml();
    }

    return StringUtils.EMPTY;
}

From source file:com.envision.envservice.rest.CourseResource.java

@POST
@Path("/feedback/{courseId}")
@Produces(MediaType.APPLICATION_JSON)//from  w  w w. j  ava 2  s  . c o  m
public Response feedback(@PathParam("courseId") int courseId, CourseFeedbackBo feedback)
        throws ServiceException {
    HttpStatus status = HttpStatus.ACCEPTED;
    String response = StringUtils.EMPTY;

    if (checkParam(feedback)) {
        courseService.feedback(courseId, feedback);
    } else {
        status = HttpStatus.BAD_REQUEST;
        response = FailResult.toJson(Code.PARAM_ERROR, "??star");
    }

    return Response.status(status.value()).entity(response).build();
}

From source file:info.magnolia.cms.gui.controlx.list.ListModelIteratorImpl.java

/**
 * get group name/*from w w  w  . ja v  a 2 s.c  o m*/
 *
 * @return name of the group of the current record
 */
public String getGroupName() {
    if (StringUtils.isEmpty(this.groupKey))
        return StringUtils.EMPTY;
    return (String) this.getValue(this.groupKey, this.current);
}

From source file:gobblin.source.extractor.extract.kafka.KafkaSimpleStreamingSource.java

static public Consumer getKafkaConsumer(Config config) {
    List<String> brokers = ConfigUtils.getStringList(config, ConfigurationKeys.KAFKA_BROKERS);
    Properties props = new Properties();
    props.put("bootstrap.servers", Joiner.on(",").join(brokers));
    props.put("group.id", ConfigUtils.getString(config, ConfigurationKeys.JOB_NAME_KEY, StringUtils.EMPTY));
    props.put("enable.auto.commit", "false");
    Preconditions.checkArgument(config.hasPath(TOPIC_KEY_DESERIALIZER));
    props.put("key.deserializer", config.getString(TOPIC_KEY_DESERIALIZER));
    Preconditions.checkArgument(config.hasPath(TOPIC_VALUE_DESERIALIZER));
    props.put("value.deserializer", config.getString(TOPIC_VALUE_DESERIALIZER));
    Consumer consumer = null;//from ww w .  ja va  2 s  . co m
    try {
        consumer = new KafkaConsumer<>(props);
    } catch (Exception e) {
        LOG.error("Exception when creating Kafka consumer - {}", e);
        throw Throwables.propagate(e);
    }
    return consumer;
}

From source file:com.fengduo.bee.commons.core.WebResponseWrapper.java

public byte[] getByte() {
    if (isStreamUsed) {
        return bos.toByteArray();
    }
    return StringUtils.EMPTY.getBytes();
}

From source file:com.microsoft.alm.plugin.idea.git.ui.simplecheckout.SimpleCheckoutModelTest.java

@Test
public void testConstructor_NoDirectoryName() {
    SimpleCheckoutModel model = modelCreationAndMocking(SimpleCheckoutModel.DEFAULT_SOURCE_PATH,
            INVALID_GIT_URL);//from  ww w . jav  a  2 s  .c  o  m
    Assert.assertEquals(StringUtils.EMPTY, model.getDirectoryName());
}