LPS-44052 Do not leave file handles open
LPS-44052 don't use url.openConnection if url is file (helps JBoss WildFly).
LPS-44052 Source formatting