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:ch.ralscha.extdirectspring.provider.RemoteProviderStoreModifyArray.java

@ExtDirectMethod(value = ExtDirectMethodType.STORE_MODIFY, event = "test")
public Row[] create2(List<Row> rows, HttpServletResponse response, HttpServletRequest request,
        final HttpSession session, Locale locale) {
    assertThat(response).isNotNull();/* w  ww .j  a v a 2 s .c  om*/
    assertThat(request).isNotNull();
    assertThat(session).isNotNull();
    assertThat(locale).isEqualTo(Locale.ENGLISH);

    return rows.toArray(new Row[rows.size()]);
}

From source file:capital.scalable.restdocs.jackson.BigDecimalSerializer.java

private DecimalFormat englishDecimalFormat() {
    DecimalFormat df = (DecimalFormat) NumberFormat.getNumberInstance(Locale.ENGLISH);
    df.applyPattern("#,##0.00");
    return df;/*from   w  w w .  j av a2s.com*/
}

From source file:com.igormaznitsa.mindmap.plugins.external.ExternalPlugins.java

public void init() {
    final Collection<File> plugins = FileUtils.listFiles(this.pluginsFolder,
            new String[] { PLUGIN_EXTENSION, PLUGIN_EXTENSION.toUpperCase(Locale.ENGLISH) }, false);
    LOGGER.info("Detected " + plugins.size() + " plugin(s)");
    for (final File plugin : plugins) {
        try {/*  w  w  w .  j  ava2s . c  om*/
            final PluginClassLoader loader = new PluginClassLoader(plugin);
            final String pluginTitle = GetUtils.ensureNonNull(loader.getAttributes(Attribute.TITLE),
                    "<unknown>");
            final Version pluginVersion = new Version(loader.getAttributes(Attribute.VERSION));

            LOGGER.info(String.format("Detected plugin %s [%s]", pluginTitle, pluginVersion.toString()));
            final Version pluginApiVersion = loader.getApiVersion();
            if (this.pluginApiValidator.isValid(pluginApiVersion)) {
                LOGGER.info(String.format("Plugin %s [%s] is valid for API", pluginTitle,
                        pluginVersion.toString()));
                final String[] classes = loader.extractPluginClassNames();
                for (final String klazzName : classes) {
                    LOGGER.info(String.format("Loading plugin class %s from %s", klazzName, pluginTitle));
                    final MindMapPlugin pluginInstance = (MindMapPlugin) loader.loadClass(klazzName)
                            .newInstance();
                    MindMapPluginRegistry.getInstance().registerPlugin(pluginInstance);
                }
            } else {
                LOGGER.warn(String.format("Plugin %s [%s] is not valid for API : %s", pluginTitle,
                        pluginVersion.toString(), pluginApiVersion.toString()));
            }
        } catch (Exception ex) {
            LOGGER.error("Can't load plugin from : " + plugin.getAbsolutePath(), ex);
        }
    }
}

From source file:org.mitre.openid.connect.service.impl.MITREidDataServiceSupport.java

protected String toUTCString(Date value) {
    if (value == null) {
        return null;
    }/*from  ww w . j  a va 2  s. c  om*/
    return dateFormatter.print(value, Locale.ENGLISH);
}

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

public void setOperator(String operator) throws ConfigurationException {
    EmailFilter.Operator op = EmailFilter.Operator.valueOf(operator.trim().toUpperCase(Locale.ENGLISH));
    filterRule.setOperator(op);/*w w  w  . ja  v a 2s.c o  m*/
}

From source file:Main.java

/**
 * gets a diff types of representation of the current time and
 * converts it into a proper form.//from   w  ww  .j a  va2  s  . c o  m
 *
 * @param diffInSeconds difference between current date and call date in seconds.
 * @param diffInMin     difference between current date and call date in minutes.
 * @param diffInHours   difference between current date and call date in hours.
 * @param callDate      the exact date time when call was made.
 * @return a string representation of the time.
 */
private static String getDifferenceString(long diffInSeconds, long diffInMin, long diffInHours, long callDate) {

    Log.v("Utility class", "counter: " + ++counter + "sec: " + diffInSeconds + "min: " + diffInMin + "hour: "
            + diffInHours + "call_date: " + callDate);

    //Getting the time in minuets and seconds since the time passed.
    if (diffInSeconds > 60)
        diffInSeconds = diffInSeconds % 60;
    if (diffInMin > 60)
        diffInMin = diffInMin % 60;

    //Formatting the string to be returned.
    if (diffInMin <= 5 && diffInHours == 0)
        return diffInMin + "m " + diffInSeconds + "s ago";
    else if (diffInMin > 5 && diffInHours == 0)
        return diffInMin + "m ago";
    else if (diffInHours <= 5)
        return diffInHours + "h " + diffInMin + "m ago";
    else if (diffInHours > 5 && diffInHours <= 24)
        return diffInHours + " hours ago";
    else if (diffInHours > 24 && diffInHours <= 168)
        return diffInHours / 24 + " days ago";
    else {
        Date calledDate = new Date(callDate);

        return new SimpleDateFormat("MMM d, EEE", Locale.ENGLISH).format(calledDate);
    }
}

From source file:ai.grakn.graql.internal.util.StringConverter.java

/**
 * @param value a value in the graph/*from   ww w  . java 2 s  . c  om*/
 * @return the string representation of the value (using quotes if it is already a string)
 */
public static String valueToString(Object value) {
    if (value instanceof String) {
        return quoteString((String) value);
    } else if (value instanceof Double) {
        DecimalFormat df = new DecimalFormat("#", DecimalFormatSymbols.getInstance(Locale.ENGLISH));
        df.setMinimumFractionDigits(1);
        df.setMaximumFractionDigits(12);
        df.setMinimumIntegerDigits(1);
        return df.format(value);
    } else {
        return value.toString();
    }
}

From source file:org.smigo.species.vernacular.VernacularHandler.java

public List<Vernacular> getVernacularsByLocale(Locale locale) {
    List<Vernacular> ret = vernacularDao.getVernacularsByLocale(locale);
    if (ret.isEmpty()) {
        return vernacularDao.getVernacularsByLocale(Locale.ENGLISH);
    }/*  www.  j  av  a  2 s.  c  om*/
    return ret;
}

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

@ExtDirectMethod(value = ExtDirectMethodType.STORE_MODIFY, entryClass = Row.class)
public List<RowInterface> create2(List<RowInterface> rows, HttpServletResponse response,
        final HttpServletRequest request, HttpSession session, Locale locale) {
    assertThat(response).isNotNull();/*from w  w w  .  j a va2  s. co m*/
    assertThat(request).isNotNull();
    assertThat(session).isNotNull();
    assertThat(locale).isEqualTo(Locale.ENGLISH);

    return rows;
}

From source file:com.marklogic.samplestack.testing.ContributorControllerTestImpl.java

/**
 * tests /contributors POST /contributors GET /docs GET
 *//*from  w w w. j  a  v  a  2  s.  c  o m*/
public void testContributorCRUD() throws Exception {
    login("joeUser@marklogic.com", "joesPassword");
    Contributor joeUser = Utils.getBasicUser();
    this.mockMvc.perform(
            post("/contributors").with(csrf()).session((MockHttpSession) session).locale(Locale.ENGLISH)
                    .contentType(MediaType.APPLICATION_JSON).content(mapper.writeValueAsString(joeUser)))
            .andExpect(status().isForbidden());

    login("maryAdmin@marklogic.com", "marysPassword");
    String returnedString = this.mockMvc
            .perform(post("/contributors").with(csrf()).session((MockHttpSession) session)
                    .locale(Locale.ENGLISH).contentType(MediaType.APPLICATION_JSON)
                    .content(mapper.writeValueAsString(joeUser)))
            .andExpect(status().isCreated()).andReturn().getResponse().getContentAsString();
    Contributor returnedUser = mapper.readValue(returnedString, Contributor.class);
    assertEquals("cgreer@marklogic.com", returnedUser.getUserName());

    String contributorsList = this.mockMvc
            .perform(get("/contributors?q=grechaw").session((MockHttpSession) session)).andReturn()
            .getResponse().getContentAsString();

    logger.info("contributors list" + contributorsList);
    assertTrue(contributorsList.contains("displayName"));

    Contributor getById = mapper
            .readValue(
                    this.mockMvc
                            .perform(get("/contributors/" + returnedUser.getId())
                                    .session((MockHttpSession) session).locale(Locale.ENGLISH))
                            .andExpect(status().isOk()).andReturn().getResponse().getContentAsString(),
                    Contributor.class);

    assertEquals("Id name matches when get By ID", getById.getId(), returnedUser.getId());
}