Here is the code.
package downloader;
import java.net.MalformedURLException;
import java.net.URL;
import java.io.File;
import java.io.IOException;
public class JustATest {
public static void main(String[] args) throws IOException {
File file = new File("D:" + "//" + "Hunter x Hunter 340 - 00 - créditos.jpg");
URL url = new URL("http://leitor1.mangasproject.com/3e1e967e9b793e908f8eae83c74dba9bcccce6a5535b4b462bd9994537bfe15c/1c96b0ef48b44ff71102d96f7ac2b515a0b7be31d04d7420f3d133d923189953/Hunter x Hunter 340 - 00 - créditos.jpg");
org.apache.commons.io.FileUtils.copyURLToFile(url, file);
}
}
I'm getting this error when running this code:
Exception in thread "main" java.io.FileNotFoundException: http://leitor1.mangasproject.com/3e1e967e9b793e908f8eae83c74dba9bcccce6a5535b4b462bd9994537bfe15c/1c96b0ef48b44ff71102d96f7ac2b515a0b7be31d04d7420f3d133d923189953/Hunter x Hunter 340 - 00 - créditos.jpg
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.commons.io.FileUtils.copyURLToFile(FileUtils.java:1460)
at downloader.JustATest.main(JustATest.java:14)
I tried to use
InputStream in = new BufferedInputStream(url.openStream());
but this didnt work too.
Edit: I must say now that in NetBeans all the codes works fine, but, im coding in Eclipse. :( I must say too that most of the files of this host works fine in the Eclipse.