use of com.biglybt.core.html.HTMLException in project BiglyBT by BiglySoftware.
the class ResourceDownloaderMetaRefreshImpl method getSizeSupport.
protected long getSizeSupport() throws ResourceDownloaderException {
try {
ResourceDownloader x = delegate.getClone(this);
addReportListener(x);
HTMLPage page = HTMLPageFactory.loadPage(x.download());
URL base_url = (URL) x.getProperty("URL_URL");
URL redirect = page.getMetaRefreshURL(base_url);
if (redirect == null) {
ResourceDownloaderBaseImpl c = delegate.getClone(this);
addReportListener(c);
long res = c.getSize();
setProperties(c);
return (res);
} else {
ResourceDownloaderURLImpl c = new ResourceDownloaderURLImpl(getParent(), redirect);
addReportListener(c);
long res = c.getSize();
setProperties(c);
return (res);
}
} catch (HTMLException e) {
throw (new ResourceDownloaderException(this, "getSize failed", e));
}
}
Aggregations