*/
//@Test
public void test_Download_Update_OverHTTP() throws FileNotFoundException, IOException, HttpException, Exception {
// Get metadata from http server
System.out.println("--------------------- test3 -----------------------");
Host host = new Host("localhost", "webdav", 8080, "me", "pwd", null, null);
final File fRemoteMeta = File.createTempFile("milton-zsync-remotemeta", null);
String url = host.getHref(Path.path("/source.txt/.zsync"));
host.doGet(url, new StreamReceiver() {
@Override
public void receive(InputStream in) throws IOException {
FileOutputStream fout = new FileOutputStream(fRemoteMeta);
StreamUtils.readTo(in, fout, true, true);
}
}, null);
System.out.println("meta file: " + fRemoteMeta.getAbsolutePath());
// Now build local file
com.ettrema.httpclient.File remoteFile = (com.ettrema.httpclient.File) host.find("/source.txt");
Assert.assertNotNull(remoteFile);
HttpRangeLoader rangeLoader = new HttpRangeLoader(remoteFile);
System.out.println("local: " + fLocal.getAbsolutePath());
fileMaker.make(fLocal, fRemoteMeta, rangeLoader);