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:jenkins.plugins.coverity.CoverityTool.CovAnalyzeCommandTest.java
@Test public void addMisraConfigurationTest_WithEmptyMisraConfigFilePath() throws IOException, InterruptedException { InvocationAssistance invocationAssistance = new InvocationAssistanceBuilder().withMisraConfigFile("") .build();/* w ww.ja va2 s . co m*/ CoverityPublisher publisher = new CoverityPublisherBuilder().withInvocationAssistance(invocationAssistance) .build(); Command covAnalyzeCommand = new CovAnalyzeCommand(build, launcher, listener, publisher, StringUtils.EMPTY, envVars); try { covAnalyzeCommand.runCommand(); fail("RuntimeException should have been thrown"); } catch (RuntimeException e) { assertEquals("Misra configuration file is required to run Misra analysis.", e.getMessage()); } }
From source file:com.envision.envservice.rest.CourseResource.java
@POST @Path("/arrange/{courseId}") @Produces(MediaType.APPLICATION_JSON)/*w w w . j a v a 2 s. c o m*/ public Response arrange(@PathParam("courseId") int courseId) throws ServiceException { HttpStatus status = HttpStatus.CREATED; String response = StringUtils.EMPTY; courseService.arrange(courseId); return Response.status(status.value()).entity(response).build(); }
From source file:at.pagu.soldockr.core.query.SimpleQueryTest.java
@Test(expected = IllegalArgumentException.class) public void testAddProjectionNullFieldName() { new SimpleQuery().addProjectionOnField(new SimpleField(StringUtils.EMPTY)); }
From source file:com.fengduo.bee.commons.component.ComponentController.java
@ExceptionHandler(Throwable.class) public ModelAndView handleIOException(Throwable e) throws Throwable { if (AnnotationUtils.findAnnotation(e.getClass(), ResponseStatus.class) != null) { throw e;// ww w . ja va2 s.co m } if (request == null && response == null) { throw e; } if (request == null && response != null) { response.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=UTF-8"); OutputStream out = response.getOutputStream(); PrintWriter pw = new PrintWriter(new OutputStreamWriter(out, "utf-8")); pw.println("{\"code\":1,\"msg\":\",?!\",\"data\":\"\"}"); pw.flush(); pw.close(); } ModelAndView mav = new ModelAndView(); // if (InvokeTypeTools.isAjax(request)) { // return createJsonMav("server exceptin or error", ResultCode.ERROR, // e.getMessage()); // } mav.addObject("exception", e.getCause() == null ? StringUtils.EMPTY : e.getCause().toString()); mav.addObject("msg", StringUtils.isEmpty(e.getMessage()) ? e.toString() : e.getMessage()); mav.addObject("stackTrace", e.getStackTrace().toString()); if (request.getRequestURI() != null) { mav.addObject("url", request.getRequestURI().toString()); } mav.setViewName("error"); return mav; }
From source file:com.chadekin.jadys.syntax.OrderByClauseBuilderImplTest.java
@Test public void shouldThrowIaeWhenOrderStatementIsEmptyAndOrderAsc() { // Act/*ww w . j a v a 2s . com*/ String sql = builder.orderBy(StringUtils.EMPTY).asc().build(); // Assert assertThat(sql, is(emptyString())); }
From source file:com.haulmont.cuba.core.sys.dbupdate.DbProperties.java
public String getCurrentSchemaProperty() { Map<String, String> properties = getProperties(); if (properties != null) { String currentSchema = properties.get("currentSchema"); return StringUtils.isNotEmpty(currentSchema) ? currentSchema.replace("\"", StringUtils.EMPTY) : null; }//from w ww. j a va 2s. c o m return null; }
From source file:com.sugaronrest.SugarRestRequest.java
/** * Initializes a new instance of the SugarRestRequest class. * * @param moduleType The SugarCRM module Java type. *///from ww w .j a va 2s .c o m public SugarRestRequest(Type moduleType) { this.setModuleType(moduleType); this.setOptions(new Options()); this.validationMessage = StringUtils.EMPTY; }
From source file:info.magnolia.templating.renderers.PlainTextTemplateRenderer.java
@Override protected String resolveTemplateScript(Node content, RenderableDefinition definition, RenderingModel<?> model, String actionResult) {//from ww w. java 2 s . co m return StringUtils.EMPTY; }
From source file:fr.paris.lutece.plugins.genericattributes.service.entrytype.AbstractEntryTypeComment.java
/** * {@inheritDoc}//from w w w . j a v a 2 s . c om */ @Override public String getRequestData(Entry entry, HttpServletRequest request, Locale locale) { String strCode = request.getParameter(PARAMETER_ENTRY_CODE); String strComment = request.getParameter(PARAMETER_COMMENT); String strCSSClass = request.getParameter(PARAMETER_CSS_CLASS); String strFieldError = StringUtils.EMPTY; if (StringUtils.isBlank(strComment)) { strFieldError = FIELD_COMMENT; } if (StringUtils.isNotBlank(strFieldError)) { Object[] tabRequiredFields = { I18nService.getLocalizedString(strFieldError, locale) }; return AdminMessageService.getMessageUrl(request, MESSAGE_MANDATORY_FIELD, tabRequiredFields, AdminMessage.TYPE_STOP); } entry.setCode(strCode); entry.setComment(strComment); entry.setCSSClass(strCSSClass); return null; }
From source file:info.magnolia.module.admininterface.DialogMVCServlet.java
/** * *//*from w ww . j a va 2s .c om*/ protected MVCServletHandler getHandler(HttpServletRequest request, HttpServletResponse response) { String dialogName = RequestFormUtil.getParameter(request, "mgnlDialog"); //$NON-NLS-1$ if (StringUtils.isEmpty(dialogName)) { if (StringUtils.isEmpty(dialogName)) { dialogName = (String) request.getAttribute("javax.servlet.include.request_uri"); //$NON-NLS-1$ if (StringUtils.isEmpty(dialogName)) { dialogName = (String) request.getAttribute("javax.servlet.forward.servlet_path"); //$NON-NLS-1$ } if (StringUtils.isEmpty(dialogName)) { dialogName = request.getRequestURI(); } dialogName = StringUtils.replaceOnce(StringUtils.substringAfterLast(dialogName, "/dialogs/"), //$NON-NLS-1$ ".html", //$NON-NLS-1$ StringUtils.EMPTY); } } DialogMVCHandler handler = null; if (StringUtils.isNotBlank(dialogName)) { // try to get a registered handler try { handler = DialogHandlerManager.getInstance().getDialogHandler(dialogName, request, response); } catch (InvalidDialogHandlerException e) { log.info("can't find handler will try to load directly from the config", e); //$NON-NLS-1$ Content configNode = ConfiguredDialog.getConfigNode(request, dialogName); // try to find a class property or return a ConfiguredDialog if (configNode != null) { handler = ConfiguredDialog.getConfiguredDialog(dialogName, configNode, request, response); } else { log.error("no config node found for dialog : " + dialogName); //$NON-NLS-1$ } } } if (handler == null) { log.error(MessageFormat.format("Missing configuration for {0}. Check node {1}{0}", //$NON-NLS-1$ new Object[] { dialogName, "/modules/templating/Paragraphs/" })); //$NON-NLS-1$ throw new ConfigurationException( MessageFormat.format("Missing configuration for {0}. Check node {1}{0}", //$NON-NLS-1$ new Object[] { dialogName, "/modules/templating/Paragraphs/" })); //$NON-NLS-1$ } return handler; }