Example usage for java.util Locale FRANCE

List of usage examples for java.util Locale FRANCE

Introduction

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

Prototype

Locale FRANCE

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

Click Source Link

Document

Useful constant for country.

Usage

From source file:org.kopi.ebics.test.UserIntiator.java

public static void main(String[] args) throws Exception {
    String hostId = "";
    String partnerId = "";
    String userId = "";

    CommandLineParser parser = new BasicParser();
    Options options = new Options();
    options.addOption("h", "host", true, "EBICS Host ID");
    options.addOption("p", "partner", true, "Registred Partner ID for you user");
    options.addOption("u", "user", true, "User ID to initiate");

    // Parse the program arguments
    CommandLine commandLine = parser.parse(options, args);

    if (!commandLine.hasOption('h')) {
        System.out.println("Host-ID is mandatory");
        System.exit(0);//from ww w.  j  a v a  2s.  c o  m
    } else {
        hostId = commandLine.getOptionValue('h');
        System.out.println("host: " + hostId);
    }

    if (!commandLine.hasOption('p')) {
        System.out.println("Partner-ID is mandatory");
        System.exit(0);
    } else {
        partnerId = commandLine.getOptionValue('p');
        System.out.println("partnerId: " + partnerId);
    }

    if (!commandLine.hasOption('u')) {
        System.out.println("User-ID is mandatory");
        System.exit(0);
    } else {
        userId = commandLine.getOptionValue('u');
        System.out.println("userId: " + userId);
    }

    UserIntiator userIntiator;
    PasswordCallback pwdHandler;
    Product product;

    userIntiator = new UserIntiator();
    product = new Product("kopiLeft Dev 1.0", Locale.FRANCE, null);
    pwdHandler = new UserPasswordHandler(userId, "2012");

    // Load alredy created user
    userIntiator.loadUser(hostId, partnerId, userId, pwdHandler);

    // INIT Request
    userIntiator.sendINIRequest(userId, product);
    // HIA Request
    userIntiator.sendHIARequest(userId, product);

}

From source file:Main.java

public static String getHour(long milliSeconds) {

    SimpleDateFormat formatter = new SimpleDateFormat("kk:mm", Locale.FRANCE);
    Calendar calendar = Calendar.getInstance();
    calendar.setTimeInMillis(milliSeconds);
    return formatter.format(calendar.getTime());
}

From source file:Main.java

public static int getNumberOfWeeksInMonth(int year, int month) {
    Calendar calendar = Calendar.getInstance(Locale.FRANCE);
    calendar.set(year, month, 1, 0, 0, 0);
    calendar.set(Calendar.MILLISECOND, 0);
    return calendar.getActualMaximum(Calendar.WEEK_OF_MONTH);
}

From source file:Main.java

public static String getDate(long milliSeconds) {

    SimpleDateFormat formatter = new SimpleDateFormat("EEEE dd MMMM yyyy", Locale.FRANCE);
    Calendar calendar = Calendar.getInstance();
    calendar.setTimeInMillis(milliSeconds);
    return formatter.format(calendar.getTime());
}

From source file:Main.java

public static String formatExpireDate(Date expireDate) {
    SimpleDateFormat format = new SimpleDateFormat("MM/yyyy", Locale.FRANCE);
    return format.format(expireDate);
}

From source file:Main.java

public static String getTOSLink() {
    String link = "http://m.google.com/toscountry"; // default

    String locale = Locale.getDefault().toString();
    if (locale.equals(Locale.US.toString())) {
        link = "http://m.google.com/tospage";
    } else if (locale.equals(Locale.UK.toString())) {
        link = "http://m.google.co.uk/tospage";
    } else if (locale.equals(Locale.CANADA.toString())) {
        link = "http://m.google.ca/tospage";
    } else if (locale.equals(Locale.CANADA_FRENCH.toString())) {
        link = "http://m.google.ca/tospage?hl=fr";
    } else if (locale.equals(Locale.FRANCE.toString())) {
        link = "http://m.google.fr/tospage";
    }/*from w  ww .j a va 2 s .c om*/
    return link;
}

From source file:Main.java

public static final String dateToString(Date paramDate, String paramString) {
    SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat(paramString, Locale.FRANCE);
    localSimpleDateFormat.setTimeZone(TimeZone.getTimeZone("Europe/Paris"));
    return localSimpleDateFormat.format(paramDate);
}

From source file:Main.java

public Main() {
    this.setLayout(null);
    jlabel4.setBounds(0, 0, 100, 30);/*  w  w w.  ja  v  a 2s. c o m*/
    this.add(jlabel4);
    this.pack();
    t = new Timer(1000, new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            jlabel4.setText(new SimpleDateFormat("HH:mm:ss", Locale.FRANCE).format(new Date()));
        }
    });
    t.start();
    setSize(new Dimension(200, 60));
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
}

From source file:org.silverpeas.util.MemoryDataTest.java

@BeforeClass
public static void forceDefaultLocale() {
    currentLocale = Locale.getDefault();
    currentLanguage = I18NHelper.defaultLanguage;
    Locale.setDefault(Locale.FRANCE);
    I18NHelper.defaultLanguage = Locale.getDefault().getLanguage();
}

From source file:org.openhie.openempi.util.DateConverterTest.java

public void testInternationalization() throws Exception {
    List<Locale> locales = new ArrayList<Locale>() {
        private static final long serialVersionUID = 1L;
        {/*from w  w w .j  a  v a2  s .c  om*/
            add(Locale.US);
            add(Locale.GERMANY);
            add(Locale.FRANCE);
            add(Locale.CHINA);
            add(Locale.ITALY);
        }
    };

    for (Locale locale : locales) {
        LocaleContextHolder.setLocale(locale);
        testConvertStringToDate();
        testConvertDateToString();
        testConvertStringToTimestamp();
        testConvertTimestampToString();
    }
}