Emmanuel said:
Does anyone know a way to implement a progress bar with javamail?
I would like to show the estimated time for receiving e-mails with a big
attachment (a 3MO picture for example)?
Thanks for any idea.
Do you mean a graphical progress bar, in Swing for example, or a text based
one in a console? Either way, I'd say that it isn't really a Javamail
problem. You just have to set up your progress bar in the normal way, and
tell it how far along the task is. I think there's a tutorial for Swing
progress bars, and a text based one is fairly easy to implement.
You can determine the size of an attachment in Javamail with the getSize()
method in the Part class. Then, as you read the data from the input stream
you can work out how much more there is to do and update the progress bar
accordingly.