Source code was taken from codejava.com
Edited a bit
Mainly what does is downloads the file from the URL

If file is specified by file ID (like in my case) than does the space on HDD check and downloads all the files in the scpecifeid range to the hdd.