private static Document loadHTML ( URL url , boolean useNamespace ) { InputStream stream = null ; try { stream = url . openConnection ( ) . getInputStream ( ) ; return loadHTML ( new InputSource ( stream ) , useNamespace ) ; } catch ( Exception e ) { throw new DomException ( e ) ; } finally { close ( stream ) ; } }
Helper method for HTML loading from URL .