File transfer interception

I’ve created a plugin that intercepts and and logs XMPP traffic, which was simple enough to implement, but I’m having trouble determining how to intercept and log file transfers between Spark clients. Metadata is readily available, but I can’t find a mechanism for capturing the file itself. Is this a supported feature?

I don’t think so. I don’t think it would be feasible, for a couple of reasons:

  • there is not one generic mechanism used for file transfer. A event listener would need to take into account all possible mechanisms which would be difficult.
  • some file transfer mechanisms send data out-of-band, which makes it pretty hard to intercept
  • intercepting a file that is being transferred likely suggests that you’d want to have the entire file intercepted, before you hand it off to the intended recipient (or modify the file, or reject it, etc). This likely means that there’s a need for the entire file to be kept on disk or in memory, server-sided, pending the transfer. This would probably result in a poor user experience, but would also require quite a bit of system resources on the server.