jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rakesh Vidyadharan <rak...@sptci.com>
Subject Re: Export DataStore
Date Wed, 26 May 2010 15:31:39 GMT

On 26 May 2010, at 09:47, Davide Maestroni wrote:

> Hi all,
> I would like to know the best way to export the files stored on the file
> system, using the "org.apache.jackrabbit.core.data.FileDataStore" data store
> implementation, to a web site.
> Let me explain my problem in details. I have a Jackrabbit repository storing
> a lot of image files, and I need to publish such images to a web site. In
> order to avoid the overhead of querying each time the repository to get the
> correct file, I tried the following solution: I copied the whole directory
> used by the FileDataStore to another directory on my server, using rsync to
> keep the two synchronized. Then the idea was to serve the files to the
> clients by setting the "Expires" header to the maximum time allowed in the
> future (sort of "forever"). In this way I could take advantage of the
> garbage collection mechanism already implemented in the data store, so that
> one file would have immediately expired as soon as it was no more available
> in the data store directory, i.e. as soon as its content would have changed.
> And here is my issue: I couldn't find a way to map the original file name to
> the one generated by the FileDataStore.
> Can anybody suggest me a way to do that? Or maybe I am just on the wrong way
> and you can suggest me a better approach for publishing the images...
> Thanks in advance,
> Davide

A caching tier on top of the repository (ehcache or similar) would be easier IMHO.  The cache
takes care of keeping a cache file of the contents that are to be repeatedly served out, and
you have various configuration parameters to control cache expiry etc.  A simple caching servlet
filter will work just as well (I used the latter approach to serve out large XML files for
a REST webservice years ago).

View raw message