import java.io.*;
import java.net.*;
public class HttpDownloader
{
    public static void main( String[] args )
    {
        try
        {
            URL url = new URL("http://192.168.100.14/Index.doc");
            URLConnection uc = url.openConnection();
            uc.connect();
            java.io.InputStream ins = uc.getInputStream();
            File f = new File("aaa.doc");
            java.io.FileOutputStream fos = new FileOutputStream(f);
            int i;
            while ((i=ins.read())!= -1)
            {
                fos.write(i);
            }
            ins.close();
            fos.flush();
            fos.close();
        }
        catch (IOException e)
        {
            e.printStackTrace ();
        }
    }
}