Good evening,
I have this code:
try{
java.net.URL url = new java.net.URL("http://mas.lne.es/fotos/img/2007/10/62/203093470447035b9bc5a095.43783284-foto_verano.jpg);
URLConnection urlCon = url.openConnection();
System.out.println(urlCon.getContentType());
InputStream is = urlCon.getInputStream()
//FileOutputStream fos = new FileOutputStream("C:\\Users\\estudiante.cda\\Downloads\\Fuentes.zip");
ZipOutputStream fos = new ZipOutputStream(new FileOutputStream("C:\\Users\\estudiante.cda\\Downloads\\Fuentes.zip"));
// name the file inside the zip file
fos.putNextEntry(new ZipEntry("Foto.jpg"));
byte[] array = new byte[4096];
int leido = is.read(array);
while(leido > 1){
fos.write(array,0,leido);
leido = is.read(array);
}
is.close();
fos.close();
}catch(Exception e){
e.printStackTrace();
}
}catch(Exception e){
e.printStackTrace();
}
And I get an error that is, it does not execute! Thank you so much.
The defined url must be specified as a string between double quotes: