当前位置 : 主页 > 编程语言 > c++ >

自定义ResourceBundle读取的文件路径

来源:互联网 收集:自由互联 发布时间:2021-06-30
gistfile1.txt private static ResourceBundle rb; private static BufferedInputStream inputStream; static { String proFilePath = System.getProperty("user.dir") +"\\config\\resourceBundle.properties"; try { inputStream = new BufferedInputStream
gistfile1.txt
private static ResourceBundle rb;  
    private static BufferedInputStream inputStream;  
    static {   
        String proFilePath = System.getProperty("user.dir") +"\\config\\resourceBundle.properties";  
        try {  
            inputStream = new BufferedInputStream(new FileInputStream(proFilePath));  
            rb = new PropertyResourceBundle(inputStream);  
            inputStream.close();  
        } catch (FileNotFoundException e) {  
            // TODO Auto-generated catch block  
            e.printStackTrace();  
        } catch (IOException e) {  
            // TODO Auto-generated catch block  
            e.printStackTrace();  
        }  
    }
网友评论