Project Page

Example Usage:

//We must setup logging for HttpClient, otherwise it will get 16x slower due to it wasting time
// trying to log and catching errors internally [rbeede, 2008-11]
Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.DEBUG);
Logger.getLogger("httpclient.wire").setLevel(Level.OFF); //really slow!
final URI[] uris = new URI[] {new URI("http://www.rodneybeede.com"), new URI("https://sourceforge.net/projects/chop-chophttpcl/")};
System.out.println("Current working directory: " + CWD.getAbsolutePath());
System.out.println();
final File[] files = new File[] {new File("file1"), new File("file1")};
System.out.println();
System.out.println("Commencing download of " + uris.length + " URIs...");
// You can also just pass null for username/password/domain
// You can also specify a proxy server username/password/domain
// The last argument is useful for GUIs that need to display progress
final Client client = new Client("username", "password", "ntlm domain", new EnvironmentProxySelector(), null, null, null, null);
// You could also have passed in an array of OutputStream instead of files
// The passed in files will be given last modified dates matching what the server gave
final DownloadResult[] downloadResults = client.download(uris, files, null);
for(DownloadResult downloadResult : downloadResults) {
if(downloadResult.getServerResponseCode() != 200) {
System.err.println(downloadResult.getURI() + " failed");
}
}