I have written the following scala code to download a file . The file gets downloaded correctly but also an exception is thrown. The code is as follows :
var
An alternative option is to use the system commands which is much cleaner and faster from what I can tell.
import sys.process._ import java.net.URL import java.io.File new URL("http://somehost.com/file.doc") #> new File("test.doc") !!