Back
resource-data (clj)
(source)multimethod
(resource-data url)
Returns data about the resource specified by url, or nil if an
appropriate resource does not exist.
The return value is a map with optional values for:
:content - the content of the URL, suitable for use as the :body
of a ring response
:content-length - the length of the :content, nil if not available
:last-modified - the Date the :content was last modified, nil if not
available
This dispatches on the protocol of the URL as a keyword, and
implementations are provided for :file and :jar. If you are on a
platform where (Class/getResource) returns URLs with a different
protocol, you will need to provide an implementation for that
protocol.
This function is used internally by url-response.