title: Download all images like wget does with Java on client-side
body: <p>It's perfectly easy to <a href="https://stackoverflow.com/questions/4602153/how-do-i-use-wget-to-download-all-images-into-a-single-folder">download all images from a website using wget</a>.</p>
  
  <p>But I need this feature on client-side, best would be in Java.</p>
  
  <p>I know wget's source can be accessed online, but I don't know any C and the source is quite complex. Of course, wget has also other features which "blow up the source" for me.</p>
  
  <p>As Java has a built-in <code>HttpClient</code>, yet I don't know how sophisticated wget really is, could you tell me if it is hard to re-implement the "download all images recursively" feature in Java?</p>
  
  <p>How is this done, exactly? Does wget fetch the HTML source code of the given URL, extract all URLs with the given file endings (.jpg, .png) from the HTML and downloads them? Does it also search for images in the stylesheets that are linked in that HTML document?</p>
  
  <p>How would you do this? Would you use regular expressions to search for (both relative and absolute) image URLs within the HTML document and let <code>HttpClient</code> download each of them? Or is there already some Java library that does something similar?</p>