This is not good code. You should never write a "catch (Exception e)" block because it is dangerous. It allows exceptions you did not expect to be caught and ignored. This damages the safety of your system.
Also, you are ignoring the exception once it's caught. It would be much better if you declared your method to throw IOException and got rid of the try/catch.
View All Comments
| View Tutorial