I'm using FileUtils.copyURLToFile(URL, File), an Apache Commons IO 2.4 part, to download and save the file on my computer. The problem is that some sites refuse connection without referrer and user agent data.
My questions:
- Is there any way to specify user agent and referrer to the
copyURLToFilemethod? - Or should I use another approach to download a file and then save a given
InputStreamto file?