public ApiException toBadRequestException() { String msg = StringUtils.toDelineatedString("\n", this); return ApiException.badRequest(msg); } }
protected String[] getSpringProfiles(ServletContext servletContext, WebApplicationContext appContext) { String environmentName = System.getProperty(getEnvironmentPropertyName(servletContext, appContext), "null"); String envProfileName = "env-"+environmentName; String defaultProfiles = StringUtils.toDelineatedString(",", "main", "live", envProfileName); String profilesString = System.getProperty(getProfilesPropertyName(servletContext, appContext), defaultProfiles); List<String> profiles = new ArrayList<>(); for (String profile : profilesString.split(",")) { profiles.add(profile.trim()); } return ReflectUtils.toArray(String.class, profiles); } }
private static void validSecurityField(RequestErrors errors, String value, String what) { ValidationUtils.requireValue(errors, value, String.format("The %s must be specified.", what)); if (StringUtils.isBlank(value)) return; for (String chr : invalidSecurityChr) { if (value.contains(chr)) { String list = StringUtils.toDelineatedString(" ", invalidSecurityChr); String msg = String.format("The %s cannot contain the following characters: %s", what, list); errors.add(msg); break; } } }
accountOperation.validate(errors); if (errors.isEmpty() == false) { String msg = StringUtils.toDelineatedString("\n", errors); throw ApiException.badRequest(msg);