use try with resources syntax

Signed-off-by: olivier lamy <olamy@apache.org>
7 files changed