List of usage examples for org.springframework.util StringUtils isEmpty
public static boolean isEmpty(@Nullable Object str)
From source file:it.geosolutions.opensdi2.servlet.RestFacade.java
/** * Perform the request based on this.urlFacade * /*from ww w . j ava 2 s. c om*/ * @param httpServletRequest The {@link HttpServletRequest} object passed in by the servlet engine representing the client request to be proxied * @param httpServletResponse The {@link HttpServletResponse} object by which we can send a proxied response to the client * @throws IOException if an error occur handling the request */ public void handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException { String pathInfo = httpServletRequest.getPathInfo(), urlWrapped = null, path = ""; for (String relPath : pathInfo.split(PATH_SEPARATOR)) { if (urlWrapped == null) { urlWrapped = StringUtils.isEmpty(relPath) ? null : relPath; } else { path += relPath + PATH_SEPARATOR; } } urlFacade.handleRequest(httpServletRequest, httpServletResponse, urlWrapped, path); }
From source file:org.trustedanalytics.kafka.adminapi.api.ApiController.java
@RequestMapping(method = RequestMethod.GET, value = "/topics/{topic}") @ResponseBody/* www. j a v a 2s. c om*/ public DeferredResult<List<String>> readTopic(@PathVariable final String topic) { LOG.info("readTopic invoked: {}", topic); if (StringUtils.isEmpty(topic)) { throw new InvalidTopicException("Missing mandatory topic name"); } Topic.validate(topic); if (!kafkaService.topicExists(topic)) { throw new UnknownTopicOrPartitionException("Topic does not exist: " + topic); } DeferredResult<List<String>> deferredResult = new DeferredResult<>(); CompletableFuture.supplyAsync(() -> kafkaService.readTopic(topic)) .whenCompleteAsync((result, throwable) -> { deferredResult.setResult(result); deferredResult.setErrorResult(throwable); }); return deferredResult; }
From source file:com.biz.report.service.impl.ItemDashBoardServiceImpl.java
@Override public List<Report2DataSet> readDataForPieChart(String items, String year, String months) { if (!StringUtils.isEmpty(items) && items.contains("[")) { items = items.substring(1, items.length() - 1); }/* w w w .j a v a2 s . c om*/ if (!StringUtils.isEmpty(months) && months.contains("[")) { months = months.substring(1, months.length() - 1); } List list = itemDashBoardDao.readByMonth(items, months, year); List<Report2> reportList = new MappingEngine().getPieChartReport(list); List<Report2DataSet> dataSets = new ArrayList<Report2DataSet>(); for (Report2 r : reportList) { dataSets.add(new Report2DataSet(r.getTypeName(), r.getAmount())); } return dataSets; }
From source file:org.carewebframework.vista.ui.notification.AbstractNotification.java
/** * Returns true if the notification has a patient association. * // w ww.j av a 2 s . c o m * @return True if there is a patient association. */ public boolean hasPatient() { return !StringUtils.isEmpty(getDfn()); }
From source file:org.bremersee.common.spring.autoconfigure.AclCacheAutoConfiguration.java
@Bean public EhCacheFactoryBean ehCacheFactoryBean() { final EhCacheFactoryBean factoryBean = new EhCacheFactoryBean(); factoryBean.setName(StringUtils.isEmpty(aclProperties.getAclCacheName()) ? "aclCache" : aclProperties.getAclCacheName()); if (cacheManager != null) { factoryBean.setCacheManager(cacheManager); }/* w ww . j av a 2 s .com*/ return factoryBean; }
From source file:com.biz.report.service.impl.CustomerServiceImpl.java
public List<Report2DataSet> readDataForPieChart(String customers, String year, String months) { if (!StringUtils.isEmpty(customers) && customers.contains("[")) { customers = customers.substring(1, customers.length() - 1); }//from w w w. j av a 2 s. c o m if (!StringUtils.isEmpty(months) && months.contains("[")) { months = months.substring(1, months.length() - 1); } List list = customerReportDao.readByMonth(customers, months, year); List<Report2> reportList = new MappingEngine().getPieChartReport(list); List<Report2DataSet> dataSets = new ArrayList<Report2DataSet>(); for (Report2 r : reportList) { dataSets.add(new Report2DataSet(r.getTypeName(), r.getAmount())); } return dataSets; }
From source file:au.com.ors.soap.crv.CRVPortTypeImpl.java
public String check(String driverLicenseNumber) throws ParserConfigurationException, SAXException, IOException { Document dom;/*from w w w . j av a 2 s . c o m*/ URL path = this.getClass().getClassLoader().getResource("../db/bpeldb.xml"); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; db = dbf.newDocumentBuilder(); dom = db.parse(path.toString()); Element rootElement = dom.getDocumentElement(); NodeList nodeList = rootElement.getChildNodes(); for (int i = 0; i < nodeList.getLength(); ++i) { Node node = nodeList.item(i); if (!node.getNodeName().equalsIgnoreCase("bpelElement")) { continue; } NodeList attributeList = node.getChildNodes(); for (int j = 0; j < attributeList.getLength(); ++j) { Node currentNode = attributeList.item(j); if (currentNode.getNodeType() == Node.ELEMENT_NODE) { if (currentNode.getNodeName().equalsIgnoreCase("driverLicenseNumber")) { if (!currentNode.getTextContent().equalsIgnoreCase(driverLicenseNumber)) { break; } } else if (currentNode.getNodeName().equalsIgnoreCase("criminalRecord")) { if (!StringUtils.isEmpty(currentNode.getTextContent())) { return HASRECORD; } } } } } return NORECORD; }
From source file:net.jiaoqsh.backend.mail.utils.JsonMapper.java
/** * ???POJO?CollectionList<String>. * /* ww w. j ava 2 s . c o m*/ * JSONNull"null", Null. * JSON"[]", ?. * * ?????CollectionList<MyBean>, fromJson(String, JavaType) * * @see #fromJson(String, com.fasterxml.jackson.databind.JavaType) */ public <T> T fromJson(String jsonString, Class<T> clazz) { if (StringUtils.isEmpty(jsonString)) { return null; } try { return mapper.readValue(jsonString, clazz); } catch (IOException e) { logger.warn("parse json string error:" + jsonString, e); return null; } }
From source file:$.UserRepositoryImpl.java
@Override public List<UserDTO> findUserByPattern(final String pattern) throws Exception { final StringBuilder queryString = new StringBuilder(); if (!StringUtils.isEmpty(pattern)) { queryString.append("select user from UserDTO user where user.username like '%").append(pattern) .append("%'"); final QueryJpaCallback<UserDTO> query = new QueryJpaCallback<UserDTO>(queryString.toString(), false); List<UserDTO> list = retrieveList(query); if (list != null && list.size() > 0) { return list; }/*from w ww .j av a2 s .c om*/ } return null; }
From source file:be.roots.taconic.pricingguide.domain.Contact.java
public String getFullName() { String fullName = ""; if (!StringUtils.isEmpty(getSalutation())) { fullName += getSalutation();//from www . j a v a 2 s . co m } if (!StringUtils.isEmpty(getFirstName())) { if (!StringUtils.isEmpty(fullName)) { fullName += " "; } fullName += getFirstName(); } if (!StringUtils.isEmpty(getLastName())) { if (!StringUtils.isEmpty(fullName)) { fullName += " "; } fullName += getLastName(); } return fullName; }