Java program to download resources from internet