Example usage for java.util Locale ENGLISH

List of usage examples for java.util Locale ENGLISH

Introduction

In this page you can find the example usage for java.util Locale ENGLISH.

Prototype

Locale ENGLISH

To view the source code for java.util Locale ENGLISH.

Click Source Link

Document

Useful constant for language.

Usage

From source file:com.flexive.rest.FxRestApiUtils.java

public static ResponseFormat getResponseFormat(UriInfo uriInfo) {
    final String format = uriInfo.getQueryParameters(true).getFirst("format");
    return StringUtils.isBlank(format) ? ResponseFormat.JSON
            : ResponseFormat.valueOf(format.trim().toUpperCase(Locale.ENGLISH));
}

From source file:fi.helsinki.opintoni.integration.coursepage.CoursePageRestClientTest.java

@Test
public void thatEmptyNotificationListIsReturnedWithEmptyIds() {
    List<CoursePageNotification> notifications = coursePageRestClient
            .getCoursePageNotifications(Sets.newHashSet(), LocalDateTime.now(), Locale.ENGLISH);
    assertThat(notifications.isEmpty()).isTrue();
}

From source file:ru.apertum.qsystem.reports.net.NetUtil.java

public static synchronized HashMap<String, String> getParameters(HttpRequest request) {
    final String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
    final HashMap<String, String> res = new HashMap<>();
    final String data;
    if (method.equals("GET")) {
        String[] ss = request.getRequestLine().getUri().split("\\?");
        if (ss.length == 2) {
            try {
                data = URLDecoder.decode(request.getRequestLine().getUri().split("\\?")[1], "utf-8");
            } catch (UnsupportedEncodingException ex) {
                throw new ReportException(ex.toString());
            }//from w  ww .  java 2 s  .  com
        } else {
            data = "";
        }
    } else {
        data = getEntityContent(request);
    }
    String[] ss = data.split("&");
    for (String str : ss) {
        String[] ss1 = str.split("=");
        if (!ss1[0].isEmpty()) {
            res.put(ss1[0], ss1.length == 1 ? "" : ss1[1]);
        }
    }
    return res;
}

From source file:Main.java

private static Byte encodeUriScheme(String uri) {
    String lowerCaseUri = uri.toLowerCase(Locale.ENGLISH);
    for (int i = 0; i < URI_SCHEMES.size(); i++) {
        // get the key and value.
        int key = URI_SCHEMES.keyAt(i);
        String value = URI_SCHEMES.valueAt(i);
        if (lowerCaseUri.startsWith(value)) {
            return (byte) key;
        }/*www.  ja v  a 2s  . c  om*/
    }
    return null;
}

From source file:ch.ralscha.extdirectspring.provider.PollProvider.java

@ExtDirectMethod(value = ExtDirectMethodType.POLL, event = "message3", group = "group4")
public String handleMessage3(Locale locale, @RequestParam(value = "id") int id) {
    assertThat(locale).isEqualTo(Locale.ENGLISH);
    return "Result: " + id;
}

From source file:com.stimulus.archiva.presentation.MailboxConnectionBean.java

public String getProtocol() {
    return connection.getProtocol().toString().toLowerCase(Locale.ENGLISH);
}

From source file:se.omegapoint.facepalm.infrastructure.FilePolicyRepository.java

private Command commandBasedOnOperatingSystem(final String filename) {
    final String os = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
    return os.contains("win") ? new WindowsCommand(filename) : new UnixCommand(filename);
}

From source file:org.jasig.springframework.web.portlet.SimplePortletApplicationContext.java

public void refresh() throws BeansException {
    MutablePropertyValues pvs = new MutablePropertyValues();
    pvs.add("commandClass", "org.jasig.springframework.beans.TestBean");
    pvs.add("formView", "form");
    registerSingleton("/form.do", SimpleFormController.class, pvs);

    registerSingleton("/locale.do", LocaleChecker.class);

    addMessage("test", Locale.ENGLISH, "test message");
    addMessage("test", Locale.CANADA, "Canadian & test message");
    addMessage("testArgs", Locale.ENGLISH, "test {0} message {1}");
    addMessage("testArgsFormat", Locale.ENGLISH, "test {0} message {1,number,#.##} X");

    registerSingleton(UiApplicationContextUtils.THEME_SOURCE_BEAN_NAME, DummyThemeSource.class);

    registerSingleton("handlerMapping", BeanNameUrlHandlerMapping.class);
    registerSingleton("viewResolver", InternalResourceViewResolver.class);

    pvs = new MutablePropertyValues();
    pvs.add("location", "org/springframework/web/context/WEB-INF/sessionContext.xml");
    registerSingleton("viewResolver2", XmlViewResolver.class, pvs);

    super.refresh();
}

From source file:guru.nidi.loader.url.SimpleUrlFetcher.java

private String httpDate(long date) {
    final SimpleDateFormat format = new SimpleDateFormat(HTTP_DATE_FORMAT, Locale.ENGLISH);
    format.setTimeZone(TimeZone.getTimeZone("GMT"));
    return format.format(date);
}

From source file:org.owasp.webgoat.service.LabelServiceTest.java

@Test
@WithMockUser(username = "guest", password = "guest")
public void withoutLocale() throws Exception {
    when(labelProvider.getLabels(Locale.ENGLISH)).thenReturn(Maps.newHashMap("key", "value"));
    mockMvc.perform(MockMvcRequestBuilders.get(URL_LABELS_MVC)).andExpect(status().isOk())
            .andExpect(jsonPath("key", CoreMatchers.is("value")));
}