import java.util.*;
import java.io.*;
import com.sun.org.apache.commons.beanutils.PropertyUtils;
/**
*
* <p>类名:MyPropertiesReader.java</p>
* <p>描述:</p>
*
* @version: 1.0
* @date: Jan 9, 2008
*/
public class MyPropertiesReader {
/**
*
* @param fileName
* @return 根据properties文件中的标识返回对应的国际化文字
*/
public String getPara(String fileName) { //国际化文件名称
Properties prop = new Properties();
try {
InputStream is = getClass().getClassLoader().getResourceAsStream(fileName);
prop.load(is);
if (is != null)
is.close();
} catch (Exception e) {
System.out.println(e + "file " + fileName + " not found");
}
return prop.getProperty("samples.menucontrol");//国际化文件中的标识
}
public static void main(String[] args) {
MyPropertiesReader test = new MyPropertiesReader();
System.out.println(test.getPara("ApplicationResources_zh_samples.properties"));
}
}