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:eu.trentorise.smartcampus.ac.provider.managers.SocialEngineManager.java

public static void main(String[] args) throws SocialEngineException {
    SocialEngineManager mgr = new SocialEngineManager();
    mgr.client = SCWebApiClient.getInstance(Locale.ENGLISH, "sweb.smartcampuslab.it", 8080);
    eu.trentorise.smartcampus.ac.provider.model.User u = new eu.trentorise.smartcampus.ac.provider.model.User();
    u.setId(100L);/*from www. jav  a  2  s.c o  m*/
    mgr.createUser(u);

}

From source file:eu.trentorise.smartcampus.commons.test.TestSemanticHelper.java

public static void main(String[] args) throws Exception {
    client = SCWebApiClient.getInstance(Locale.ENGLISH, SE_HOST, SE_PORT);
    Entity entity = client.readEntity(3121L, null);
    System.err.println(entity);//from  w w w .  j a  v  a 2  s.c  o m

    //      System.err.println(SemanticHelper.isEntitySharedWithUser(client, 6627L, 103L));

    //      Entity e = SemanticHelper.createEntity(client, 396L, "event", "test evento Universit degli ", null, null, null);
    //      System.err.println(client.readEntity(e.getId(), null));
    //      client.deleteEntity(e.getId());

    readNews(396L);

    //      testReadingSharedContent(396L, 0, 100, null); 

    //      User u = client.readUser(321);
    //      System.err.println(u.getId());
    //      Community community = client
    //            .readCommunity(Constants.SMARTCAMPUS_COMMUNITY);
    //
    //      EntityBase eb = SemanticHelper.getSCCommunityEntityBase(client);
    //      System.err.println(client.readEntity(6483L, null));
    //      LiveTopicSource assignments = client.readAssignments(6483L,
    //            Operation.READ, community.getId());
    //      System.err.println(assignments.isAllUsers()); 

    //      Entity e = SemanticHelper.createSCEntity(client, "event", "Mensa via Zanella", "Posti liberi al 2012_08_16 05.45.00 : 526", null, null);
    //      System.err.println(e);
    //      
    //      List<Entity> list = client.readEntities("event", eb.getLabel(), null);
    //      for (Entity e : list) {
    //         System.err.println(e);
    //         ShareVisibility v = new ShareVisibility();
    //         v.setAllUsers(true);
    //         SemanticHelper.shareEntity(client, e.getId(), 124L, v);
    ////         client.deleteEntity(e.getId());
    //      }
    //      list = client.readEntities("location", eb.getLabel(), null);
    //      for (Entity e : list) {
    //         System.err.println(e);
    //         ShareVisibility v = new ShareVisibility();
    //         v.setAllUsers(true);
    //         SemanticHelper.shareEntity(client, e.getId(), 124L, v);
    ////         client.deleteEntity(e.getId());
    //      }
    //      System.err.println(client.readEntityBases());
    //      System.err.println(client.readCommunities());
}

From source file:de.mendelson.comm.as2.AS2.java

/**Method to start the server on from the command line*/
public static void main(String args[]) {

    // TODO remove
    cleanup();/*from w  ww .j av a2 s . c o  m*/

    String language = null;
    boolean startHTTP = true;
    boolean allowAllClients = false;
    int optind;
    for (optind = 0; optind < args.length; optind++) {
        if (args[optind].toLowerCase().equals("-lang")) {
            language = args[++optind];
        } else if (args[optind].toLowerCase().equals("-nohttpserver")) {
            startHTTP = false;
        } else if (args[optind].toLowerCase().equals("-allowallclients")) {
            allowAllClients = true;
        } else if (args[optind].toLowerCase().equals("-?")) {
            AS2.printUsage();
            System.exit(1);
        } else if (args[optind].toLowerCase().equals("-h")) {
            AS2.printUsage();
            System.exit(1);
        } else if (args[optind].toLowerCase().equals("-help")) {
            AS2.printUsage();
            System.exit(1);
        }
    }
    //load language from preferences
    if (language == null) {
        PreferencesAS2 preferences = new PreferencesAS2();
        language = preferences.get(PreferencesAS2.LANGUAGE);
    }
    if (language != null) {
        if (language.toLowerCase().equals("en")) {
            Locale.setDefault(Locale.ENGLISH);
        } else if (language.toLowerCase().equals("de")) {
            Locale.setDefault(Locale.GERMAN);
        } else if (language.toLowerCase().equals("fr")) {
            Locale.setDefault(Locale.FRENCH);
        } else {
            AS2.printUsage();
            System.out.println();
            System.out.println("Language " + language + " is not supported.");
            System.exit(1);
        }
    }
    Splash splash = new Splash("/de/mendelson/comm/as2/client/Splash.jpg");
    AffineTransform transform = new AffineTransform();
    splash.setTextAntiAliasing(false);
    transform.setToScale(1.0, 1.0);
    splash.addDisplayString(new Font("Verdana", Font.BOLD, 11), 7, 262, AS2ServerVersion.getFullProductName(),
            new Color(0x65, 0xB1, 0x80), transform);
    splash.setVisible(true);
    splash.toFront();
    //start server
    try {
        //register the database drivers for the VM
        Class.forName("org.hsqldb.jdbcDriver");
        //initialize the security provider
        BCCryptoHelper helper = new BCCryptoHelper();
        helper.initialize();
        AS2Server as2Server = new AS2Server(startHTTP, allowAllClients);
        AS2Agent agent = new AS2Agent(as2Server);
    } catch (UpgradeRequiredException e) {
        //an upgrade to HSQLDB 2.x is required, delete the lock file
        Logger.getLogger(AS2Server.SERVER_LOGGER_NAME).warning(e.getMessage());
        JOptionPane.showMessageDialog(null, e.getClass().getName() + ": " + e.getMessage());
        AS2Server.deleteLockFile();
        System.exit(1);
    } catch (Throwable e) {
        if (splash != null) {
            splash.destroy();
        }
        JOptionPane.showMessageDialog(null, e.getMessage());
        System.exit(1);
    }
    //start client
    AS2Gui gui = new AS2Gui(splash, "localhost");
    gui.setVisible(true);
    splash.destroy();
    splash.dispose();
}

From source file:velocitekProStartAnalyzer.MainWindow.java

/**
 * Launch the application./*  w w w .  ja v  a 2s  . c o m*/
 */
public static void main(String[] args) {
    Locale.setDefault(Locale.ENGLISH);
    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            try {
                MainWindow window = new MainWindow();
                window.frame.setVisible(true);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            setStartFinishMapMarkers();
        }
    });
    SwingUtilities.invokeLater(new Runnable() {

        @Override
        public void run() {
            defaultSize();

        }
    });
}

From source file:com.traffic.common.utils.http.HttpClientUtils.java

public static void main(String[] args) {
    //cst??GMT?// w  w w  . j  a va 2  s . co m
    DateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);
    format.setTimeZone(TimeZone.getTimeZone("GMT"));
    String date = format.format(new Date());

    String s = "license_plate_num=%E7%B2%A4BA804D&engine_num=C32764&body_num=064484&city_pinyin=shenzhen";
    //??
    String SIGNATURE = MD5Encrypt.encrypt("POST&/v3/violations&" + date + "&" + s.length() + "&"
            + MD5Encrypt.encrypt("uTIYrJn6vJTyt1ztBNbqQQDexDjpAM4m"));
    //
    headers.put("Host", "api.buding.cn");
    headers.put("Authorization", "dLSQ1ZjK7exqlwqx:" + SIGNATURE);
    headers.put("Date", date);

    JSONObject reqParam = new JSONObject();
    reqParam.put("license_plate_num", "BA804D");
    reqParam.put("engine_num", "C32764");
    reqParam.put("body_num", "064484");
    reqParam.put("city_pinyin", "shenzhen");
    String respBody = HttpClientUtils.httpPost_JSONObject("http://api.buding.cn/v3/violations", reqParam);
    System.out.println(JSONObject.parse(respBody));
}

From source file:edu.ku.brc.specify.config.init.SpecifyDBSetupWizardFrame.java

/**
 * @param args/*w w w.  j  a va 2  s.co  m*/
 */
public static void main(String[] args) {
    // Set App Name, MUST be done very first thing!
    UIRegistry.setAppName("Specify"); //$NON-NLS-1$

    try {
        ResourceBundle.getBundle("resources", Locale.getDefault()); //$NON-NLS-1$

    } catch (MissingResourceException ex) {
        Locale.setDefault(Locale.ENGLISH);
        UIRegistry.setResourceLocale(Locale.ENGLISH);
    }

    try {
        if (!System.getProperty("os.name").equals("Mac OS X")) {
            UIManager.setLookAndFeel(new Plastic3DLookAndFeel());
            PlasticLookAndFeel.setPlasticTheme(new DesertBlue());
        }
    } catch (Exception e) {
        edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
        edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(SpecifyDBSetupWizard.class, e);
        e.printStackTrace();
    }

    AppBase.processArgs(args);
    AppBase.setupTeeForStdErrStdOut(true, false);

    System.setProperty("appdatadir", "..");

    // Then set this
    IconManager.setApplicationClass(Specify.class);
    IconManager.loadIcons(XMLHelper.getConfigDir("icons_datamodel.xml")); //$NON-NLS-1$
    IconManager.loadIcons(XMLHelper.getConfigDir("icons_plugins.xml")); //$NON-NLS-1$
    IconManager.loadIcons(XMLHelper.getConfigDir("icons_disciplines.xml")); //$NON-NLS-1$

    // Load Local Prefs
    AppPreferences localPrefs = AppPreferences.getLocalPrefs();
    //try {
    //System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> "+(new File(UIRegistry.getAppDataDir()).getCanonicalPath())+"]");
    //} catch (IOException ex) {}

    localPrefs.setDirPath(UIRegistry.getAppDataDir());

    // Check to see if we should check for a new version
    if (localPrefs.getBoolean(VERSION_CHECK, null) == null) {
        localPrefs.putBoolean(VERSION_CHECK, true);
    }

    if (localPrefs.getBoolean(EXTRA_CHECK, null) == null) {
        localPrefs.putBoolean(EXTRA_CHECK, true);
    }

    if (UIHelper.isLinux()) {
        Specify.checkForSpecifyAppsRunning();
    }

    if (UIRegistry.isEmbedded()) {
        ProcessListUtil.checkForMySQLProcesses(new ProcessListener() {
            @Override
            public void done(PROC_STATUS status) // called on the UI thread
            {
                if (status == PROC_STATUS.eOK || status == PROC_STATUS.eFoundAndKilled) {
                    startupContinuing();
                }
            }
        });
    } else {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                startupContinuing();
            }
        });
    }
}

From source file:Main.java

public static Locale getLocale() {
    return Locale.ENGLISH;
}

From source file:Main.java

private static String getReadMethod(String name) {
    return "get" + name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1);
}

From source file:Main.java

public static boolean isEnglishLocale(Locale locale) {
    return locale.equals(Locale.ENGLISH);
}

From source file:Main.java

private static Locale getHindiLocale(Locale[] locale) {
    Locale defaultLocale = Locale.ENGLISH;
    for (int i = 0; i < locale.length; i++) {
        if (locale[i].getLanguage().equals("hi")) {
            return locale[i];
        }// w  w w.  j av  a 2  s  .  c om
    }
    return defaultLocale;
}