}
if (!FEEDURL_FILE.exists()) {
InputStream resource = null;
- resource = ClassLoader.getSystemResourceAsStream("resources/" + FEEDURL_NAME);
- createNewFeedFile(resource, FEEDURL_FILE);
- result = true;
- log.info("FEED URLファイルを作成しました: " + FEEDURL_FILE.getCanonicalPath());
+ try {
+ resource = ClassLoader.getSystemResourceAsStream("resources/" + FEEDURL_NAME);
+ createNewFeedFile(resource, FEEDURL_FILE);
+ result = true;
+ log.info("FEED URLファイルを作成しました: " + FEEDURL_FILE.getCanonicalPath());
+ } finally {
+ if (resource != null) {
+ resource.close();
+ }
+ }
}
return result;
}