 <p>i would like to see the retrieveContent method's code if it's possible and if you are trying to read a url's html content directly then there is a nice example here <a href="http://docs.oracle.com/javase/tutorial/networking/urls/readingURL.html" rel="nofollow">http://docs.oracle.com/javase/tutorial/networking/urls/readingURL.html</a></p>