Code example for PropertyResourceBundle

0
	private I18n getI18n(String filePrefix, String language) throws IOException, FileNotFoundException {
		 
		String i18nFileName = filePrefix + language + ".properties";
    	URL resource = getClass().getResource( "/" + i18nFileName );
    	File file = new File (resource.getFile());
    	I18n i18n = new I18n(new PropertyResourceBundle(new InputStreamReader(new FileInputStream(file), "UTF-8")));
    	 
    	return i18n;
	} 
     
     
    public int getError(){ 
    	return 1 / 0; 
    } 
     
    public String treatError1(){
    	return "You are in treatError1!"; 
    } 
     
    public String treatError2(){
Experience pair programming with AI  Get Codota for Java