Using java 7 new feature to close resources.