Replace implementation of OpenmrsUtil.copyFile(inputStream, outputStream)
with the apache commons IOUtils.copy(inputStream, outputStream)
using try-with-resource we can make sure the outputStream is closed like its done in the current implementation.
This would reduce the code by using the well tested/often used apache commons IOUtils which this class already depends on.
And OpenmrsUtil.copyFile() isnt tested.