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:de.hybris.platform.b2b.services.impl.B2BOrderAprovalProcessIntegrationTest.java

@Before
public void before() throws Exception {
    B2BIntegrationTest.loadTestData();//from  w  ww  . j a v  a2 s . co  m
    importCsv("/b2bapprovalprocess/test/organizationdata.csv", "UTF-8");
    sessionService.getCurrentSession().setAttribute("user",
            this.modelService.<Object>toPersistenceLayer(userService.getAdminUser()));
    i18nService.setCurrentLocale(Locale.ENGLISH);
    commonI18NService.setCurrentLanguage(commonI18NService.getLanguage("en"));
    commonI18NService.setCurrentCurrency(commonI18NService.getCurrency("USD"));
}

From source file:com.google.gdt.eclipse.designer.support.http.HttpRequest.java

/**
 * Parses request from browser.//from ww  w .j av a2  s  .c  om
 * 
 * @param requestLine
 */
private int parseRequest(String requestLine) {
    // parse the line into components, check if there are enough components
    String[] items = StringUtils.split(requestLine, " ");
    if (items.length < 2) {
        return HTTP_BAD_REQUEST;
    }
    if (!items[0].toUpperCase(Locale.ENGLISH).equals("GET")) {
        return HTTP_BAD_METHOD;
    }
    m_url = items[1];
    return HTTP_OK;
}

From source file:com.nesscomputing.lifecycle.LifecycleStage.java

/**
 * Creates a new LifecycleStage.//from   w  ww. j  a v  a 2 s.co m
 * @param name Name of the stage. Must not be null.
 */
public LifecycleStage(@Nonnull final String name) {
    this.name = name.toLowerCase(Locale.ENGLISH);
}

From source file:com.mycompany.allasync.NHttpRequestHandler.java

private void handleInternal(final HttpRequest request, final HttpResponse response, final HttpContext context)
        throws HttpException, IOException {

    String method = request.getRequestLine().getMethod().toUpperCase(Locale.ENGLISH);
    if (!method.equals("GET") && !method.equals("HEAD") && !method.equals("POST")) {
        throw new MethodNotSupportedException(method + " method not supported");
    }/*from   w  w  w  .  j  a  va2  s  .c  o  m*/

    String target = request.getRequestLine().getUri();
    final File file = new File(this.docRoot, URLDecoder.decode(target, "UTF-8"));
    if (!file.exists()) {

        response.setStatusCode(HttpStatus.SC_NOT_FOUND);
        NStringEntity entity = new NStringEntity(
                "<html><body><h1>File" + file.getPath() + " not found</h1></body></html>",
                ContentType.create("text/html", "UTF-8"));
        response.setEntity(entity);
        System.out.println("File " + file.getPath() + " not found");

    } else if (!file.canRead() || file.isDirectory()) {

        response.setStatusCode(HttpStatus.SC_FORBIDDEN);
        NStringEntity entity = new NStringEntity("<html><body><h1>Access denied</h1></body></html>",
                ContentType.create("text/html", "UTF-8"));
        response.setEntity(entity);
        System.out.println("Cannot read file " + file.getPath());

    } else {
        NHttpConnection conn = (NHttpConnection) context.getAttribute(ExecutionContext.HTTP_CONNECTION);
        response.setStatusCode(HttpStatus.SC_OK);
        NFileEntity body = new NFileEntity(file, ContentType.create("text/html"));
        response.setEntity(body);
        System.out.println(conn + ": serving file " + file.getPath());
    }
}

From source file:de.hybris.platform.b2b.services.impl.DefaultB2BOrderServiceTest.java

@Before
public void before() throws Exception {
    B2BIntegrationTest.loadTestData();//from www  .j  av a 2s .  com
    importCsv("/b2bapprovalprocess/test/b2borganizations.csv", "UTF-8");

    sessionService.getCurrentSession().setAttribute("user",
            this.modelService.<Object>toPersistenceLayer(userService.getAdminUser()));
    i18nService.setCurrentLocale(Locale.ENGLISH);
    commonI18NService.setCurrentLanguage(commonI18NService.getLanguage("en"));
    commonI18NService.setCurrentCurrency(commonI18NService.getCurrency("USD"));
}

From source file:net.sf.dynamicreports.test.jasper.chart.AreaChartTest.java

@Override
protected void configureReport(JasperReportBuilder rb) {
    TextColumnBuilder<String> column1;
    TextColumnBuilder<Integer> column2;

    Locale.setDefault(Locale.ENGLISH);

    rb.columns(column1 = col.column("Column1", "field1", String.class),
            column2 = col.column("Column2", "field2", Integer.class))
            .summary(cht.areaChart().setCategory(column1).series(cht.serie(column2))
                    .setCategoryAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE)
                            .setLabelFont(stl.fontArialBold()).setTickLabelFont(stl.fontArial().setItalic(true))
                            .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d)
                            .setLineColor(Color.LIGHT_GRAY)),
                    cht.areaChart().setCategory(column1).series(cht.serie(column2))
                            .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE)
                                    .setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00")
                                    .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1)
                                    .setRangeMaxValueExpression(15)));
}

From source file:de.tudarmstadt.ukp.experiments.argumentation.convincingness.sampling.Step7bConvArgRankProducer.java

@SuppressWarnings("unchecked")
public static void prepareData(String[] args) throws Exception {
    String inputDir = args[0];//from   w  ww . ja v a 2  s .  c  o m
    File outputDir = new File(args[1]);

    if (!outputDir.exists()) {
        outputDir.mkdirs();
    }

    List<File> files = IOHelper.listXmlFiles(new File(inputDir));

    // take only the gold data for this task
    String prefix = "all_DescendingScoreArgumentPairListSorter";
    Iterator<File> iterator = files.iterator();
    while (iterator.hasNext()) {
        File file = iterator.next();

        if (!file.getName().startsWith(prefix)) {
            iterator.remove();
        }
    }

    int totalArgumentsCounter = 0;

    DescriptiveStatistics statsPerTopic = new DescriptiveStatistics();

    for (File file : files) {
        List<AnnotatedArgumentPair> argumentPairs = (List<AnnotatedArgumentPair>) XStreamTools.getXStream()
                .fromXML(file);

        String name = file.getName().replaceAll(prefix, "").replaceAll("\\.xml", "");

        PrintWriter pw = new PrintWriter(new File(outputDir, name + ".csv"), "utf-8");
        pw.println("#id\trank\targument");

        Graph graph = buildGraphFromPairs(argumentPairs);

        Map<String, Argument> arguments = collectArguments(argumentPairs);

        int argumentsPerTopicCounter = arguments.size();

        PageRank pageRank = new PageRank();
        pageRank.setVerbose(true);
        pageRank.init(graph);

        for (Node node : graph) {
            String id = node.getId();
            double rank = pageRank.getRank(node);

            System.out.println(id);

            Argument argument = arguments.get(id);

            String text = Step7aLearningDataProducer.multipleParagraphsToSingleLine(argument.getText());

            pw.printf(Locale.ENGLISH, "%s\t%.5f\t%s%n", argument.getId(), rank, text);
        }

        totalArgumentsCounter += argumentsPerTopicCounter;
        statsPerTopic.addValue(argumentsPerTopicCounter);

        pw.close();
    }

    System.out.println("Total gold arguments: " + totalArgumentsCounter);
    System.out.println(statsPerTopic);
}

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

public String getOperator() {
    return filterRule.getOperator().toString().toLowerCase(Locale.ENGLISH);
}

From source file:net.sf.dynamicreports.test.jasper.chart.BarChartTest.java

@Override
protected void configureReport(JasperReportBuilder rb) {
    TextColumnBuilder<String> column1;
    TextColumnBuilder<Integer> column2;

    Locale.setDefault(Locale.ENGLISH);

    rb.columns(column1 = col.column("Column1", "field1", String.class),
            column2 = col.column("Column2", "field2", Integer.class))
            .summary(//from w w w  . j a  v  a2s .  c  o m
                    cht.barChart().setCategory(column1).series(cht.serie(column2)).setShowLabels(true)
                            .setShowTickLabels(false).setShowTickMarks(false),
                    cht.barChart().setCategory(column1).series(cht.serie(column2))
                            .setCategoryAxisFormat(cht.axisFormat().setLabel("category")
                                    .setLabelColor(Color.BLUE).setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d)
                                    .setLineColor(Color.LIGHT_GRAY)),
                    cht.barChart().setCategory(column1).series(cht.serie(column2))
                            .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE)
                                    .setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00")
                                    .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1)
                                    .setRangeMaxValueExpression(15)));
}

From source file:net.sf.dynamicreports.test.jasper.chart.StackedAreaChartTest.java

@Override
protected void configureReport(JasperReportBuilder rb) {
    TextColumnBuilder<String> column1;
    TextColumnBuilder<Integer> column2;

    Locale.setDefault(Locale.ENGLISH);

    rb.columns(column1 = col.column("Column1", "field1", String.class),
            column2 = col.column("Column2", "field2", Integer.class))
            .summary(cht.stackedAreaChart().setCategory(column1).series(cht.serie(column2))
                    .setCategoryAxisFormat(cht.axisFormat().setLabel("category").setLabelColor(Color.BLUE)
                            .setLabelFont(stl.fontArialBold()).setTickLabelFont(stl.fontArial().setItalic(true))
                            .setTickLabelColor(Color.CYAN).setTickLabelRotation(45d)
                            .setLineColor(Color.LIGHT_GRAY)),
                    cht.stackedAreaChart().setCategory(column1).series(cht.serie(column2))
                            .setValueAxisFormat(cht.axisFormat().setLabel("value").setLabelColor(Color.BLUE)
                                    .setLabelFont(stl.fontArialBold())
                                    .setTickLabelFont(stl.fontArial().setItalic(true))
                                    .setTickLabelColor(Color.CYAN).setTickLabelMask("#,##0.00")
                                    .setLineColor(Color.LIGHT_GRAY).setRangeMinValueExpression(1)
                                    .setRangeMaxValueExpression(15)));
}