You could do this by writing a wrapper to convert the file to a byte and putting this in the cache. On the other end, you could write a cache listener to de-serialize the byte to recreate the files.
It could be done, but this isn't a primary use case for JBoss Cache in any way. Still, I don't see why it cannot be done.
Thanks for the reply & suggestion. If JBossCache is not really designed for file replication across the cluster do you know what I should use?
I'm trying to use the farm but since my files are flat files and not something deployable, like a jar, I keep getting ZipExceptions. So its not working.
Like I said though, while file distribution has not been the primary use case for JBoss Cache, I can't see why it cannot be used for this purpose.
Other options may be a shared filesytem like NFS or Samba.