// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

public class Download {
    public static void download(String url, String fnm) throws IOException {
        OutputStream os = new FileOutputStream(fnm);
        HttpClient hc = new DefaultHttpClient();
        hc.execute(new HttpGet(url)).getEntity().writeTo(os);
        os.close();
    }
    public static void main(String[] args) throws IOException {
        download("http://www.eksperten.dk/", "/work/e.txt");
    }
}
