Remove unnecessary setting to null
Print StackTrace instead of the exception's toString()
Catch IOException when closing InputStream
Remove unnecessary throws Exception