I have a self hosted JAX-RS REST service implemented with the JAX-RS Restlet extension.
Now I have to serve static content and I was wondering how to do it with JAX-RS. Note, that I do not know the physical directory structure at compile-time. So, given a URL like
http://bla-bla:8182/static/yaba/daba/doo.png
the file $(ROOT)/yaba/daba/doo.png
has to be returned, where $(ROOT)
is the static content root directory.
Is it possible to do it with pure JAX-RS?
Thanks.
EDIT
Known at compile-time:
- File system path of the static content root folder
- HTTP URL used to reference the static content root folder
Unknown at compile-time:
- The actual content of the root folder - how many files, file types, directory structure.