List of usage examples for org.apache.commons.lang StringUtils equals
public static boolean equals(String str1, String str2)
Compares two Strings, returning true
if they are equal.
From source file:ddf.catalog.event.retrievestatus.DownloadsStatusEventListener.java
@Override public void handleEvent(Event event) { String methodName = "handleEvent"; LOGGER.debug("ENTERING: {}", methodName); if (null != event && null != event.getTopic() && null != event.getProperty(ActivityEvent.DOWNLOAD_ID_KEY)) { // If cancel event, then cancel the download stream if (ActivityEvent.EVENT_TOPIC_DOWNLOAD_CANCEL.equals(event.getTopic())) { String keyToCancel = event.getProperty(ActivityEvent.DOWNLOAD_ID_KEY).toString(); LOGGER.debug("downloadKey = {}", keyToCancel); if (null != downloadMap) { for (Map.Entry<String, InputStream> item : downloadMap.entrySet()) { if (StringUtils.equals(keyToCancel, item.getKey())) { InputStream is = item.getValue(); IOUtils.closeQuietly(is); break; }/*from ww w .j av a2 s. c o m*/ } if (LOGGER.isDebugEnabled()) { LOGGER.debug("downloadMap : "); for (Map.Entry<String, InputStream> item : downloadMap.entrySet()) { String keyStr = item.getKey(); InputStream value = item.getValue(); LOGGER.debug(" Key = {} Value = {}", keyStr, value); } } } } } else { LOGGER.debug("Event is null "); } LOGGER.debug("EXITING: {}", methodName); }
From source file:edu.arizona.kfs.sys.businessobject.BuildingExtension.java
/** * Returns the RouteCode//from w w w . jav a 2 s . com * @return RouteCode */ public RouteCode getRouteCodeObj() { if (routeCodeObj == null || !StringUtils.equals(routeCodeObj.getRouteCode(), routeCode)) { routeCodeObj = getBusinessObjectService().findBySinglePrimaryKey(RouteCode.class, routeCode); } return routeCodeObj; }
From source file:cn.vlabs.duckling.vwb.service.skin.Skin.java
public boolean isAvailable() { if (StringUtils.isBlank(getTemplate()) || StringUtils.isBlank(getCurrentSiteTemplate())) { return false; }//from ww w . ja va 2 s . c om return StringUtils.equals(getTemplate(), getCurrentSiteTemplate()); }
From source file:com.mmj.app.common.cookie.CookieNameEnum.java
public static CookieNameEnum getEnum(String name) { for (CookieNameEnum cookieNameEnum : values()) { if (StringUtils.equals(name, cookieNameEnum.getCookieName())) return cookieNameEnum; }//from w w w. ja v a 2s . c o m return null; }
From source file:com.redhat.rhn.frontend.action.channel.PackageNameOverviewAction.java
/** {@inheritDoc} */ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {/*from w w w . j a v a2s. com*/ String pkgName = request.getParameter("package_name"); String subscribedChannels = request.getParameter("search_subscribed_channels"); String channelFilter = request.getParameter("channel_filter"); String[] channelArches = request.getParameterValues("channel_arch"); request.setAttribute(ListTagHelper.PARENT_URL, request.getRequestURI()); RequestContext ctx = new RequestContext(request); User user = ctx.getCurrentUser(); List dr = Collections.EMPTY_LIST; if (StringUtils.equals(subscribedChannels, "yes")) { dr = PackageManager.lookupPackageNameOverview(user.getOrg(), pkgName); } else if (!StringUtils.isEmpty(channelFilter) && StringUtils.equals(subscribedChannels, "no") && channelArches == null) { Long filterChannelId = null; try { filterChannelId = Long.parseLong(channelFilter); dr = PackageManager.lookupPackageNameOverviewInChannel(user.getOrg(), pkgName, filterChannelId); } catch (NumberFormatException e) { log.warn("Exception caught, unable to parse channel ID: " + channelFilter); dr = Collections.EMPTY_LIST; } } else if (channelArches != null && channelArches.length > 0) { dr = PackageManager.lookupPackageNameOverview(user.getOrg(), pkgName, channelArches); } request.setAttribute(RequestContext.PAGE_LIST, dr); return mapping.findForward(RhnHelper.DEFAULT_FORWARD); }
From source file:com.vmware.appfactory.application.model.AppInstall.java
@Override public int deepCopy(AbstractRecord record) { AppInstall other = (AppInstall) record; int numChanges = 0; if (!StringUtils.equals(getCommand(), other.getCommand())) { setCommand(other.getCommand());/*from w ww . java2s .c o m*/ numChanges++; } return numChanges; }
From source file:com.norteksoft.security.web.listener.SecurityContextListener.java
private void checkLicense(ServletContext context) { Object obj = getBeanFromApplicationContext(context, "checkLicenseManager"); ((CheckLicenseManager) obj).checkLicense(); if (StringUtils.equals(systemCode, "imatrix")) { ///*from w ww .j av a2 s . c o m*/ TimedTask jobInfo = new TimedTask(); jobInfo.setDataState(DataState.ENABLE); jobInfo.setUrl("/rest/license/checkLicense"); jobInfo.setSystemCode("acs"); jobInfo.setApplyType(ApplyType.RESTFUL_APPLY); Timer timer = new Timer(); timer.setTimingType(TimingType.everyDate); timer.setCorn("00:00"); timer.setJobInfo(jobInfo); timer.setId(0L); Scheduler.addJob(timer); } }
From source file:cn.cuizuoli.gotour.controller.WebCategoryController.java
@SuppressWarnings({ "unchecked", "rawtypes" }) @RequestMapping("{productCode}") public ModelAndView index(@PathVariable String productCode) { List<Info> productList = productService.getProductList(); Info product = productService.getProduct(productCode); List<Info> categoryList = categoryService.getAllCategoryList(productCode); Map categoryMap = null;//from w w w . j a va 2s.co m if (StringUtils.equals(productCode, ProductType.LOCAL.getCode())) { categoryMap = new HashMap<Info, List<Local>>(); for (Info category : categoryList) { List<Local> localList = webCategoryService.getTopLocalList(category.getInfoCode()); if (localList.size() > 0) { categoryMap.put(category, localList); } } } if (StringUtils.equals(productCode, ProductType.INTERNAL.getCode())) { categoryMap = new HashMap<Info, List<Internal>>(); for (Info category : categoryList) { List<Internal> internalList = webCategoryService.getTopInternalList(category.getInfoCode()); if (internalList.size() > 0) { categoryMap.put(category, internalList); } } } if (StringUtils.equals(productCode, ProductType.OUTDOOR.getCode())) { categoryMap = new HashMap<Info, List<Outdoor>>(); for (Info category : categoryList) { List<Outdoor> outdoorList = webCategoryService.getTopOutdoorList(category.getInfoCode()); if (outdoorList.size() > 0) { categoryMap.put(category, outdoorList); } } } if (StringUtils.equals(productCode, ProductType.ATTRACTIONS.getCode())) { categoryMap = new HashMap<Info, List<Attractions>>(); for (Info category : categoryList) { List<Attractions> attractionsList = webCategoryService .getTopAttractionsList(category.getInfoCode()); if (attractionsList.size() > 0) { categoryMap.put(category, attractionsList); } } } if (StringUtils.equals(productCode, ProductType.EXPANSION_TRAINING.getCode())) { categoryMap = new HashMap<Info, List<Training>>(); for (Info category : categoryList) { List<Training> trainingList = webCategoryService.getTopTrainingList(category.getInfoCode()); if (trainingList.size() > 0) { categoryMap.put(category, trainingList); } } } if (StringUtils.equals(productCode, ProductType.ABOUT_US.getCode())) { return new ModelAndView("web/about").addObject("product", product).addObject("productCode", productCode) .addObject("productList", productList); } return new ModelAndView("web/category").addObject("product", product).addObject("productCode", productCode) .addObject("productList", productList).addObject("categoryMap", categoryMap); }
From source file:com.ning.maven.plugins.dependencyversionscheck.strategy.TwoDigitsBackwardCompatibleVersionStrategy.java
protected boolean checkCompatible(final AprVersion aprVersionA, final AprVersion aprVersionB) { if (aprVersionA == null || aprVersionB == null) { LOG.debug("... no, could not parse versions."); return false; }/* w ww . j av a 2 s .com*/ if (aprVersionA.getMajor() >= aprVersionB.getMajor()) { LOG.debug("... yes, major version ok!"); return true; } final boolean res = StringUtils.equals(aprVersionA.getQualifier(), aprVersionB.getQualifier()); if (!res) { LOG.debug("... no, qualifiers don't match!"); } else { LOG.debug("... yes!"); } return res; }
From source file:jp.primecloud.auto.tool.management.main.ConfigMain.java
public static void getPlatformNo(String platformName, String platformKind) { try {/*w w w . j av a 2s . c om*/ String platformSql = "SELECT * FROM PLATFORM"; List<Platform> platforms = SQLMain.selectExecuteWithResult(platformSql, Platform.class); if (platforms == null || platforms.isEmpty()) { System.out.println("NULL"); return; } for (Platform platform : platforms) { if (StringUtils.equals(platform.getPlatformName(), platformName)) { if (BooleanUtils.isNotTrue(platform.getSelectable())) { //??? System.out.println("DISABLE"); return; } String platformAwsSql = "SELECT * FROM PLATFORM_AWS WHERE PLATFORM_NO=" + platform.getPlatformNo(); List<PlatformAws> platformAwses = SQLMain.selectExecuteWithResult(platformAwsSql, PlatformAws.class); if ("ec2".equals(platformKind) && "aws".equals(platform.getPlatformType()) && BooleanUtils.isFalse(platformAwses.get(0).getEuca())) { System.out.println(platform.getPlatformNo().toString()); return; } else if ("vmware".equals(platformKind) && "vmware".equals(platform.getPlatformType())) { System.out.println(platform.getPlatformNo().toString()); return; } else if ("eucalyptus".equals(platformKind) && "aws".equals(platform.getPlatformType()) && BooleanUtils.isTrue(platformAwses.get(0).getEuca())) { System.out.println(platform.getPlatformNo().toString()); return; } else if ("nifty".equals(platformKind) && "nifty".equals(platform.getPlatformType())) { System.out.println(platform.getPlatformNo().toString()); return; } else if ("cloudstack".equals(platformKind) && "cloudstack".equals(platform.getPlatformType())) { System.out.println(platform.getPlatformNo().toString()); return; } else if ("vcloud".equals(platformKind) && "vcloud".equals(platform.getPlatformType())) { System.out.println(platform.getPlatformNo().toString()); return; } else if ("azure".equals(platformKind) && "azure".equals(platform.getPlatformType())) { System.out.println(platform.getPlatformNo().toString()); return; } else if ("openstack".equals(platformKind) && "openstack".equals(platform.getPlatformType())) { System.out.println(platform.getPlatformNo().toString()); return; } } } System.out.println("OTHER"); } catch (Exception e) { e.printStackTrace(); log.error(e.getMessage(), e); } }