public static File copy ( URL url , String encoding ) throws IOException , IllegalArgumentException { Params . notNull ( url , "Source URL" ) ; URLConnection connection = url . openConnection ( ) ; connection . setDoInput ( true ) ; return copy ( connection . getInputStream ( ) , encoding ) ; }
Copy text from URL using specified encoding to local temporary file then close both URL input stream and temporary file .