There is an online file (such as http://www.example.com/information.asp
) I need to grab and save to a directory. I know there are several methods for grabbing and reading online files (URLs) line-by-line, but is there a way to just download and save the file using Java?
23 Answers
Use Apache Commons IO. It is just one line of code:
FileUtils.copyURLToFile(URL, File)