Use Java 7 try-with-resources feature