Be sure to do this in your Component constructor or another appropriate
spot:

getClients().add(Protocol.CLAP);

Then you want something like:

Directory directory = new Directory(getContext(), "clap://*system/*
images/");

The "host" part of the clap: URI must be specified: one of "system" or
"thread" will probably be right for your environment.

I find when serving static content via CLAP, I often want to modulate client
caching behavior so as not to beat on the classloader with repeat requests
-- the classloader does not give reliable information about file
modification times for stuff inside a non-extracted WAR or JAR.  For a
Directory subclass that fakes it, see:

http://gogoego.googlecode.com/svn/trunk/modules/RestletFoundation/src/com/solertium/container/ClapCacheDirectory.java

- R

Reply via email to