List of usage examples for java.util Locale ENGLISH
Locale ENGLISH
To view the source code for java.util Locale ENGLISH.
Click Source Link
From source file:org.mitre.openid.connect.service.impl.MITREidDataServiceSupport.java
protected Date utcToDate(String value) { if (value == null) { return null; }//from w ww .ja v a 2s. c o m try { return dateFormatter.parse(value, Locale.ENGLISH); } catch (ParseException ex) { logger.error("Unable to parse datetime {}", value, ex); } return null; }
From source file:at.ac.univie.isc.asio.ServerStatus.java
@Nonnull @Override//from ww w . ja v a 2s. c om protected String normalize(@Nonnull final String val) { return val.toUpperCase(Locale.ENGLISH).trim(); }
From source file:com.github.dozermapper.core.config.resolvers.SystemEnvironmentSettingsResolver.java
private String getEnvironmentSafeKey(String key) { String environmentSafeKey = StringUtils.replace(key, ".", "_"); environmentSafeKey = StringUtils.replace(environmentSafeKey, "-", "_"); return environmentSafeKey.toUpperCase(Locale.ENGLISH); }
From source file:com.rodiontsev.maven.plugins.buildinfo.providers.BuildTimeProvider.java
@Override public Map<String, String> getInfo(MavenProject project, BuildInfoMojo mojo) { Map<String, String> info = new LinkedHashMap<String, String>(); String dateTimePattern = mojo.getDateTimePattern(); if (StringUtils.isNotBlank(dateTimePattern)) { String buildTime;/* www .j a v a 2 s . c o m*/ try { DateFormat dateFormat = new SimpleDateFormat(dateTimePattern, Locale.ENGLISH); buildTime = dateFormat.format(new Date()); } catch (IllegalArgumentException e) { buildTime = "the given pattern is invalid"; mojo.getLog().warn(String.format( "The given date-time pattern '%s' is invalid. Please read %s javadoc about user-defined patterns for date-time formatting.", dateTimePattern, SimpleDateFormat.class.getCanonicalName())); } info.put("build.time", buildTime); } return info; }
From source file:eu.trentorise.smartcampus.social.SocialEngineConnector.java
@PostConstruct protected void init() throws SmartCampusException { try {/*from w ww . j a v a 2 s . c o m*/ socialEngineClient = SCWebApiClient.getInstance(Locale.ENGLISH, seHost, new Integer(sePort)); } catch (Exception e) { String msg = String.format("Exception creating social engine client host:%s, port:%s", seHost, sePort); logger.error(msg, e); throw new SmartCampusException(msg); } }
From source file:io.getlime.security.powerauth.app.server.service.i18n.LocalizationProvider.java
public GenericServiceException buildExceptionForCode(String code) { return this.buildExceptionForCode(code, Locale.ENGLISH); }
From source file:edu.temple.cis3238.wiki.utils.StringUtils.java
/** * Formats date string with specified dateformat. * @param dateStr Date to format//from w w w. java 2s . c o m * @param formattedDateOut Format string * @return Formatted date */ public static String formatDate(String dateStr, String formattedDateOut) { DateFormat dateformat = new SimpleDateFormat(DEFAULT_SQL_DATETIME_FMT, Locale.ENGLISH); DateFormat dateformatOut = new SimpleDateFormat(formattedDateOut, Locale.ENGLISH); try { return dateformatOut.format(dateformat.parse(dateStr)); } catch (Exception ex) { Logger.getLogger(StringUtils.class.getName()).log(Level.SEVERE, null, ex); } return dateStr; }
From source file:org.osiam.resource_server.storage.query.GroupFilterParser.java
@Override protected QueryField<GroupEntity> getFilterField(String sortBy) { return GroupQueryField.fromString(sortBy.toLowerCase(Locale.ENGLISH)); }
From source file:fi.helsinki.opintoni.service.CourseServiceTest.java
@Test public void thatStudentCourseDtosAreFetched() { expectStudentCourses();/* w w w .j a va 2 s . c o m*/ Set<CourseDto> courseDtos = courseService.getCourses(Optional.of(TestConstants.STUDENT_NUMBER), Optional.empty(), Locale.ENGLISH); assertThat(courseDtos).hasSize(1); assertThat(courseDtos, hasCourseWithRealisationId(TestConstants.STUDENT_COURSE_REALISATION_ID)); assertThat(courseDtos.iterator().next().teachers.get(0)).isEqualTo("Rantala Kari A"); }
From source file:com.haulmont.cuba.client.testsupport.TestUserSessionSource.java
@Override public synchronized UserSession getUserSession() { if (session == null) { User user = new User(); user.setId(UUID.fromString(USER_ID)); user.setLogin("test_admin"); user.setName("Test Administrator"); user.setPassword(DigestUtils.md5Hex("test_admin")); session = new UserSession(UUID.randomUUID(), user, Collections.<Role>emptyList(), Locale.ENGLISH, false);/* w ww .ja v a2s .c o m*/ } return session; }