在目前擺脫檢查異常的,我用的是下面的代碼與番石榴API的幫助下從類路徑加載一個屬性文件: final URL fileURL = Resources.getResource("res.properties");
final File file = new File(fileURL.getFile());
我決定給一個嘗試新NIO2 API中Java7SE引入和除去任何番石榴API調用,所以我
假設下面的代碼: public static void somMethod() throws IOException {
try {
// some code that can throw an IOException and no other checked exceptions
} catch (IOException e) {
// some stuff here