Code example for PropertyResourceBundle

Methods: getString

0
    public ResourceBundleWebServerConfig() throws IOException {
 
        File file = new File(System.getProperty("basedir"), "ResourceBundleWebServerConfig.properties");
        // how do you get this working in intellij, maven and eclipse ? 
        if (file.exists()) {
            ResourceBundle bundle = new PropertyResourceBundle(new FileInputStream(file));
            host = bundle.getString("host");
            port = Integer.parseInt(bundle.getString("port"));
        } 
    } 
 
    public String getHost() {
        return host;
    } 
 
    public int getPort() { 
        return port;
    } 
 
}