Code example for PropertyResourceBundle

Methods: getString

0
	 * @return int 
	 */ 
	public static int getPageNum(String key) throws SysException {
		InputStream is = PagUtil.class.getResourceAsStream("/page.properties");
		try { 
			PropertyResourceBundle prb = new PropertyResourceBundle(is);
			String str = prb.getString(key);
			if (str != null) {
				Integer it = new Integer(str);
				return it.intValue();
			} else 
				// if not config ,return default value. 
				return PAGE_NUM;
 
		} catch (IOException ex) {
			throw new SysException("", "", ex);
		} 
 
	} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE