+1 for Java 7 resource management. I've used commons-io IOUtils for that functionality in other products. I'll consider it here if it means not adding another dependency.