Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Event hierarchy confusion and problem

Hi Thomas,

Thomas Hallgren wrote:
I have the following scenario:

I want to read a file through a local cache. The file is found in the cache but before I use it I want to verify the size and last modified timestamp are equal to those of the remote source (hence by enhancement request: It almost works but for one little annoying detail. Namely that I'm forced to start the file transfer before I can get to my IIncomingFileTransfer instance.

The IIncomingFileTransferReceiveStart event inherits directly from IFileTransferEvent and not, as I first assumed, from the IIncomingFileTransferEvent. This means that it doesn't have a getSource() method. Is this intentional?

Yes. The idea here is that the IIncomingFileTransfer instance is returned from the receive method on IIncomingFileTransferReceiveStart..because in some protocols the methods exposed by IIncomingFileTransfer are not actually available/valid until the receive method completes successfully (i.e. returns a valid value/doesn't throw an exception).

So I think the course of adding accessors for info that for some providers is available prior to receive (i.e. on IIncomingFileTransferReceiveStartEvent) per is probably the way to go (allow the size and lastModified data to be accessed before receive for those providers that support that/have that information). Hopefully the lastModified and size will be enough, as it's not at all clear to me that other meta-data will be available for other transports. One cop out might be to provide a Properties getProperties() method on IIncomingFileTransferReceiveStartEvent but I would like to resist that for the time being.


Back to the top