A resource is a file or other fixed data that an application may access. Resources are part of the application and are shipped with it, but are stored in external files. Examples are images, sounds, and translation (localization) of messages. In the Java world a resource is commonly bundled in the same jar file as the application itself.
URLPathyou can use as a
URL, or you can pass to it
open-input-fileto read the resource data. The
resource-nameis a string which is passed to the
ClassLoaderof the containing module. If the module class is in a jar file, things will magically work if the resource is in the same jar file, and
resource-nameis a filename relative to the module class in the jar. If the module is immediately evaluated, the
resource-nameis resolved against the location of the module source file.
Evaluates to a special URI that can be used to access resources relative to the class of the containing module. The URI has the form
"class-resource://in compiled code, to allow moving the classes/jars. The current
ClassLoaderis associated with the URI, so accessing resources using the URI will use that
ClassLoader. Therefore you should not create a
"class-resource:"URI except by using this function or
resolve-uri, since that might try to use the wrong
resource-urlworks by using
module-uriand resolving that to a normal