• Monday, January 19, 2015

    Java - Very simple HTTP file downloader

    Syed Masoom Rizvi
    Simple HTTP File Downloader (Full Code provided below)

    1. Create a URL object. (Example: URL obj = new URL("http://example.com");)
    2. Create HttpURLConnection object 'conn'.
    3. Open the connection of URL object and pass to the conn. (Ex: conn=obj.openConnection();)
    4. Set requestMethod property of 'conn' to "GET".