I am trying to download and save a file from a web using the following code:
def readFileFromWeb = {
val website = new URL("http://....")
val rbc = Channels.newChannel(website.openStream());
val fos = new FileOutputStream("information.html");
fos.getChannel().transferFrom(rbc, 0, Long.MaxValue);
}
It works for everything, but for the link i want to use it returns exception: java.io.IOException: Server returned HTTP response code: 400 for URL This url has special access promotions and has a message to choose read only - how can i download it anyways...?
Aucun commentaire:
Enregistrer un commentaire