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.cognifide.slice.mapper.impl.processor.SliceReferenceFieldProcessor.java
private String getFullPath(final String initialPath) { if (StringUtils.isBlank(initialPath)) { return StringUtils.EMPTY; }/*from ww w. j a v a2s. c o m*/ final String fullPath = getResolvedPath(initialPath); if (StringUtils.isBlank(fullPath)) { return StringUtils.EMPTY; } if ((fullPath.charAt(0) != '/') && !StringUtils.startsWith(fullPath, "./")) { return "./" + fullPath; } return fullPath; }
From source file:net.sourceforge.fenixedu.presentationTier.renderers.inquiries.InquiriesTextBoxQuestionRenderer.java
@Override protected Layout getLayout(Object object, Class type) { return new Layout() { @Override/*from w w w .j av a 2 s.co m*/ public HtmlComponent createComponent(Object object, Class type) { Boolean textArea = (Boolean) getContext().getProperties().get("textArea"); final HtmlSimpleValueComponent htmlTextInput; if (textArea != null && textArea) { htmlTextInput = new HtmlTextArea(); } else { htmlTextInput = new HtmlTextInput(); ((HtmlTextInput) htmlTextInput).setMaxLength(getMaxLength()); } htmlTextInput.setValue(object != null ? object.toString() : StringUtils.EMPTY); return htmlTextInput; } }; }
From source file:com.steeleforge.aem.ironsites.i18n.I18nResourceBundle.java
@Override protected Object handleGetObject(String key) { if (null != content && content.keySet().contains(key)) { return content.get(key, StringUtils.EMPTY); }/*from ww w . j av a 2s. c o m*/ if (null != bundle && bundle.keySet().contains(key)) { return bundle.getObject(key); } return null; }
From source file:fr.paris.lutece.plugins.crm.business.parameters.AdvancedParametersDAO.java
/** * {@inheritDoc}//from ww w. j a v a 2 s.co m */ @Override public String getParameterStringValueByKey(String strKey, Plugin plugin) { String strValue = StringUtils.EMPTY; DAOUtil daoUtil = new DAOUtil(SQL_QUERY_SELECT_VALUE_PARAMETER_BY_KEY, plugin); daoUtil.setString(1, strKey); daoUtil.executeQuery(); while (daoUtil.next()) { strValue = daoUtil.getString(1); } daoUtil.free(); return strValue; }
From source file:de.hybris.platform.importcockpit.services.impex.generator.operations.impl.DefaultDataGeneratorOperationTest.java
@Test public void generateDataLineForProductAttribEntryBlanValueReturned() { when(attributeLine.getValue()).thenReturn(StringUtils.EMPTY); when(attributeLine.getSource()).thenReturn(null); final String entryResultValue = operation.generateDataLineForProductAttribEntry(inputDataLine, attributeLine);//from ww w . ja v a 2s . c o m assertThat(entryResultValue).isEqualTo(StringUtils.EMPTY); verify(attributeLine).getValue(); }
From source file:jenkins.plugins.coverity.CoverityTool.CovImportScmCommandTest.java
@Test public void addCustomTestToolTest() throws IOException, InterruptedException { ScmOptionBlock scmOptionBlock = new ScmOptionBlockBuilder().withScmSystem("git") .withCustomTestTool("TestCustomTestTool").build(); CoverityPublisher publisher = new CoverityPublisherBuilder().withScmOptionBlock(scmOptionBlock).build(); Command covImportScmCommand = new CovImportScmCommand(build, launcher, listener, publisher, StringUtils.EMPTY, envVars); setExpectedArguments(new String[] { "cov-import-scm", "--dir", "TestDir", "--scm", "git", "--tool", "TestCustomTestTool" }); covImportScmCommand.runCommand();//w ww .j a v a 2s . co m consoleLogger.verifyLastMessage( "[Coverity] cov-import-scm command line arguments: " + actualArguments.toString()); }
From source file:com.egt.core.aplicacion.ListaParametros.java
public void addParametro(String clave, Object valor) { if (clave != null) { valor = STP.getString(valor);/*from w ww.ja v a 2 s.c o m*/ if (valor == null) { valor = StringUtils.EMPTY; } ParametroPeticion parametro = new ParametroPeticion(clave, (String) valor); parametros.add(parametro); } }
From source file:com.mmj.app.web.webuser.MMJWebUserBuilder.java
public static void _loginOut(CookieManager cookieManager, CookieKeyEnum... keys) { for (CookieKeyEnum key : keys) { cookieManager.set(key, StringUtils.EMPTY); }// www. jav a 2s. c om }
From source file:com.prowidesoftware.swift.utils.Lib.java
/** * Read a resource from classpath using the context classloader * @param resource the resource name to read, must not be null * @param encoding optional, may be null in chich case UTF-8 is used * @return read content or empty string if resource cannot be loaded * @throws IOException// w ww .ja va2 s. co m * @since 7.7 */ public static String readResource(final String resource, final String encoding) throws IOException { final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource); if (is == null) { return StringUtils.EMPTY; } return readStream(is, null); }
From source file:co.cask.cdap.client.rest.handlers.StreamHttpRequestHandler.java
@Override public void handle(HttpRequest httpRequest, HttpResponse response, HttpContext httpContext) throws HttpException, IOException { RequestLine requestLine = httpRequest.getRequestLine(); String method = requestLine.getMethod(); int statusCode; String uri = requestLine.getUri(); String streamName = TestUtils.getStreamNameFromUri(uri + "/"); if (HttpMethod.PUT.equals(method)) { if (TestUtils.AUTH_STREAM_NAME.equals(streamName)) { statusCode = TestUtils.authorize(httpRequest); } else {/* w w w .jav a 2 s.c o m*/ statusCode = TestUtils.getStatusCodeByStreamName(streamName); } } else if (HttpMethod.POST.equals(method)) { String fullStreamName = streamName; streamName = streamName.replace(TestUtils.WRITER_TEST_STREAM_NAME_POSTFIX, StringUtils.EMPTY); if (TestUtils.AUTH_STREAM_NAME.equals(streamName)) { statusCode = TestUtils.authorize(httpRequest); } else if (TestUtils.WITH_CUSTOM_HEADER_STREAM_NAME.endsWith(streamName)) { Header testHeader = httpRequest.getFirstHeader(fullStreamName + "." + RestTest.TEST_HEADER_NAME); if (testHeader != null && RestTest.TEST_HEADER_VALUE.equals(testHeader.getValue())) { statusCode = HttpStatus.SC_OK; } else { statusCode = HttpStatus.SC_BAD_REQUEST; } } else { statusCode = TestUtils.getStatusCodeByStreamName(streamName); } if (HttpStatus.SC_OK == statusCode && !TestUtils.FILE_STREAM_NAME.equals(streamName)) { //check request content BasicHttpEntityEnclosingRequest request = (BasicHttpEntityEnclosingRequest) httpRequest; HttpEntity requestEntity = request.getEntity(); if (requestEntity != null) { String content = RestClient.toString(requestEntity); if (!RestTest.EXPECTED_WRITER_CONTENT.equals(content) && !TestUtils.ALLOW_ANY_EVENT_STREAM.equals(streamName)) { statusCode = HttpStatus.SC_INTERNAL_SERVER_ERROR; } } else { statusCode = HttpStatus.SC_BAD_REQUEST; } } } else { statusCode = HttpStatus.SC_NOT_IMPLEMENTED; } response.setStatusCode(statusCode); }