avoid printStackTrace

Don't call printStackTrace and litter the user's output with stack traces. This change will propagate the IOException so the user can properly log or otherwise deal with the failure.

Note, this change uses try with resources added in java 7. Is java 6 compatibility a requirement?