Please file an enhancement request in Bugzilla. This change could most likely be made in the post 2.0 code. As a side note, the content length (if present) can be read from the response headers.
Mike
On Mar 2, 2004, at 7:20 AM, George Armhold wrote:
Well I've been able to get a ProgressMonitorInputStream working with GetMethod. I can now get a ProgressMonitor to pop up for my downloads. I've had to wrap the InputStream returned from getResponseBodyAsStream() with a FilterInputStream that returns the contentLength for available(). I also had to extend GetMethod to make getResponseContentLength() public. Why is it protected?? This is kind of ugly, but it works.
/** * supply a hard-coded value for available() method. */ class FixedInputStream extends FilterInputStream { private int contentLength;
public FixedInputStream(InputStream is, int contentLength) { super(is); this.contentLength = contentLength; }
public int available() throws IOException { return contentLength; } }
/** * expose protected method getResponseContentLength. */ class FixedGetMethod extends GetMethod {
public FixedGetMethod(String url) { super(url); }
public int getResponseContentLength() { return super.getResponseContentLength(); } }
-- George Armhold Rutgers University eLearning Grant, DCIS
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
