java - jsoup unexpectedly fetching shopwiki image -


i using following code fetch images web:

import java.io.fileoutputstream; import java.io.ioexception;  import org.jsoup.jsoup;  public class fetchimagetest {     public static void main(string[] args) throws exception {                saveimage(args[0], args[1]);     }      private static boolean saveimage(string string, string destination) throws ioexception {          string = string.replaceall(" ", "%20");          try {             byte[] image = jsoup.connect(string).ignorecontenttype(true).timeout(10000).execute().bodyasbytes();              fileoutputstream os = new fileoutputstream(destination);              os.write(image);                     os.close();              return true;         }          catch (ioexception e) {             system.out.println("couldn't open " + string);             return false;         }             catch (exception e) {             system.out.println("couldn't open - general exception" + string);             return false;         }     } } 

due bug in of other code, tried fetch image broken url, of form:

http://shop.foo.comhttp://shop.foo.com/1.jpg 

my code ended fetching shopwiki image, shopwiki-image

i using jsoup-1.7.1.jar. there virus on server? there virus jsoup jar file?

i have no idea ...

several sites set system protect recovery of image.

i guess try retrieve images shopwiki.com watched url retrieve picture is established security.

http://si4.shopwiki.com/i/data/120x120/18/4/2/ahr0cdovl2vjec5pbwfnzxmtyw1hem9ulmnvbs9pbwfnzxmvss81mvmwwtbuzhbjtc5qcgc=.jpg


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -