Added closer to centralize IOException handling/Java6 fix