List of usage examples for org.apache.commons.lang StringUtils EMPTY
String EMPTY
To view the source code for org.apache.commons.lang StringUtils EMPTY.
Click Source Link
""
. From source file:com.envision.envservice.common.util.SAPUtil.java
/** * ?SAP Date//from www . j a va2 s. c om */ public static String formatSAPDate(String sapDate, String format) { if (StringUtils.isEmpty(sapDate)) { return StringUtils.EMPTY; } Objects.requireNonNull(format); int tsStart = sapDate.indexOf(FIELD_PREFIX_DATE) + FIELD_PREFIX_DATE.length(); int tsEnd = sapDate.indexOf(FIELD_SUFFIX_DATE); String ts = sapDate.substring(tsStart, tsEnd); return DateUtil.format(new Date(Long.valueOf(ts)), format); }
From source file:com.cyclopsgroup.waterview.tool.LinkTool.java
/** * Add parameter into query string//from ww w . ja va 2 s. c o m * * @param name Parameter name * @param value Parameter value * @return Link itself * @throws Exception Throw it out */ public LinkTool addParam(String name, Object value) throws Exception { String s = value == null ? StringUtils.EMPTY : value.toString(); s = URLEncoder.encode(s, ENCODING); String part = name + "=" + s; if (queryString == null) { queryString = new StringBuffer(part); } else { queryString = new StringBuffer('&').append(part); } return this; }
From source file:com.comcast.viper.flume2storm.zookeeper.ZkClientConfigurationTest.java
@Test(expected = IllegalArgumentException.class) public void testInvalidConnectionStr() { new ZkClientConfiguration().setConnectionStr(StringUtils.EMPTY); }
From source file:com.apexxs.neonblack.utilities.Hints.java
public String containsHint(String name) { try {//from w ww . j a v a 2s .com for (Map.Entry<String, String> entry : hintMap.entrySet()) { if (StringUtils.containsIgnoreCase(name, entry.getKey())) { return entry.getValue(); } } } catch (Exception ex) { //Let it go, return an empty String } return StringUtils.EMPTY; }
From source file:com.microsoft.alm.plugin.idea.common.ui.workitem.WorkItemHelper.java
public static String getRelationUrl(@NotNull final WorkItem item, @NotNull final String attributeName, @NotNull final String attributeValue) { final List<WorkItemRelation> relationsList = item.getRelations(); if (relationsList != null) { for (WorkItemRelation relation : relationsList) { final Map<String, Object> attributes = relation.getAttributes(); if (attributes != null && attributes.containsKey(attributeName) && attributeValue.equalsIgnoreCase(attributes.get(attributeName).toString())) { return relation.getUrl(); }//from w w w.j ava2s .c om } } return StringUtils.EMPTY; }
From source file:com.zb.app.web.webuser.ZuobianWebUserBuilder.java
private static void _loginOut(CookieManager cookieManager, CookieKeyEnum... keys) { for (CookieKeyEnum key : keys) { cookieManager.set(key, StringUtils.EMPTY); }/*from w w w . j av a 2 s . co m*/ }
From source file:info.magnolia.cms.beans.config.ConfigLoader.java
/** * Initialize a ConfigLoader instance. All the supplied parameters will be set in * <code>info.magnolia.cms.beans.runtime.SystemProperty</code> * @param context ServletContext/*from w w w . java2 s.c om*/ * @param config contains initialization parameters * @see SystemProperty */ public ConfigLoader(ServletContext context, Map config) { String rootDir = context.getRealPath(StringUtils.EMPTY); if (log.isInfoEnabled()) { log.info("Assuming paths relative to {}", rootDir); //$NON-NLS-1$ } SystemProperty.setProperty(SystemProperty.MAGNOLIA_APP_ROOTDIR, rootDir); // load mgnl-beans.properties first InputStream mgnlbeansStream = getClass().getResourceAsStream(MGNL_BEANS_PROPERTIES); if (mgnlbeansStream != null) { Properties mgnlbeans = new Properties(); try { mgnlbeans.load(mgnlbeansStream); } catch (IOException e) { log.error("Unable to load {} due to an IOException: {}", MGNL_BEANS_PROPERTIES, e.getMessage()); } finally { IOUtils.closeQuietly(mgnlbeansStream); } for (Iterator iter = mgnlbeans.keySet().iterator(); iter.hasNext();) { String key = (String) iter.next(); SystemProperty.setProperty(key, mgnlbeans.getProperty(key)); } } else { log.warn( "{} not found in the classpath. Check that all the needed implementation classes are defined in your custom magnolia.properties file.", MGNL_BEANS_PROPERTIES); } Iterator it = config.entrySet().iterator(); while (it.hasNext()) { Map.Entry param = (Map.Entry) it.next(); SystemProperty.setProperty((String) param.getKey(), (String) param.getValue()); } if (StringUtils.isEmpty(System.getProperty("java.security.auth.login.config"))) { //$NON-NLS-1$ try { System.setProperty("java.security.auth.login.config", Path //$NON-NLS-1$ .getAbsoluteFileSystemPath("WEB-INF/config/jaas.config")); //$NON-NLS-1$ } catch (SecurityException se) { log.error("Failed to set java.security.auth.login.config, check application server settings"); //$NON-NLS-1$ log.error(se.getMessage(), se); log.info("Aborting startup"); return; } } else { if (log.isInfoEnabled()) { log.info("JAAS config file set by parent container or some other application"); //$NON-NLS-1$ log.info("Config in use " + System.getProperty("java.security.auth.login.config")); //$NON-NLS-1$ //$NON-NLS-2$ log.info( "Please make sure JAAS config has all necessary modules (refer config/jaas.config) configured"); //$NON-NLS-1$ } } this.load(context); }
From source file:at.pagu.soldockr.core.HttpSolrServerFactoryTest.java
@Test public void testInitFactoryWithEmptyCore() { HttpSolrServerFactory factory = new HttpSolrServerFactory(solrServer, StringUtils.EMPTY); Assert.assertEquals(URL, ((HttpSolrServer) factory.getSolrServer()).getBaseURL()); }
From source file:jenkins.plugins.coverity.CoverityTool.CovBuildScriptCommandTest.java
@Test public void commandForCompileSourcesTest_WithCaptureScriptSources() throws IOException, InterruptedException { InvocationAssistance invocationAssistance = new InvocationAssistanceBuilder().withIsScriptSrc(true) .withIsScriptSrc(true).build(); CoverityPublisher publisher = new CoverityPublisherBuilder().withInvocationAssistance(invocationAssistance) .build();//from w w w . j av a 2 s. c o m Command covBuildScriptCommand = new CovBuildScriptCommand(build, launcher, listener, publisher, StringUtils.EMPTY, envVars); setExpectedArguments(new String[] { "cov-build", "--dir", "TestDir", "--no-command", "--fs-capture-search", "$WORKSPACE" }); covBuildScriptCommand.runCommand(); consoleLogger.verifyLastMessage( "[Coverity] cov-build command line arguments for script sources: " + actualArguments.toString()); }
From source file:com.alibaba.otter.node.etl.load.loader.db.DbLoadDumper.java
public static String dumpEventDatas(List<EventData> eventDatas) { if (CollectionUtils.isEmpty(eventDatas)) { return StringUtils.EMPTY; }/*from w ww. ja v a 2s . co m*/ // ?? StringBuilder builder = new StringBuilder(event_default_capacity * eventDatas.size()); for (EventData data : eventDatas) { builder.append(dumpEventData(data)); } return builder.toString(); }