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:fr.paris.lutece.plugins.workflow.modules.ticketing.service.task.TaskIndexTicket.java

@Override
public String processTicketingTask(int nIdResourceHistory, HttpServletRequest request, Locale locale) {
    String strTaskInformation = StringUtils.EMPTY;

    // We get the ticket to modify
    Ticket ticket = getTicket(nIdResourceHistory);
    TicketCategory ticketCategory = TicketCategoryHome.findByPrimaryKey(ticket.getIdTicketCategory());
    int nIdWorkflow = ticketCategory.getIdWorkflow();
    State state = WorkflowService.getInstance().getState(ticket.getId(), Ticket.TICKET_RESOURCE_TYPE,
            nIdWorkflow, null);//from w  w w .j ava2  s . c  om

    IndexerAction indexerAction = new IndexerAction();
    indexerAction.setIdTicket(ticket.getId());

    if ((state == null)
            || (state.getId() == AppPropertiesService.getPropertyInt(PROPERTY_WORKFLOW_ACTION_ID_NEW, 301))) {
        indexerAction.setIdTask(IndexerAction.TASK_CREATE);
    } else {
        indexerAction.setIdTask(IndexerAction.TASK_MODIFY);
    }

    IndexerActionHome.create(indexerAction);

    return strTaskInformation;
}

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

/**
 * There is no useful output from this command unless there is an error. This method parses the error and throws if
 * one exists./*from  w  ww  . j  a v a2  s .  c o  m*/
 */
@Override
public String parseOutput(final String stdout, final String stderr) {
    super.throwIfError(stderr);
    // There is no useful output on success
    return StringUtils.EMPTY;
}

From source file:fr.paris.lutece.plugins.extend.util.ExtendUtils.java

/**
 * Validate.//from   ww  w  .  j  av a  2 s  .c  om
 *
 * @param request the request
 * @param resourceType the resource type
 * @return the string
 */
public static String validateResourceType(HttpServletRequest request, ExtendableResourceType resourceType) {
    String strJspError = validate(request, resourceType);

    if (StringUtils.isNotBlank(strJspError)) {
        return strJspError;
    }

    if (StringUtils.isBlank(resourceType.getKey())) {
        return AdminMessageService.getMessageUrl(request, Messages.MANDATORY_FIELDS, AdminMessage.TYPE_STOP);
    }

    return StringUtils.EMPTY;
}

From source file:com.careerly.utils.TextUtils.java

public static String escapeNormalString(String text) {

    if (StringUtils.isBlank(text)) {
        return StringUtils.EMPTY;
    }//w w  w.java 2s.  c o m

    return StringUtils.replaceEach(text, new String[] { "<", ">", """, "\\\\", """ },
            new String[] { "<", ">", "\"", "\\", "\'" });
}

From source file:com.chadekin.jadys.syntax.HavingBuilderImplTest.java

@Test
public void shouldIgnoreEmptyParameter() {
    // arrange//from w  ww .ja v a 2 s .  c om
    builder.having(StringUtils.EMPTY).equal(23);

    // Act
    String sql = builder.build();

    // Assert
    assertThat(sql, emptyString());
    assertThat(builder, instanceOf(GroupByBuilder.class));
}

From source file:com.amalto.core.history.accessor.ManyFieldAccessor.java

public String get() {
    Node collectionItemNode = getCollectionItemNode();
    Node firstChild = collectionItemNode.getFirstChild();
    if (firstChild != null) {
        if (firstChild instanceof Text)
            return collectionItemNode.getTextContent();// get node value can not handle bracket well
        else//from w  w  w  .j a  v a  2 s .c o m
            return firstChild.getNodeValue();
    } else {
        return StringUtils.EMPTY;
    }
}

From source file:com.baifendian.swordfish.execserver.job.spark.SparkSubmitArgsUtil.java

private static String getFilesStr(List<ResourceInfo> files, boolean isSymbolic) {
    if (files == null) {
        return StringUtils.EMPTY;
    }/*from  w w  w .  j  a v  a2s .  c  om*/

    if (isSymbolic) {
        return StringUtils.join(files.stream().map(p -> p.getSymbolicRes()).toArray(), ",");
    }

    return StringUtils.join(files.stream().map(p -> p.getRes()).toArray(), ",");
}

From source file:com.alibaba.otter.manager.web.common.NumberFormatUtil.java

public static String formatDelay(Number data) {
    if (data == null) {
        return StringUtils.EMPTY;
    }/*  ww w. j  ava2 s  .  c o m*/
    long t = data.longValue();
    if (t < 0) {
        return String.valueOf(t);
    }
    int hour = 0;
    int minute = 0;

    while (t >= 60 * 60 * 1000) {
        hour++;
        t -= 60 * 60 * 1000;
    }

    while (t >= 60 * 1000) {
        minute++;
        t -= 60 * 1000;
    }

    List<String> result = new ArrayList<String>();
    if (hour > 0) {
        result.add(hour + " h");
    }
    if (minute > 0) {
        result.add(minute + " m");
    }

    if (t > 0) {
        DecimalFormat format = new DecimalFormat(PATTERN);
        result.add(format.format((t * 1.0) / 1000) + " s");
    }

    if (result.size() == 0) {
        return "0";
    }
    return StringUtils.join(result, " ");
}

From source file:com.amalto.core.storage.hibernate.SystemTypeMappingRepository.java

public MetadataRepository visit(ComplexTypeMetadata complexType) {
    MetadataVisitor<TypeMapping> creator = getTypeMappingCreator(complexType, strategy);
    TypeMapping typeMapping = complexType.accept(creator);
    // Add MDM specific record specific metadata: keep this additional fields for system objects too: MDM studio
    // may query these fields (see TMDM-5666).
    ComplexTypeMetadata database = typeMapping.getDatabase();
    if (database.isInstantiable() && !database.isFrozen() && database.getSuperTypes().isEmpty()) {
        TypeMetadata longType = new SoftTypeRef(internalRepository, XMLConstants.W3C_XML_SCHEMA_NS_URI,
                Types.LONG, false);
        TypeMetadata stringType = new SoftTypeRef(internalRepository, XMLConstants.W3C_XML_SCHEMA_NS_URI,
                Types.STRING, false);
        database.addField(new SimpleTypeFieldMetadata(database, false, false, true, Storage.METADATA_TIMESTAMP,
                longType, Collections.<String>emptyList(), Collections.<String>emptyList(),
                Collections.<String>emptyList(), StringUtils.EMPTY));
        database.addField(new SimpleTypeFieldMetadata(database, false, false, false, Storage.METADATA_TASK_ID,
                stringType, Collections.<String>emptyList(), Collections.<String>emptyList(),
                Collections.<String>emptyList(), StringUtils.EMPTY));
    }// ww  w .  j av a2 s .  co m
    // Register mapping
    internalRepository.addTypeMetadata(typeMapping.getDatabase());
    mappings.addMapping(typeMapping);
    return internalRepository;
}

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

@POST
@Path("/addAssessment")
@Consumes(MediaType.APPLICATION_JSON)//from  w  ww.ja  v  a 2  s. c o  m
@Produces(MediaType.APPLICATION_JSON)
public Response addAssessment(AssessmentBo assessmentBo) throws Exception {
    HttpStatus status = HttpStatus.CREATED;
    String response = StringUtils.EMPTY;
    if (!checkParam(assessmentBo)) {
        status = HttpStatus.BAD_REQUEST;
        response = FailResult.toJson(Code.PARAM_ERROR, "?");
    } else {
        response = assessmentService.addAssessment(assessmentBo).toJSONString();
    }
    return Response.status(status.value()).entity(response).build();
}