Cornelius Lilge created IO-366:
----------------------------------
Summary: Provide feedback about the progress of time consuming
tasks
Key: IO-366
URL: https://issues.apache.org/jira/browse/IO-366
Project: Commons IO
Issue Type: New Feature
Components: Utilities
Affects Versions: 2.5
Reporter: Cornelius Lilge
Priority: Minor
While it is easy to copy directory structures with commons-io, it is afaik
impossible to provide user feedback about the copy progress - same applies for
move.
I would suggest providing alternative interfaces of all public {{copy*}} and
{{move*}} methods that include a "ProgressListener". The ProgressListener would
be a simple Interface like this:
public interface ProgressListener {
void onProgress(long currentBytes, long totalBytes);
}
So for example:
{{copyToDirectory(final File src, final File destDir)}}
would get its alter ego:
{{copyToDirectory(final File src, final File destDir, final ProgressListener
progressListener)}}
To avoid implementation overhead, I suggest that all currently existing
{{copy}} & {{move}} methods would then call the new methods with a {{null}}
parameter for the Progress Listener.
I did a quick & dirty proof on concept which you can view here:
bq. https://github.com/sne11ius/commons-io/
Please let me know what you think about it. If you like the idea, I will
provide a cleaner implementation with comments & tests.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira