Apply try-with-resource in loading resources

I apply try-with-source in loading files.  Any comments on this change would be appreciate it.