In reading Adrian's recommendation, it sounds like I can't be guaranteed that it will call createInputStream only once
Does the two settings above guarantee that createInputStream will be called only once, or should I adjust the InputStreamPartSource to handle the case where HttpClient asks for the new stream more than once?

You should definitely cater for the case where the stream needs to be created again. The simplest design (generally, perhaps not for you) is to have the createInputStream actually create the input stream instead of just returning it. This is particularly useful because it avoids creating the input stream altogether if the server can't be found or the request fails early for some other reason.


Having said that, for quite some time FilePart couldn't resend it's content without anyone noticing (true to murphy's law a client of mine hit the problem first), so there's a reasonable chance you'd get away without being able to resend.

The decision mostly comes down to what the consequences of failure are and how likely you are to have an authentication failure or some other error returned by the server (too busy, redirect, or any of a wide range of things that can cause the request to be resent).

David Sean Taylor

Hope that helps,


Adrian Sutton.

----------------------------------------------
Intencha "tomorrow's technology today"
Ph: 38478913 0422236329
Suite 8/29 Oatland Crescent
Holland Park West 4121
Australia QLD
www.intencha.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to