commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafał Krupiński <>
Subject Re: [IO] Progress Monitor
Date Tue, 06 Apr 2010 21:20:44 GMT
On 06.04.2010 19:03, Gary Gregory wrote:
>> -----Original Message-----
>> From: Rafał Krupiński []
>> Sent: Tuesday, April 06, 2010 03:59
>> To: Commons Developers List
>> Subject: Re: [IO] Progress Monitor
>> interface ProgressMonitor{
>>   void begin(int whole);
>>   void progress(int current);
>>   void end();
>> }
>> would suffice.
>> What methods would you add this progress monitor support to?
>> IOUtils.copy/Large - for sure, anywhere else?
> Everywhere a stream is used for input or output. Everywhere a File is used. I would like
to replace my custom code with IOUtils and FilUtils calls to read from URL input streams and
File objects pointing to network drives. Reading from local files that are large enough on
a slow laptop drive needs feedback.
> I see adding a version of a method foo(...) with foo(..., ProgressMonitor) where foo(...)
calls the other method with a NullMonitor.
> The API also needs to be able to see a message as part of the progress, so your version
of begin() is too restrictive. You need to be able to say "Copying file Foo" and "Reading
x of n KB", etc. The Eclipse folks have this pretty well figured out by now :)

You want me to copy some bytes from one place to another and the source and the destination
is provided by you. 
This is one operation, do I really have to tell you what am I doing? I'd say you know better.

You can have your ConsoleProgressMonitor with task name and pretty messages, but copy() method
really doesn't 
have to know that.

BTW, since you've mentioned copying streams, I would add 'void begin();' to be used when the
size of the input 
is unknown.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message