/data/files/"); Router router = new Router(getContext()); router.attach("/static/", directory); An automatic content negotiation mechanism (similar to the one in Apache HTTP server) is used to select the best representation of a resource based on the available variants and on the client capabilities and preferences.
The directory can be used in read-only or modifiable mode. In the latter case, you just need to set the "modifiable" property to true. The currently supported methods are PUT and DELETE.
When no index is available in a given directory, a representation can be automatically generated by the {@link #getIndexRepresentation(Variant,ReferenceList)} method, unless the"listingAllowed" property is turned off. You can even customize the way the index entries are sorted by using the {@link #setComparator(Comparator)}method. The default sorting uses the friendly Alphanum algorithm based on David Koelle's
original idea, using a different and faster implementation contributed by Rob Heittman.
Concurrency note: instances of this class or its subclasses can be invoked by several threads at the same time and therefore must be thread-safe. You should be especially careful when storing state in member variables.
@see
User Guide -
Serving static files
@author Jerome Louvel