On Thursday, July 17, 2003, at 03:36 PM, Adrian Sutton wrote:
That does help.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.
Its going to take a few changes to the way I do things, but it will work for me.
This implies that I can't contribute the InputStreamPartSource to your codebase as is, since it will be coupled to my particular InputStream factory.
Thanks,
David -- David Sean Taylor Bluesunrise Software [EMAIL PROTECTED] +01 707 773-4646
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
