If org.apache.commons.io.IOUtils is on your class path you might be able to use IOUtils.closeQuietly(st) to do everything here (depending on the version included).

Otherwise it is correct to do the null check try catch.

Again don't use e.printStackTrace() for error logging.