Example usage for java.util ResourceBundle getBundle

List of usage examples for java.util ResourceBundle getBundle

Introduction

In this page you can find the example usage for java.util ResourceBundle getBundle.

Prototype

@CallerSensitive
public static final ResourceBundle getBundle(String baseName) 

Source Link

Document

Gets a resource bundle using the specified base name, the default locale, and the caller module.

Usage

From source file:com.google.jstestdriver.idea.ui.MainUI.java

public static void main(String[] args) {
    CmdFlags preparsedFlags = new CmdLineFlagsFactory().create(args);
    configureLogging();/*from ww  w .  ja v a  2  s  .c  o m*/
    ResourceBundle bundle = ResourceBundle.getBundle("com.google.jstestdriver.ui.messages");
    new MainUI(preparsedFlags, bundle).startUI();
}

From source file:JAXRPublishPostal.java

public static void main(String[] args) {
        ResourceBundle bundle = ResourceBundle.getBundle("JAXRExamples");

        String queryURL = bundle.getString("query.url");
        String publishURL = bundle.getString("publish.url");

        String username = bundle.getString("registry.username");
        String password = bundle.getString("registry.password");

        if (args.length < 1) {
            System.out.println("Argument required: " + "-Duuid-string=<value>");
            System.exit(1);//from w  w w .  j  a  v a2  s  .com
        }

        String uuidString = args[0];
        System.out.println("UUID string is " + uuidString);

        JAXRPublishPostal jp = new JAXRPublishPostal();

        jp.makeConnection(queryURL, publishURL, uuidString);

        jp.executePublish(username, password);
    }

From source file:JAXRPublishHelloOrg.java

public static void main(String[] args) {
        ResourceBundle bundle = ResourceBundle.getBundle("JAXRExamples");

        String queryURL = bundle.getString("query.url");
        String publishURL = bundle.getString("publish.url");

        String username = bundle.getString("registry.username");
        String password = bundle.getString("registry.password");

        if (args.length < 1) {
            System.out.println("Argument required: " + "-Duuid-string=<value>");
            System.exit(1);/*from ww w  . java2 s.c  om*/
        }

        String uuidString = args[0];
        System.out.println("UUID string is " + uuidString);

        JAXRPublishHelloOrg jpws = new JAXRPublishHelloOrg();

        jpws.makeConnection(queryURL, publishURL);

        jpws.executePublish(uuidString, username, password);
    }

From source file:com.google.gdocsfs.GoogleDocsFS.java

public static void main(String[] args) {
    ResourceBundle properties = ResourceBundle.getBundle("gdocsfs");

    String username = properties.getString("username");
    String password = properties.getString("password");
    if (password == null || password.trim().length() == 0) {
        //         char[] pass = System.console().readPassword("Google account password(%s): ", username);
        //         password = new String(pass);
        throw new UnsupportedOperationException();
    }//w  w  w. j  a v  a 2 s.c om

    String mountPoint = args[0];
    String[] fuseArgs = new String[] { "-f", "-s", "-ofsname=gdocsfs", "-ouse_ino", mountPoint };
    GoogleDocs googleDocs;
    try {
        googleDocs = new GoogleDocs(username, password);
        GoogleDocsFS gdocsfs = new GoogleDocsFS(googleDocs);
        FuseMount.mount(fuseArgs, gdocsfs, log);

    } catch (AuthenticationException e) {
        error(1, e, "Unable to connect. Ckeck your username and/or password.");

    } catch (ServiceException e) {
        error(2, e, "Ckeck your Internet connection: " + e.getMessage());

    } catch (IOException e) {
        error(3, e, "Ckeck your Internet connection: " + e.getMessage());

    } catch (Exception e) {
        error(4, e, "Unable to mount at " + mountPoint, "Error: " + e.getMessage());
    }
}

From source file:Main.java

public static ResourceBundle getResourceBundle() {
    if (resourceBundle == null) {
        resourceBundle = ResourceBundle.getBundle(CONF_PATH);
    }/* w ww .  j a  v  a2  s.  co  m*/
    return resourceBundle;
}

From source file:com.nineteendrops.tracdrops.client.core.MessageUtils.java

private static ResourceBundle getBundle() {
    return ResourceBundle.getBundle("TRACdropsMessage");
}

From source file:org.guanxi.idp.IdPTest.java

@BeforeClass
public static void initIdPTest() {
    idpProperties = ResourceBundle.getBundle("test");
    servletContext = new MockServletContext(Paths.path("servlet.context.home"));

    principal = new GuanxiPrincipal();
    principal.setName(TEST_USER_NAME);/* www .ja va2  s.c  om*/
    principal.getPrivateProfileData().put("username", TEST_USER_NAME);
    principal.setUniqueId(Utils.getUniqueID());
}

From source file:com.aprodher.actions.util.EmailUtils.java

public static void enviaEmail(Mensaje mensagem) throws EmailException {
    Email email = new SimpleEmail();
    email = conectaEmail();//  ww w .j av  a 2s. c  om
    email.setSubject(mensagem.getTitulo());
    email.setMsg(mensagem.getMensagem());
    email.addTo(mensagem.getDestino());
    String resposta = email.send();
    JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("emailenviado") + resposta);
}

From source file:Main.java

/**
 * Gets a resource string from the resource bundle.<p> Resource bundle
 * represents the <i>property file</i>. For example, if property file
 * contains something like this:<BR><CENTER>menubar=file edit help</CENTER>
 * method call getLanguageDependentString("menubar") will give the string
 * <i>file edit help</i> as a result. <BR> This method reads information
 * from property file. If can't find desired resource, returns <b>null</b>.
 * @param nm name of the resource to fetch.
 * @return String value of named resource.
 *///from  w  w  w .  j av a2s.c o m
public static String getLanguageDependentString(String nm) {
    String str;
    try {
        str = choosenResources.getString(nm);
    } catch (MissingResourceException mre) {
        try {
            str = defaultResources.getString(nm);
        } catch (MissingResourceException mre1) {
            str = null;
        } catch (NullPointerException npe) {
            str = null;
        }
    } catch (NullPointerException npe) {
        /*ResourceBundle orig=ResourceBundle.
         getBundle("org.enhydra.shark.xpdl.resources.SharkXPDL",new Locale(""));*/
        ResourceBundle orig = ResourceBundle.getBundle("org.enhydra.shark.xpdl.resources.SharkXPDL");
        try {
            str = orig.getString(nm);
        } catch (Exception ex) {
            str = null;
        }
    }
    return str;
}

From source file:org.pidpys.standalone.configuration.LocalizationConfiguration.java

@Bean
public ResourceBundle localization() {
    return ResourceBundle.getBundle("org.pidpys.standalone.localization.application");
}