List of usage examples for org.apache.commons.lang StringUtils lowerCase
public static String lowerCase(String str)
Converts a String to lower case as per String#toLowerCase() .
From source file:info.magnolia.cms.servlets.PropertyInitializer.java
/** * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) *//*from w w w . j a v a 2 s .c o m*/ public void contextInitialized(ServletContextEvent sce) { final ServletContext context = sce.getServletContext(); String propertiesLocationString = context.getInitParameter(MAGNOLIA_INITIALIZATION_FILE); if (log.isDebugEnabled()) { log.debug("{} value in web.xml is :[{}]", MAGNOLIA_INITIALIZATION_FILE, propertiesLocationString); //$NON-NLS-1$ } if (StringUtils.isEmpty(propertiesLocationString)) { propertiesLocationString = DEFAULT_INITIALIZATION_PARAMETER; } String[] propertiesLocation = StringUtils.split(propertiesLocationString, ','); String servername = null; try { servername = StringUtils.lowerCase(InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { log.error(e.getMessage()); } String rootPath = StringUtils.replace(context.getRealPath(StringUtils.EMPTY), "\\", "/"); //$NON-NLS-1$ //$NON-NLS-2$ String webapp = StringUtils.substringAfterLast(rootPath, "/"); //$NON-NLS-1$ File logs = new File(webapp + File.separator + "logs"); File tmp = new File(webapp + File.separator + "tmp"); if (!logs.exists()) { logs.mkdir(); log.debug("Creating " + logs.getAbsoluteFile() + " folder"); } if (!tmp.exists()) { tmp.mkdir(); log.debug("Creating " + tmp.getAbsoluteFile() + " folder"); } if (log.isDebugEnabled()) { log.debug("rootPath is {}, webapp is {}", rootPath, webapp); //$NON-NLS-1$ } for (int j = 0; j < propertiesLocation.length; j++) { String location = StringUtils.trim(propertiesLocation[j]); location = StringUtils.replace(location, "${servername}", servername); //$NON-NLS-1$ location = StringUtils.replace(location, "${webapp}", webapp); //$NON-NLS-1$ File initFile = new File(rootPath, location); if (!initFile.exists() || initFile.isDirectory()) { if (log.isDebugEnabled()) { log.debug("Configuration file not found with path [{}]", //$NON-NLS-1$ initFile.getAbsolutePath()); } continue; } InputStream fileStream; try { fileStream = new FileInputStream(initFile); } catch (FileNotFoundException e1) { log.debug("Configuration file not found with path [{}]", //$NON-NLS-1$ initFile.getAbsolutePath()); return; } try { envProperties.load(fileStream); log.info("Loading configuration at {}", initFile.getAbsolutePath());//$NON-NLS-1$ Log4jConfigurer.initLogging(context, envProperties); new ConfigLoader(context, envProperties); } catch (Exception e) { log.error(e.getMessage(), e); } finally { IOUtils.closeQuietly(fileStream); } return; } log.error(MessageFormat.format( "No configuration found using location list {0}. [servername] is [{1}], [webapp] is [{2}] and base path is [{3}]", //$NON-NLS-1$ new Object[] { ArrayUtils.toString(propertiesLocation), servername, webapp, rootPath })); }
From source file:hydrograph.ui.propertywindow.widgets.customwidgets.TextBoxWithIsParameterCheckBoxWidget.java
private boolean isFieldNameExists(String newfieldName) { if (availableFieldList.contains(StringUtils.lowerCase(newfieldName))) return true; else//from www . j a v a2 s.c om return false; }
From source file:com.zb.app.web.controller.tour.TourController.java
@RequestMapping(value = "/addUser.htm", produces = "application/json", method = RequestMethod.POST) @ResponseBody//from w w w. j a v a 2 s. c o m public JsonResult addUser(ModelAndView mav, TravelMemberVO travelMemberVO) { TravelMemberDO travelMemberDO = new TravelMemberDO(); BeanUtils.copyProperties(travelMemberDO, travelMemberVO); travelMemberDO.setmPassword(EncryptBuilder.getInstance().encrypt(travelMemberVO.getmPassword())); travelMemberDO.setmUserName(StringUtils.lowerCase(travelMemberVO.getmUserName())); travelMemberDO.setcId(WebUserTools.getCid()); if (StringUtils.isNotEmpty(travelMemberVO.getmRole())) { String role = AuthorityHelper.makeAuthority(travelMemberVO.getmRole()); travelMemberDO.setmRole(role); } Integer i = memberService.insert(travelMemberDO); return i == 0 ? JsonResultUtils.error(travelMemberDO, "!") : JsonResultUtils.success(travelMemberDO, "?!"); }
From source file:edu.arizona.kra.proposaldevelopment.dao.ojb.PropDevRoutingStateDaoOjb.java
/** * Method that builds the main query for searching for in route proposals * @param searchCriteria//w ww . ja va2 s. co m * @return * @throws SQLException * @throws LookupException */ private String buildSqlQuery(Map<String, String> searchCriteria) throws SQLException, LookupException { StringBuilder query = new StringBuilder(SQL_LOOKUP); if (searchCriteria.containsKey(ROUTE_UNIT_NBR) && StringUtils.isNotEmpty(searchCriteria.get(ROUTE_UNIT_NBR))) { String routeUnitNumber = searchCriteria.get(ROUTE_UNIT_NBR); query.insert(annotationCriteriaOffset, LEAD_UNIT_ANNOT_CRITERIA + routeUnitNumber + "%'"); } if (searchCriteria.containsKey(PROPOSAL_PERSON_NAME) && StringUtils.isNotEmpty(searchCriteria.get(PROPOSAL_PERSON_NAME))) { String ppName = searchCriteria.get(PROPOSAL_PERSON_NAME).replaceAll("[\"?]", ""); query.append(PROPOSAL_PERSON_NAME_CRITERIA); query.append(StringUtils.lowerCase(ppName.replaceAll("[*]", "%"))); query.append("%')"); } if (searchCriteria.containsKey(LEAD_COLLEGE) && StringUtils.isNotEmpty(searchCriteria.get(LEAD_COLLEGE))) { String leadCollege = searchCriteria.get(LEAD_COLLEGE); query.append(LEAD_COLLEGE_CRITERIA); query.append(leadCollege); query.append(LEAD_COLLEGE_CRITERIA_CONT); } for (String searchKey : SEARCH_QUERIES.keySet()) { if (searchCriteria.containsKey(searchKey) && StringUtils.isNotEmpty(searchCriteria.get(searchKey))) { query.append(SEARCH_QUERIES.get(searchKey)); query.append(searchCriteria.get(searchKey)); query.append("'"); } } for (String searchKey : SEARCH_QUERIES_LIKE.keySet()) { if (searchCriteria.containsKey(searchKey) && StringUtils.isNotEmpty(searchCriteria.get(searchKey))) { String value = searchCriteria.get(searchKey).replaceAll("[\"?]", ""); query.append(SEARCH_QUERIES_LIKE.get(searchKey)); query.append(StringUtils.lowerCase(value.replaceAll("[*]", "%"))); query.append("%'"); } } addSearchDateCriteria(searchCriteria.get(SPONSOR_DATE), SPONSOR_DATE_CRITERIA, query); addSearchDateCriteria(searchCriteria.get(ROUTE_STOP_DATE), ROUTE_STOP_DATE_CRITERIA, query); query.append(ORDER_CRITERIA); LOG.debug("END getPropDevRoutingState sqlQuery={}.", query); return query.toString(); }
From source file:hydrograph.ui.dataviewer.adapters.DataViewerAdapter.java
private String getType(String databaseName) throws IOException { StringBuffer typeString = new StringBuffer(); String debugFileName = debugDataViewer.getDebugFileName(); String debugFileLocation = debugDataViewer.getDebugFileLocation(); if (ViewDataSchemaHelper.INSTANCE.getFieldsFromSchema( debugFileLocation + debugFileName + AdapterConstants.SCHEMA_FILE_EXTENTION) == null) { return ""; }/* w w w . j ava2 s. co m*/ Map<String, String> fieldAndTypes = new HashMap<String, String>(); for (Field field : ViewDataSchemaHelper.INSTANCE .getFieldsFromSchema(debugFileLocation + debugFileName + AdapterConstants.SCHEMA_FILE_EXTENTION) .getField()) { fieldAndTypes.put(StringUtils.lowerCase(field.getName()), field.getType().value()); } try (BufferedReader bufferedReader = new BufferedReader( new FileReader(new File(databaseName + tableName + AdapterConstants.CSV)))) { String firstLine = bufferedReader.readLine(); StringTokenizer stringTokenizer = new StringTokenizer(firstLine, ","); int countTokens = stringTokenizer.countTokens(); for (int i = 0; i < countTokens; i++) { String columnName = stringTokenizer.nextToken(); String typeName = fieldAndTypes.get(StringUtils.lowerCase(columnName)); typeString.append(StringUtils.substring(typeName, StringUtils.lastIndexOf(typeName, ".") + 1)); if (i != countTokens - 1) { typeString.append(","); } } } catch (IOException ioException) { logger.error("Failed to read view data file column headers", ioException); throw ioException; } return typeString.toString(); }
From source file:io.github.lucaseasedup.logit.command.hub.ImportAuthMeHubCommand.java
private void importAccounts(CommandSender sender, YamlConfiguration authMeConfig) { String backend = authMeConfig.getString("DataSource.backend"); String dataSourceMySqlHost = authMeConfig.getString("DataSource.mySQLHost"); String dataSourceMySqlPort = authMeConfig.getString("DataSource.mySQLPort"); String dataSourceMySqlUsername = authMeConfig.getString("DataSource.mySQLUsername"); String dataSourceMySqlPassword = authMeConfig.getString("DataSource.mySQLPassword"); String dataSourceMySqlDatabase = authMeConfig.getString("DataSource.mySQLDatabase"); String dataSourceMySqlTablename = authMeConfig.getString("DataSource.mySQLTablename"); String dataSourceMySqlColumnName = authMeConfig.getString("DataSource.mySQLColumnName"); String dataSourceMySqlColumnPassword = authMeConfig.getString("DataSource.mySQLColumnPassword"); String dataSourceMySqlColumnIp = authMeConfig.getString("DataSource.mySQLColumnIp"); String dataSourceMySqlColumnEmail = authMeConfig.getString("DataSource.mySQLColumnEmail"); String dataSourceMySqlColumnLastLocX = authMeConfig.getString("DataSource.mySQLlastlocX"); String dataSourceMySqlColumnLastLocY = authMeConfig.getString("DataSource.mySQLlastlocY"); String dataSourceMySqlColumnLastLocZ = authMeConfig.getString("DataSource.mySQLlastlocZ"); String dataSourceMySqlColumnLastLocWorld = authMeConfig.getString("DataSource.mySQLlastlocWorld"); String settingsSecurityPasswordHash = authMeConfig.getString("settings.security.passwordHash"); if (backend == null) { sendMsg(sender, t("import.authme.configPropNotFound").replace("{0}", "DataSource.backend")); return;//from ww w . jav a 2 s. co m } if (settingsSecurityPasswordHash == null) { sendMsg(sender, t("import.authme.configPropNotFound").replace("{0}", "settings.security.passwordHash")); return; } if (!AuthMePasswordHelper.validateEncryptionMethod(settingsSecurityPasswordHash)) { sendMsg(sender, t("import.authme.unsupportedEncryptionMethod").replace("{0}", settingsSecurityPasswordHash)); return; } List<Account> logItAccounts = new ArrayList<>(); try { if (backend.equalsIgnoreCase("mysql") || backend.equalsIgnoreCase("sqlite")) { Storage storage; if (backend.equalsIgnoreCase("mysql")) { storage = new MySqlStorage(dataSourceMySqlHost + ":" + dataSourceMySqlPort, dataSourceMySqlUsername, dataSourceMySqlPassword, dataSourceMySqlDatabase); } else { storage = new SqliteStorage("jdbc:sqlite:plugins/AuthMe/" + dataSourceMySqlDatabase + ".db"); } try { storage.connect(); List<Storage.Entry> authMeEntries = storage.selectEntries(dataSourceMySqlTablename); for (Storage.Entry authMeEntry : authMeEntries) { String authMeUsername = authMeEntry.get(dataSourceMySqlColumnName); if (StringUtils.isBlank(authMeUsername)) continue; Storage.Entry.Builder logItEntryBuilder = new Storage.Entry.Builder(); logItEntryBuilder.put(keys().username(), StringUtils.lowerCase(authMeUsername)); logItEntryBuilder.put(keys().password(), authMeEntry.get(dataSourceMySqlColumnPassword)); logItEntryBuilder.put(keys().hashing_algorithm(), "authme:" + settingsSecurityPasswordHash); logItEntryBuilder.put(keys().ip(), authMeEntry.get(dataSourceMySqlColumnIp)); String email = authMeEntry.get(dataSourceMySqlColumnEmail); if (!email.equals("your@email.com")) { logItEntryBuilder.put(keys().email(), email); } String world = authMeEntry.get(dataSourceMySqlColumnLastLocWorld); if (dataSourceMySqlColumnLastLocX != null && dataSourceMySqlColumnLastLocY != null && dataSourceMySqlColumnLastLocZ != null) { String x = authMeEntry.get(dataSourceMySqlColumnLastLocX); String y = authMeEntry.get(dataSourceMySqlColumnLastLocY); String z = authMeEntry.get(dataSourceMySqlColumnLastLocZ); if (!y.equals("0.0")) { Map<String, Map<String, String>> persistenceIni = new HashMap<>(); Map<String, String> persistence = new LinkedHashMap<>(); persistence.put("world", world); persistence.put("x", x); persistence.put("y", y); persistence.put("z", z); persistence.put("yaw", "0.0"); persistence.put("pitch", "0.0"); persistenceIni.put("persistence", persistence); String persistenceString = IniUtils.serialize(persistenceIni); if (getConfig("secret.yml").getBoolean("debug.encodePersistence")) { persistenceString = Base64.encode(persistenceString); } logItEntryBuilder.put(keys().persistence(), persistenceString); } } logItAccounts.add(new Account(logItEntryBuilder.build())); } } finally { storage.close(); } } else { File backendFile = new File("plugins/AuthMe/auths.db"); if (!backendFile.exists()) { sendMsg(sender, t("import.authme.fileNotFound").replace("{0}", "auths.db")); return; } try (BufferedReader br = new BufferedReader(new FileReader(backendFile))) { String line; while ((line = br.readLine()) != null) { String[] split = line.split(":"); Storage.Entry.Builder logItEntryBuilder = new Storage.Entry.Builder(); if (split.length == 0) continue; if (split.length >= 1) { if (StringUtils.isBlank(split[0])) continue; logItEntryBuilder.put(keys().username(), split[0].toLowerCase()); } if (split.length >= 2) { logItEntryBuilder.put(keys().password(), split[1]); logItEntryBuilder.put(keys().hashing_algorithm(), "authme:" + settingsSecurityPasswordHash); } if (split.length >= 3) { logItEntryBuilder.put(keys().ip(), split[2]); } if (split.length >= 4) { logItEntryBuilder.put(keys().last_active_date(), String.valueOf(Long.parseLong(split[3]) / 1000)); } if (split.length >= 8 && !split[5].equals("0.0")) { Map<String, Map<String, String>> persistenceIni = new HashMap<>(); Map<String, String> persistence = new LinkedHashMap<>(); persistence.put("world", split[7]); persistence.put("x", split[4]); persistence.put("y", split[5]); persistence.put("z", split[6]); persistence.put("yaw", "0.0"); persistence.put("pitch", "0.0"); persistenceIni.put("persistence", persistence); logItEntryBuilder.put(keys().persistence(), Base64.encode(IniUtils.serialize(persistenceIni))); } if (split.length >= 9) { String email = split[8].toLowerCase(); if (!email.equals("your@email.com")) { logItEntryBuilder.put(keys().email(), email); } } logItAccounts.add(new Account(logItEntryBuilder.build())); } } } Set<String> registeredUsernames = getAccountManager().getRegisteredUsernames(); int accountsImported = 0; Iterator<Account> it = logItAccounts.iterator(); while (it.hasNext()) { Account logItAccount = it.next(); if (registeredUsernames != null && registeredUsernames.contains(logItAccount.getUsername())) { it.remove(); continue; } accountsImported++; } getAccountManager().insertAccounts(logItAccounts.toArray(new Account[0])); log(Level.INFO, t("import.authme.success").replace("{0}", String.valueOf(accountsImported))); if (sender instanceof Player) { sendMsg(sender, t("import.authme.success").replace("{0}", String.valueOf(accountsImported))); } } catch (IOException ex) { log(Level.WARNING, ex); ReportedException.throwNew(ex); } }
From source file:ips1ap101.lib.core.db.util.InterpreteSqlPostgreSQL.java
@Override public String getNombreFuncionAgregacion(TipoAgregacionEnumeration tipo) { return StringUtils.lowerCase(super.getNombreFuncionAgregacion(tipo)); }
From source file:jp.co.tis.gsp.tools.dba.dialect.PostgresqlDialect.java
@Override public void createUser(String user, String password, String adminUser, String adminPassword) throws MojoExecutionException { Connection conn = null;//from w w w . j a v a 2 s .com Statement stmt = null; String database = getDatabase(); String role = StringUtils.lowerCase(user); try { conn = DriverManager.getConnection(url, adminUser, adminPassword); stmt = conn.createStatement(); if (existsUser(conn, role)) { return; } stmt.execute("CREATE ROLE " + role + " LOGIN PASSWORD \'" + password + "\'"); stmt.execute("GRANT CREATE, CONNECT ON DATABASE " + database + " TO " + role); } catch (SQLException e) { throw new MojoExecutionException("CREATE USER?", e); } finally { StatementUtil.close(stmt); ConnectionUtil.close(conn); } }
From source file:mitm.common.dlp.impl.MimeMessageTextExtractorImpl.java
private void extractMimeMessageMetaInfo(MimeMessage message, PartContext context) throws MessagingException { TextExtractorContext extractorContext = new TextExtractorContextImpl(); extractorContext.setEncoding(CharEncoding.US_ASCII); extractorContext.setName("headers"); StrBuilder sb = new StrBuilder(4096); try {// w w w . j a v a2 s . c o m for (Enumeration<?> headerEnum = message.getAllHeaders(); headerEnum.hasMoreElements();) { Header header = (Header) headerEnum.nextElement(); if (header == null) { continue; } if (skipHeaders != null && skipHeaders.contains(StringUtils.lowerCase(header.getName()))) { continue; } sb.append(header.getName()).append(": ").appendln(HeaderUtils.decodeTextQuietly(header.getValue())); } } catch (MessagingException e) { /* * Fallback to raw headers */ for (Enumeration<?> headerEnum = message.getAllHeaderLines(); headerEnum.hasMoreElements();) { sb.appendln(headerEnum.nextElement()); } } byte[] headerBytes = MiscStringUtils.toUTF8Bytes(sb.toString()); RewindableInputStream input = new RewindableInputStream(new ByteArrayInputStream(headerBytes), MEM_THRESHOLD); ExtractedPart part = new ExtractedPartImpl(extractorContext, input, headerBytes.length); try { context.update(part, true /* add */); } catch (IOException e) { throw new MessagingException("Error adding part to context.", e); } }
From source file:com.gst.infrastructure.reportmailingjob.validation.ReportMailingJobValidator.java
/** * validate the request to update a report mailing job * /*from www . ja v a 2 s .com*/ * @param jsonCommand -- the JSON command object (instance of the JsonCommand class) * @return None **/ public void validateUpdateRequest(final JsonCommand jsonCommand) { final String jsonString = jsonCommand.json(); final JsonElement jsonElement = jsonCommand.parsedJson(); if (StringUtils.isBlank(jsonString)) { throw new InvalidJsonException(); } final Type typeToken = new TypeToken<Map<String, Object>>() { }.getType(); this.fromJsonHelper.checkForUnsupportedParameters(typeToken, jsonString, ReportMailingJobConstants.UPDATE_REQUEST_PARAMETERS); final List<ApiParameterError> dataValidationErrors = new ArrayList<>(); final DataValidatorBuilder dataValidatorBuilder = new DataValidatorBuilder(dataValidationErrors) .resource(StringUtils.lowerCase(ReportMailingJobConstants.REPORT_MAILING_JOB_RESOURCE_NAME)); if (this.fromJsonHelper.parameterExists(ReportMailingJobConstants.NAME_PARAM_NAME, jsonElement)) { final String name = this.fromJsonHelper.extractStringNamed(ReportMailingJobConstants.NAME_PARAM_NAME, jsonElement); dataValidatorBuilder.reset().parameter(ReportMailingJobConstants.NAME_PARAM_NAME).value(name).notBlank() .notExceedingLengthOf(100); } if (this.fromJsonHelper.parameterExists(ReportMailingJobConstants.STRETCHY_REPORT_ID_PARAM_NAME, jsonElement)) { final Integer stretchyReportId = this.fromJsonHelper.extractIntegerWithLocaleNamed( ReportMailingJobConstants.STRETCHY_REPORT_ID_PARAM_NAME, jsonElement); dataValidatorBuilder.reset().parameter(ReportMailingJobConstants.STRETCHY_REPORT_ID_PARAM_NAME) .value(stretchyReportId).notNull().integerGreaterThanZero(); } if (this.fromJsonHelper.parameterExists(ReportMailingJobConstants.EMAIL_RECIPIENTS_PARAM_NAME, jsonElement)) { final String emailRecipients = this.fromJsonHelper .extractStringNamed(ReportMailingJobConstants.EMAIL_RECIPIENTS_PARAM_NAME, jsonElement); dataValidatorBuilder.reset().parameter(ReportMailingJobConstants.EMAIL_RECIPIENTS_PARAM_NAME) .value(emailRecipients).notBlank(); } if (this.fromJsonHelper.parameterExists(ReportMailingJobConstants.EMAIL_SUBJECT_PARAM_NAME, jsonElement)) { final String emailSubject = this.fromJsonHelper .extractStringNamed(ReportMailingJobConstants.EMAIL_SUBJECT_PARAM_NAME, jsonElement); dataValidatorBuilder.reset().parameter(ReportMailingJobConstants.EMAIL_SUBJECT_PARAM_NAME) .value(emailSubject).notBlank().notExceedingLengthOf(100); } if (this.fromJsonHelper.parameterExists(ReportMailingJobConstants.EMAIL_MESSAGE_PARAM_NAME, jsonElement)) { final String emailMessage = this.fromJsonHelper .extractStringNamed(ReportMailingJobConstants.EMAIL_MESSAGE_PARAM_NAME, jsonElement); dataValidatorBuilder.reset().parameter(ReportMailingJobConstants.EMAIL_MESSAGE_PARAM_NAME) .value(emailMessage).notBlank(); } if (this.fromJsonHelper.parameterExists(ReportMailingJobConstants.IS_ACTIVE_PARAM_NAME, jsonElement)) { final Boolean isActive = this.fromJsonHelper .extractBooleanNamed(ReportMailingJobConstants.IS_ACTIVE_PARAM_NAME, jsonElement); dataValidatorBuilder.reset().parameter(ReportMailingJobConstants.IS_ACTIVE_PARAM_NAME).value(isActive) .notNull(); } if (this.fromJsonHelper.parameterExists( ReportMailingJobConstants.EMAIL_ATTACHMENT_FILE_FORMAT_ID_PARAM_NAME, jsonElement)) { final Integer emailAttachmentFileFormatId = this.fromJsonHelper.extractIntegerSansLocaleNamed( ReportMailingJobConstants.EMAIL_ATTACHMENT_FILE_FORMAT_ID_PARAM_NAME, jsonElement); dataValidatorBuilder.reset() .parameter(ReportMailingJobConstants.EMAIL_ATTACHMENT_FILE_FORMAT_ID_PARAM_NAME) .value(emailAttachmentFileFormatId).notNull(); if (emailAttachmentFileFormatId != null) { dataValidatorBuilder.reset() .parameter(ReportMailingJobConstants.EMAIL_ATTACHMENT_FILE_FORMAT_ID_PARAM_NAME) .value(emailAttachmentFileFormatId) .isOneOfTheseValues(ReportMailingJobEmailAttachmentFileFormat.validIds()); } } if (this.fromJsonHelper.parameterExists(ReportMailingJobConstants.START_DATE_TIME_PARAM_NAME, jsonElement)) { final String dateFormat = jsonCommand.dateFormat(); dataValidatorBuilder.reset().parameter(ReportMailingJobConstants.DATE_FORMAT_PARAM_NAME) .value(dateFormat).notBlank(); final String startDateTime = this.fromJsonHelper .extractStringNamed(ReportMailingJobConstants.START_DATE_TIME_PARAM_NAME, jsonElement); dataValidatorBuilder.reset().parameter(ReportMailingJobConstants.START_DATE_TIME_PARAM_NAME) .value(startDateTime).notBlank(); if (StringUtils.isNotEmpty(dateFormat)) { try { final DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern(dateFormat) .withLocale(jsonCommand.extractLocale()); // try to parse the date time string LocalDateTime.parse(startDateTime, dateTimeFormatter); } catch (IllegalArgumentException ex) { dataValidatorBuilder.reset().parameter(ReportMailingJobConstants.DATE_FORMAT_PARAM_NAME) .value(dateFormat).failWithCode("invalid.date.format"); } } } throwExceptionIfValidationWarningsExist(dataValidationErrors); }